Commit 7cb94437 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove LookupTransitionOrDescriptor altogether.

Review URL: https://chromiumcodereview.appspot.com/10778011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 77ccfe89
...@@ -2579,7 +2579,7 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, ...@@ -2579,7 +2579,7 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result,
Handle<String> name, Handle<String> name,
LEnvironment* env) { LEnvironment* env) {
LookupResult lookup(isolate()); LookupResult lookup(isolate());
type->LookupTransitionOrDescriptor(NULL, *name, &lookup); type->LookupDescriptor(NULL, *name, &lookup);
ASSERT(lookup.IsFound() || lookup.IsCacheable()); ASSERT(lookup.IsFound() || lookup.IsCacheable());
if (lookup.IsField()) { if (lookup.IsField()) {
int index = lookup.GetLocalFieldIndexFromMap(*type); int index = lookup.GetLocalFieldIndexFromMap(*type);
......
...@@ -1689,13 +1689,9 @@ static bool PrototypeChainCanNeverResolve( ...@@ -1689,13 +1689,9 @@ static bool PrototypeChainCanNeverResolve(
LookupResult lookup(isolate); LookupResult lookup(isolate);
Map* map = JSObject::cast(current)->map(); Map* map = JSObject::cast(current)->map();
map->LookupTransitionOrDescriptor(NULL, *name, &lookup); map->LookupDescriptor(NULL, *name, &lookup);
if (lookup.IsFound()) { if (lookup.IsFound()) return false;
if (!lookup.IsTransition()) return false; if (!lookup.IsCacheable()) return false;
} else if (!lookup.IsCacheable()) {
return false;
}
current = JSObject::cast(current)->GetPrototype(); current = JSObject::cast(current)->GetPrototype();
} }
return true; return true;
...@@ -1720,7 +1716,7 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context, ...@@ -1720,7 +1716,7 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context,
++i) { ++i) {
Handle<Map> map = types->at(i); Handle<Map> map = types->at(i);
LookupResult lookup(map->GetIsolate()); LookupResult lookup(map->GetIsolate());
map->LookupTransitionOrDescriptor(NULL, *name, &lookup); map->LookupDescriptor(NULL, *name, &lookup);
if (lookup.IsFound()) { if (lookup.IsFound()) {
switch (lookup.type()) { switch (lookup.type()) {
case FIELD: { case FIELD: {
...@@ -1739,10 +1735,6 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context, ...@@ -1739,10 +1735,6 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context,
case CALLBACKS: case CALLBACKS:
break; break;
case TRANSITION: case TRANSITION:
if (PrototypeChainCanNeverResolve(map, name)) {
negative_lookups.Add(types->at(i), zone);
}
break;
case INTERCEPTOR: case INTERCEPTOR:
case NONEXISTENT: case NONEXISTENT:
case NORMAL: case NORMAL:
...@@ -1750,10 +1742,9 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context, ...@@ -1750,10 +1742,9 @@ HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context,
UNREACHABLE(); UNREACHABLE();
break; break;
} }
} else if (lookup.IsCacheable()) { } else if (lookup.IsCacheable() &&
if (PrototypeChainCanNeverResolve(map, name)) { PrototypeChainCanNeverResolve(map, name)) {
negative_lookups.Add(types->at(i), zone); negative_lookups.Add(types->at(i), zone);
}
} }
} }
......
...@@ -2410,7 +2410,7 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, ...@@ -2410,7 +2410,7 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result,
Handle<String> name, Handle<String> name,
LEnvironment* env) { LEnvironment* env) {
LookupResult lookup(isolate()); LookupResult lookup(isolate());
type->LookupTransitionOrDescriptor(NULL, *name, &lookup); type->LookupDescriptor(NULL, *name, &lookup);
ASSERT(lookup.IsFound() || lookup.IsCacheable()); ASSERT(lookup.IsFound() || lookup.IsCacheable());
if (lookup.IsField()) { if (lookup.IsField()) {
int index = lookup.GetLocalFieldIndexFromMap(*type); int index = lookup.GetLocalFieldIndexFromMap(*type);
......
...@@ -2150,20 +2150,6 @@ void Map::LookupTransition(JSObject* holder, ...@@ -2150,20 +2150,6 @@ void Map::LookupTransition(JSObject* holder,
} }
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) { static bool ContainsMap(MapHandleList* maps, Handle<Map> map) {
ASSERT(!map.is_null()); ASSERT(!map.is_null());
for (int i = 0; i < maps->length(); ++i) { for (int i = 0; i < maps->length(); ++i) {
...@@ -4202,8 +4188,7 @@ void JSReceiver::LocalLookup(String* name, LookupResult* result) { ...@@ -4202,8 +4188,7 @@ void JSReceiver::LocalLookup(String* name, LookupResult* result) {
} }
void JSReceiver::Lookup(String* name, void JSReceiver::Lookup(String* name, LookupResult* result) {
LookupResult* result) {
// Ecma-262 3rd 8.6.2.4 // Ecma-262 3rd 8.6.2.4
Heap* heap = GetHeap(); Heap* heap = GetHeap();
for (Object* current = this; for (Object* current = this;
...@@ -12545,10 +12530,9 @@ MaybeObject* StringDictionary::TransformPropertiesToFastFor( ...@@ -12545,10 +12530,9 @@ MaybeObject* StringDictionary::TransformPropertiesToFastFor(
// Allocate the fixed array for the fields. // Allocate the fixed array for the fields.
Object* fields; Object* fields;
{ MaybeObject* maybe_fields = MaybeObject* maybe_fields =
heap->AllocateFixedArray(number_of_allocated_fields); heap->AllocateFixedArray(number_of_allocated_fields);
if (!maybe_fields->ToObject(&fields)) return maybe_fields; if (!maybe_fields->ToObject(&fields)) return maybe_fields;
}
// Fill in the instance descriptor and the fields. // Fill in the instance descriptor and the fields.
int next_descriptor = 0; int next_descriptor = 0;
......
...@@ -4905,10 +4905,6 @@ class Map: public HeapObject { ...@@ -4905,10 +4905,6 @@ class Map: public HeapObject {
String* name, String* name,
LookupResult* result); LookupResult* result);
void LookupTransitionOrDescriptor(JSObject* holder,
String* name,
LookupResult* result);
MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); MUST_USE_RESULT MaybeObject* RawCopy(int instance_size);
MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors();
MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment