Revision: 19553
Author: [email protected]
Date: Wed Feb 26 09:04:55 2014 UTC
Log: Merged r19440 into 3.23 branch.
Directly store the transition target on LookupResult in TransitionResult.
BUG=chromium:343964
LOG=N
[email protected]
Review URL: https://codereview.chromium.org/181223002
http://code.google.com/p/v8/source/detail?r=19553
Modified:
/branches/3.23/src/hydrogen-instructions.cc
/branches/3.23/src/hydrogen.cc
/branches/3.23/src/ic.cc
/branches/3.23/src/objects-inl.h
/branches/3.23/src/objects.h
/branches/3.23/src/property.cc
/branches/3.23/src/property.h
/branches/3.23/src/transitions-inl.h
/branches/3.23/src/version.cc
=======================================
--- /branches/3.23/src/hydrogen-instructions.cc Tue Jan 28 10:48:19 2014 UTC
+++ /branches/3.23/src/hydrogen-instructions.cc Wed Feb 26 09:04:55 2014 UTC
@@ -4296,14 +4296,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.23/src/hydrogen.cc Wed Feb 12 16:03:10 2014 UTC
+++ /branches/3.23/src/hydrogen.cc Wed Feb 26 09:04:55 2014 UTC
@@ -5230,7 +5230,7 @@
}
HObjectAccess field_access = HObjectAccess::ForField(map, lookup, name);
- bool transition_to_field = lookup->IsTransitionToField(*map);
+ bool transition_to_field = lookup->IsTransitionToField();
HStoreNamedField *instr;
if (FLAG_track_double_fields &&
field_access.representation().IsDouble()) {
@@ -5266,7 +5266,7 @@
}
if (transition_to_field) {
- Handle<Map> transition(lookup->GetTransitionMapFromMap(*map));
+ Handle<Map> transition(lookup->GetTransitionTarget());
HConstant* transition_constant = Add<HConstant>(transition);
instr->SetTransition(transition_constant, top_info());
// TODO(fschneider): Record the new map type of the object in the IR to
@@ -5306,7 +5306,7 @@
if (!lookup_transition) return false;
type->LookupTransition(NULL, *name, lookup);
- return lookup->IsTransitionToField(*type) &&
+ return lookup->IsTransitionToField() &&
(type->unused_property_fields() > 0);
}
=======================================
--- /branches/3.23/src/ic.cc Tue Dec 3 08:00:39 2013 UTC
+++ /branches/3.23/src/ic.cc Wed Feb 26 09:04:55 2014 UTC
@@ -1470,8 +1470,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
@@ -1482,7 +1481,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);
@@ -1629,12 +1628,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.23/src/objects-inl.h Wed Jan 29 15:14:12 2014 UTC
+++ /branches/3.23/src/objects-inl.h Wed Feb 26 09:04:55 2014 UTC
@@ -2343,6 +2343,11 @@
return number;
}
+
+
+PropertyDetails Map::GetLastDescriptorDetails() {
+ return instance_descriptors()->GetDetails(LastAdded());
+}
void Map::LookupDescriptor(JSObject* holder,
@@ -2362,7 +2367,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.23/src/objects.h Wed Jan 15 16:25:55 2014 UTC
+++ /branches/3.23/src/objects.h Wed Feb 26 09:04:55 2014 UTC
@@ -5990,6 +5990,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.23/src/property.cc Fri Jul 26 10:27:09 2013 UTC
+++ /branches/3.23/src/property.cc Wed Feb 26 09:04:55 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.23/src/property.h Wed Sep 11 08:25:48 2013 UTC
+++ /branches/3.23/src/property.h Wed Feb 26 09:04:55 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.23/src/transitions-inl.h Thu Aug 1 16:58:23 2013 UTC
+++ /branches/3.23/src/transitions-inl.h Wed Feb 26 09:04:55 2014 UTC
@@ -162,9 +162,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.23/src/version.cc Thu Feb 20 12:33:58 2014 UTC
+++ /branches/3.23/src/version.cc Wed Feb 26 09:04:55 2014 UTC
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 23
#define BUILD_NUMBER 17
-#define PATCH_LEVEL 14
+#define PATCH_LEVEL 15
// 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.