From 518481d5e69d080005d5374b4c74bfb0296f7fa0 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Wed, 14 Apr 2010 11:45:03 +0000 Subject: [PATCH] Revert change 4401. Review URL: http://codereview.chromium.org/1589035 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4416 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/stub-cache-arm.cc | 30 ------------------------------ src/globals.h | 6 +----- src/ia32/stub-cache-ia32.cc | 26 -------------------------- src/ic.cc | 7 ++----- src/stub-cache.cc | 22 ---------------------- src/stub-cache.h | 11 ----------- src/x64/stub-cache-x64.cc | 30 ------------------------------ 7 files changed, 3 insertions(+), 129 deletions(-) diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index 62b0373..bbffef22 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -1389,36 +1389,6 @@ Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object, } -Object* LoadStubCompiler::CompileLoadNonexistent(JSObject* object) { - // ----------- S t a t e ------------- - // -- r2 : name - // -- lr : return address - // -- [sp] : receiver - // ----------------------------------- - Label miss; - - // Load receiver. - __ ldr(r0, MemOperand(sp, 0)); - - // Check the maps of the full prototype chain. - JSObject* last = object; - while (last->GetPrototype() != Heap::null_value()) { - last = JSObject::cast(last->GetPrototype()); - } - CheckPrototypes(object, r0, last, r3, r1, Heap::empty_string(), &miss); - - // Return undefined if maps of the full prototype chain is still the same. - __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); - __ Ret(); - - __ bind(&miss); - GenerateLoadMiss(masm(), Code::LOAD_IC); - - // Return the generated code. - return GetCode(NONEXISTENT, Heap::empty_string()); -} - - Object* LoadStubCompiler::CompileLoadField(JSObject* object, JSObject* holder, int index, diff --git a/src/globals.h b/src/globals.h index 410cb3f..3d48e2d 100644 --- a/src/globals.h +++ b/src/globals.h @@ -428,11 +428,7 @@ enum PropertyType { CONSTANT_TRANSITION = 6, // only in fast mode NULL_DESCRIPTOR = 7, // only in fast mode // All properties before MAP_TRANSITION are real. - FIRST_PHANTOM_PROPERTY_TYPE = MAP_TRANSITION, - // There are no IC stubs for NULL_DESCRIPTORS. Therefore, - // NULL_DESCRIPTOR can be used as the type flag for IC stubs for - // nonexistent properties. - NONEXISTENT = NULL_DESCRIPTOR + FIRST_PHANTOM_PROPERTY_TYPE = MAP_TRANSITION }; diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index 396a5a3..315600b 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -1948,32 +1948,6 @@ Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, } -Object* LoadStubCompiler::CompileLoadNonexistent(JSObject* object) { - // ----------- S t a t e ------------- - // -- eax : receiver - // -- ecx : name - // -- esp[0] : return address - // ----------------------------------- - Label miss; - - // Check the maps of the full prototype chain. - JSObject* last = object; - while (last->GetPrototype() != Heap::null_value()) { - last = JSObject::cast(last->GetPrototype()); - } - CheckPrototypes(object, eax, last, ebx, edx, Heap::empty_string(), &miss); - - // Return undefined if maps of the full prototype chain is still the same. - __ mov(eax, Factory::undefined_value()); - __ ret(0); - - __ bind(&miss); - GenerateLoadMiss(masm(), Code::LOAD_IC); - - // Return the generated code. - return GetCode(NONEXISTENT, Heap::empty_string()); -} - Object* LoadStubCompiler::CompileLoadField(JSObject* object, JSObject* holder, diff --git a/src/ic.cc b/src/ic.cc index 410699c..b9ca00f 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -694,8 +694,8 @@ void LoadIC::UpdateCaches(LookupResult* lookup, State state, Handle object, Handle name) { - // Bail out if the result is not cachable. - if (!lookup->IsCacheable()) return; + // Bail out if we didn't find a result. + if (!lookup->IsProperty() || !lookup->IsCacheable()) return; // Loading properties from values is not common, so don't try to // deal with non-JS objects here. @@ -709,9 +709,6 @@ void LoadIC::UpdateCaches(LookupResult* lookup, // Set the target to the pre monomorphic stub to delay // setting the monomorphic state. code = pre_monomorphic_stub(); - } else if (!lookup->IsProperty()) { - // Nonexistent property. The result is undefined. - code = StubCache::ComputeLoadNonexistent(*name, *receiver); } else { // Compute monomorphic stub. switch (lookup->type()) { diff --git a/src/stub-cache.cc b/src/stub-cache.cc index d77dc25..95877fb 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -93,28 +93,6 @@ Code* StubCache::Set(String* name, Map* map, Code* code) { } -Object* StubCache::ComputeLoadNonexistent(String* name, JSObject* receiver) { - // The code stub for loading nonexistent properties can be reused - // for all names, so we use the empty_string as the name in the map - // code cache. - Code::Flags flags = - Code::ComputeMonomorphicFlags(Code::LOAD_IC, NONEXISTENT); - Object* code = receiver->map()->FindInCodeCache(Heap::empty_string(), flags); - if (code->IsUndefined()) { - LoadStubCompiler compiler; - code = compiler.CompileLoadNonexistent(receiver); - if (code->IsFailure()) return code; - PROFILE(CodeCreateEvent(Logger::LOAD_IC_TAG, - Code::cast(code), - Heap::empty_string())); - Object* result = receiver->map()->UpdateCodeCache(Heap::empty_string(), - Code::cast(code)); - if (result->IsFailure()) return result; - } - return Set(name, receiver->map(), Code::cast(code)); -} - - Object* StubCache::ComputeLoadField(String* name, JSObject* receiver, JSObject* holder, diff --git a/src/stub-cache.h b/src/stub-cache.h index 8a68977..0ca37e7 100644 --- a/src/stub-cache.h +++ b/src/stub-cache.h @@ -56,8 +56,6 @@ class StubCache : public AllStatic { // Computes the right stub matching. Inserts the result in the // cache before returning. This might compile a stub if needed. - static Object* ComputeLoadNonexistent(String* name, JSObject* receiver); - static Object* ComputeLoadField(String* name, JSObject* receiver, JSObject* holder, @@ -463,23 +461,18 @@ class StubCompiler BASE_EMBEDDED { class LoadStubCompiler: public StubCompiler { public: - Object* CompileLoadNonexistent(JSObject* object); - Object* CompileLoadField(JSObject* object, JSObject* holder, int index, String* name); - Object* CompileLoadCallback(String* name, JSObject* object, JSObject* holder, AccessorInfo* callback); - Object* CompileLoadConstant(JSObject* object, JSObject* holder, Object* value, String* name); - Object* CompileLoadInterceptor(JSObject* object, JSObject* holder, String* name); @@ -501,21 +494,17 @@ class KeyedLoadStubCompiler: public StubCompiler { JSObject* object, JSObject* holder, int index); - Object* CompileLoadCallback(String* name, JSObject* object, JSObject* holder, AccessorInfo* callback); - Object* CompileLoadConstant(String* name, JSObject* object, JSObject* holder, Object* value); - Object* CompileLoadInterceptor(JSObject* object, JSObject* holder, String* name); - Object* CompileLoadArrayLength(String* name); Object* CompileLoadStringLength(String* name); Object* CompileLoadFunctionPrototype(String* name); diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index cd9a86d..03b21a5 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -1144,36 +1144,6 @@ Object* LoadStubCompiler::CompileLoadConstant(JSObject* object, } -Object* LoadStubCompiler::CompileLoadNonexistent(JSObject* object) { - // ----------- S t a t e ------------- - // -- rcx : name - // -- rsp[0] : return address - // -- rsp[8] : receiver - // ----------------------------------- - Label miss; - - // Load receiver. - __ movq(rax, Operand(rsp, kPointerSize)); - - // Check the maps of the full prototype chain. - JSObject* last = object; - while (last->GetPrototype() != Heap::null_value()) { - last = JSObject::cast(last->GetPrototype()); - } - CheckPrototypes(object, rax, last, rbx, rdx, Heap::empty_string(), &miss); - - // Return undefined if maps of the full prototype chain is still the same. - __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); - __ ret(0); - - __ bind(&miss); - GenerateLoadMiss(masm(), Code::LOAD_IC); - - // Return the generated code. - return GetCode(NONEXISTENT, Heap::empty_string()); -} - - Object* LoadStubCompiler::CompileLoadField(JSObject* object, JSObject* holder, int index, -- 2.7.4