Revision: 19551
Author: [email protected]
Date: Wed Feb 26 08:17:48 2014 UTC
Log: Merged r19440 into 3.24 branch.
Directly store the transition target on LookupResult in TransitionResult.
BUG=chromium:343964
LOG=N
[email protected]
Review URL: https://codereview.chromium.org/179163003
http://code.google.com/p/v8/source/detail?r=19551
Modified:
/branches/3.24/src/hydrogen-instructions.cc
/branches/3.24/src/hydrogen.cc
/branches/3.24/src/hydrogen.h
/branches/3.24/src/ic.cc
/branches/3.24/src/objects-inl.h
/branches/3.24/src/objects.h
/branches/3.24/src/property.cc
/branches/3.24/src/property.h
/branches/3.24/src/transitions-inl.h
/branches/3.24/src/version.cc
=======================================
--- /branches/3.24/src/hydrogen-instructions.cc Thu Feb 6 01:06:18 2014 UTC
+++ /branches/3.24/src/hydrogen-instructions.cc Wed Feb 26 08:17:48 2014 UTC
@@ -4354,14 +4354,14 @@
HObjectAccess HObjectAccess::ForField(Handle<Map> map,
LookupResult* lookup,
Handle<String> name) {
- ASSERT(lookup->IsField() || lookup->IsTransitionToField(*map));
+ ASSERT(lookup->IsField() || lookup->IsTransitionToField());
int index;
Representation representation;
if (lookup->IsField()) {
index = lookup->GetLocalFieldIndexFromMap(*map);
representation = lookup->representation();
} else {
- Map* transition = lookup->GetTransitionMapFromMap(*map);
+ Map* transition = lookup->GetTransitionTarget();
int descriptor = transition->LastAdded();
index = transition->instance_descriptors()->GetFieldIndex(descriptor) -
map->inobject_properties();
=======================================
--- /branches/3.24/src/hydrogen.cc Fri Feb 7 09:11:16 2014 UTC
+++ /branches/3.24/src/hydrogen.cc Wed Feb 26 08:17:48 2014 UTC
@@ -5466,8 +5466,7 @@
if (lookup_.IsPropertyCallbacks()) return true;
Handle<Map> map = this->map();
map->LookupTransition(NULL, *name_, &lookup_);
- if (lookup_.IsTransitionToField(*map) && map->unused_property_fields() >
0) {
- transition_ = handle(lookup_.GetTransitionMapFromMap(*map));
+ if (lookup_.IsTransitionToField() && map->unused_property_fields() > 0) {
return true;
}
return false;
=======================================
--- /branches/3.24/src/hydrogen.h Fri Feb 7 09:11:16 2014 UTC
+++ /branches/3.24/src/hydrogen.h Wed Feb 26 08:17:48 2014 UTC
@@ -2359,7 +2359,7 @@
Handle<JSObject> holder() { return holder_; }
Handle<JSFunction> accessor() { return accessor_; }
Handle<Object> constant() { return constant_; }
- Handle<Object> transition() { return transition_; }
+ Handle<Map> transition() { return
handle(lookup_.GetTransitionTarget()); }
HObjectAccess access() { return access_; }
private:
@@ -2386,7 +2386,6 @@
Handle<JSFunction> accessor_;
Handle<JSObject> api_holder_;
Handle<Object> constant_;
- Handle<Map> transition_;
HObjectAccess access_;
};
=======================================
--- /branches/3.24/src/ic.cc Wed Feb 5 03:04:56 2014 UTC
+++ /branches/3.24/src/ic.cc Wed Feb 26 08:17:48 2014 UTC
@@ -1140,8 +1140,7 @@
// receiver when trying to fetch extra information from the transition.
receiver->map()->LookupTransition(*holder, *name, lookup);
if (!lookup->IsTransition()) return false;
- PropertyDetails target_details =
- lookup->GetTransitionDetails(receiver->map());
+ PropertyDetails target_details = lookup->GetTransitionDetails();
if (target_details.IsReadOnly()) return false;
// If the value that's being stored does not fit in the field that the
@@ -1152,7 +1151,7 @@
// transition target.
ASSERT(!receiver->map()->is_deprecated());
if (!value->FitsRepresentation(target_details.representation())) {
- Handle<Map> target(lookup->GetTransitionMapFromMap(receiver->map()));
+ Handle<Map> target(lookup->GetTransitionTarget());
Map::GeneralizeRepresentation(
target, target->LastAdded(),
value->OptimalRepresentation(), FORCE_FIELD);
@@ -1325,12 +1324,8 @@
case TRANSITION: {
// Explicitly pass in the receiver map since LookupForWrite may have
// stored something else than the receiver in the holder.
- Handle<Map> transition(
- lookup->GetTransitionTarget(receiver->map()), isolate());
- int descriptor = transition->LastAdded();
-
- DescriptorArray* target_descriptors =
transition->instance_descriptors();
- PropertyDetails details = target_descriptors->GetDetails(descriptor);
+ Handle<Map> transition(lookup->GetTransitionTarget());
+ PropertyDetails details = transition->GetLastDescriptorDetails();
if (details.type() == CALLBACKS || details.attributes() != NONE)
break;
=======================================
--- /branches/3.24/src/objects-inl.h Fri Feb 7 09:11:16 2014 UTC
+++ /branches/3.24/src/objects-inl.h Wed Feb 26 08:17:48 2014 UTC
@@ -2500,6 +2500,11 @@
return number;
}
+
+
+PropertyDetails Map::GetLastDescriptorDetails() {
+ return instance_descriptors()->GetDetails(LastAdded());
+}
void Map::LookupDescriptor(JSObject* holder,
@@ -2519,7 +2524,8 @@
TransitionArray* transition_array = transitions();
int number = transition_array->Search(name);
if (number != TransitionArray::kNotFound) {
- return result->TransitionResult(holder, number);
+ return result->TransitionResult(
+ holder, transition_array->GetTarget(number));
}
}
result->NotFound();
=======================================
--- /branches/3.24/src/objects.h Wed Feb 5 03:04:56 2014 UTC
+++ /branches/3.24/src/objects.h Wed Feb 26 08:17:48 2014 UTC
@@ -6115,6 +6115,8 @@
Name* name,
LookupResult* result);
+ inline PropertyDetails GetLastDescriptorDetails();
+
// The size of transition arrays are limited so they do not end up in
large
// object space. Otherwise ClearNonLiveTransitions would leak memory
while
// applying in-place right trimming.
=======================================
--- /branches/3.24/src/property.cc Fri Jul 26 10:27:09 2013 UTC
+++ /branches/3.24/src/property.cc Wed Feb 26 08:17:48 2014 UTC
@@ -35,6 +35,7 @@
LookupResult* current = this; // Could be NULL.
while (current != NULL) {
visitor->VisitPointer(BitCast<Object**>(¤t->holder_));
+ visitor->VisitPointer(BitCast<Object**>(¤t->transition_));
current = current->next_;
}
}
@@ -82,13 +83,13 @@
case FIELD:
PrintF(out, " -type = map transition\n");
PrintF(out, " -map:\n");
- GetTransitionMap()->Print(out);
+ GetTransitionTarget()->Print(out);
PrintF(out, "\n");
return;
case CONSTANT:
PrintF(out, " -type = constant property transition\n");
PrintF(out, " -map:\n");
- GetTransitionMap()->Print(out);
+ GetTransitionTarget()->Print(out);
PrintF(out, "\n");
return;
case CALLBACKS:
=======================================
--- /branches/3.24/src/property.h Wed Sep 11 08:25:48 2013 UTC
+++ /branches/3.24/src/property.h Wed Feb 26 08:17:48 2014 UTC
@@ -184,6 +184,7 @@
next_(isolate->top_lookup_result()),
lookup_type_(NOT_FOUND),
holder_(NULL),
+ transition_(NULL),
cacheable_(true),
details_(NONE, NONEXISTENT, Representation::None()) {
isolate->SetTopLookupResult(this);
@@ -201,6 +202,7 @@
holder_ = holder;
details_ = details;
number_ = number;
+ transition_ = NULL;
}
bool CanHoldValue(Handle<Object> value) {
@@ -209,16 +211,18 @@
return value->FitsRepresentation(details_.representation());
}
- void TransitionResult(JSObject* holder, int number) {
+ void TransitionResult(JSObject* holder, Map* target) {
lookup_type_ = TRANSITION_TYPE;
details_ = PropertyDetails(NONE, TRANSITION, Representation::None());
holder_ = holder;
- number_ = number;
+ transition_ = target;
+ number_ = 0xAAAA;
}
void DictionaryResult(JSObject* holder, int entry) {
lookup_type_ = DICTIONARY_TYPE;
holder_ = holder;
+ transition_ = NULL;
details_ = holder->property_dictionary()->DetailsAt(entry);
number_ = entry;
}
@@ -226,6 +230,7 @@
void HandlerResult(JSProxy* proxy) {
lookup_type_ = HANDLER_TYPE;
holder_ = proxy;
+ transition_ = NULL;
details_ = PropertyDetails(NONE, HANDLER, Representation::Tagged());
cacheable_ = false;
}
@@ -233,6 +238,7 @@
void InterceptorResult(JSObject* holder) {
lookup_type_ = INTERCEPTOR_TYPE;
holder_ = holder;
+ transition_ = NULL;
details_ = PropertyDetails(NONE, INTERCEPTOR,
Representation::Tagged());
}
@@ -248,7 +254,7 @@
}
JSProxy* proxy() {
- ASSERT(IsFound());
+ ASSERT(IsHandler());
return JSProxy::cast(holder_);
}
@@ -372,43 +378,21 @@
UNREACHABLE();
return NULL;
}
-
- Map* GetTransitionTarget(Map* map) {
- ASSERT(IsTransition());
- TransitionArray* transitions = map->transitions();
- return transitions->GetTarget(number_);
- }
Map* GetTransitionTarget() {
- return GetTransitionTarget(holder()->map());
- }
-
- PropertyDetails GetTransitionDetails(Map* map) {
- ASSERT(IsTransition());
- TransitionArray* transitions = map->transitions();
- return transitions->GetTargetDetails(number_);
+ return transition_;
}
PropertyDetails GetTransitionDetails() {
- return GetTransitionDetails(holder()->map());
- }
-
- bool IsTransitionToField(Map* map) {
- return IsTransition() && GetTransitionDetails(map).type() == FIELD;
- }
-
- bool IsTransitionToConstant(Map* map) {
- return IsTransition() && GetTransitionDetails(map).type() == CONSTANT;
+ return transition_->GetLastDescriptorDetails();
}
- Map* GetTransitionMap() {
- ASSERT(IsTransition());
- return Map::cast(GetValue());
+ bool IsTransitionToField() {
+ return IsTransition() && GetTransitionDetails().type() == FIELD;
}
- Map* GetTransitionMapFromMap(Map* map) {
- ASSERT(IsTransition());
- return map->transitions()->GetTarget(number_);
+ bool IsTransitionToConstant() {
+ return IsTransition() && GetTransitionDetails().type() == CONSTANT;
}
int GetTransitionIndex() {
@@ -501,6 +485,7 @@
} lookup_type_;
JSReceiver* holder_;
+ Map* transition_;
int number_;
bool cacheable_;
PropertyDetails details_;
=======================================
--- /branches/3.24/src/transitions-inl.h Mon Dec 23 16:17:49 2013 UTC
+++ /branches/3.24/src/transitions-inl.h Wed Feb 26 08:17:48 2014 UTC
@@ -160,9 +160,7 @@
PropertyDetails TransitionArray::GetTargetDetails(int transition_number) {
Map* map = GetTarget(transition_number);
- DescriptorArray* descriptors = map->instance_descriptors();
- int descriptor = map->LastAdded();
- return descriptors->GetDetails(descriptor);
+ return map->GetLastDescriptorDetails();
}
=======================================
--- /branches/3.24/src/version.cc Thu Feb 20 12:05:37 2014 UTC
+++ /branches/3.24/src/version.cc Wed Feb 26 08:17:48 2014 UTC
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 24
#define BUILD_NUMBER 35
-#define PATCH_LEVEL 1
+#define PATCH_LEVEL 2
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.