Revision: 12100
Author: [email protected]
Date: Mon Jul 16 08:26:10 2012
Log: Remove LookupTransitionOrDescriptor altogether.
Review URL: https://chromiumcodereview.appspot.com/10778011
http://code.google.com/p/v8/source/detail?r=12100
Modified:
/branches/bleeding_edge/src/arm/lithium-codegen-arm.cc
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/objects.h
=======================================
--- /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Fri Jul 13
09:33:27 2012
+++ /branches/bleeding_edge/src/arm/lithium-codegen-arm.cc Mon Jul 16
08:26:10 2012
@@ -2579,7 +2579,7 @@
Handle<String> name,
LEnvironment* env) {
LookupResult lookup(isolate());
- type->LookupTransitionOrDescriptor(NULL, *name, &lookup);
+ type->LookupDescriptor(NULL, *name, &lookup);
ASSERT(lookup.IsFound() || lookup.IsCacheable());
if (lookup.IsField()) {
int index = lookup.GetLocalFieldIndexFromMap(*type);
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Wed Jul 11
13:11:04 2012
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Mon Jul 16
08:26:10 2012
@@ -1689,13 +1689,9 @@
LookupResult lookup(isolate);
Map* map = JSObject::cast(current)->map();
- map->LookupTransitionOrDescriptor(NULL, *name, &lookup);
- if (lookup.IsFound()) {
- if (!lookup.IsTransition()) return false;
- } else if (!lookup.IsCacheable()) {
- return false;
- }
-
+ map->LookupDescriptor(NULL, *name, &lookup);
+ if (lookup.IsFound()) return false;
+ if (!lookup.IsCacheable()) return false;
current = JSObject::cast(current)->GetPrototype();
}
return true;
@@ -1720,7 +1716,7 @@
++i) {
Handle<Map> map = types->at(i);
LookupResult lookup(map->GetIsolate());
- map->LookupTransitionOrDescriptor(NULL, *name, &lookup);
+ map->LookupDescriptor(NULL, *name, &lookup);
if (lookup.IsFound()) {
switch (lookup.type()) {
case FIELD: {
@@ -1739,10 +1735,6 @@
case CALLBACKS:
break;
case TRANSITION:
- if (PrototypeChainCanNeverResolve(map, name)) {
- negative_lookups.Add(types->at(i), zone);
- }
- break;
case INTERCEPTOR:
case NONEXISTENT:
case NORMAL:
@@ -1750,10 +1742,9 @@
UNREACHABLE();
break;
}
- } else if (lookup.IsCacheable()) {
- if (PrototypeChainCanNeverResolve(map, name)) {
- negative_lookups.Add(types->at(i), zone);
- }
+ } else if (lookup.IsCacheable() &&
+ PrototypeChainCanNeverResolve(map, name)) {
+ negative_lookups.Add(types->at(i), zone);
}
}
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Fri Jul 13
09:33:27 2012
+++ /branches/bleeding_edge/src/ia32/lithium-codegen-ia32.cc Mon Jul 16
08:26:10 2012
@@ -2410,7 +2410,7 @@
Handle<String> name,
LEnvironment* env) {
LookupResult lookup(isolate());
- type->LookupTransitionOrDescriptor(NULL, *name, &lookup);
+ type->LookupDescriptor(NULL, *name, &lookup);
ASSERT(lookup.IsFound() || lookup.IsCacheable());
if (lookup.IsField()) {
int index = lookup.GetLocalFieldIndexFromMap(*type);
=======================================
--- /branches/bleeding_edge/src/objects.cc Mon Jul 16 07:47:28 2012
+++ /branches/bleeding_edge/src/objects.cc Mon Jul 16 08:26:10 2012
@@ -2148,20 +2148,6 @@
}
result->NotFound();
}
-
-
-void Map::LookupTransitionOrDescriptor(JSObject* holder,
- String* name,
- LookupResult* result) {
- // AccessorPairs containing both a Descriptor and a Transition are shared
- // between the DescriptorArray and the Transition array. This is why
looking
- // up the AccessorPair solely in the DescriptorArray works.
- // TODO(verwaest) This should be implemented differently so the
- // DescriptorArray is free of transitions; and so we can freely share it.
- this->LookupDescriptor(holder, name, result);
- if (result->IsFound()) return;
- this->LookupTransition(holder, name, result);
-}
static bool ContainsMap(MapHandleList* maps, Handle<Map> map) {
@@ -4202,8 +4188,7 @@
}
-void JSReceiver::Lookup(String* name,
- LookupResult* result) {
+void JSReceiver::Lookup(String* name, LookupResult* result) {
// Ecma-262 3rd 8.6.2.4
Heap* heap = GetHeap();
for (Object* current = this;
@@ -12545,10 +12530,9 @@
// Allocate the fixed array for the fields.
Object* fields;
- { MaybeObject* maybe_fields =
- heap->AllocateFixedArray(number_of_allocated_fields);
- if (!maybe_fields->ToObject(&fields)) return maybe_fields;
- }
+ MaybeObject* maybe_fields =
+ heap->AllocateFixedArray(number_of_allocated_fields);
+ if (!maybe_fields->ToObject(&fields)) return maybe_fields;
// Fill in the instance descriptor and the fields.
int next_descriptor = 0;
=======================================
--- /branches/bleeding_edge/src/objects.h Mon Jul 16 07:47:28 2012
+++ /branches/bleeding_edge/src/objects.h Mon Jul 16 08:26:10 2012
@@ -4905,10 +4905,6 @@
String* name,
LookupResult* result);
- void LookupTransitionOrDescriptor(JSObject* holder,
- String* name,
- LookupResult* result);
-
MUST_USE_RESULT MaybeObject* RawCopy(int instance_size);
MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors();
MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev