From 67936a7b168f116d595d0d7646217372c17f36ab Mon Sep 17 00:00:00 2001 From: "lrn@chromium.org" Date: Thu, 30 Jul 2009 12:09:51 +0000 Subject: [PATCH] X64: Fix lint problem and add missing stub function. Review URL: http://codereview.chromium.org/160387 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2588 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ic.cc | 3 --- src/x64/codegen-x64.cc | 3 ++- src/x64/stub-cache-x64.cc | 39 ++++++++++++++++++++++++++++++--------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/ic.cc b/src/ic.cc index 053a1f0..f4d74c9 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -737,8 +737,6 @@ Object* KeyedLoadIC::Load(State state, return TypeError("non_object_property_load", object, name); } - // TODO(X64): Enable specialized stubs for length and prototype lookup. -#ifndef V8_TARGET_ARCH_X64 if (FLAG_use_ic) { // Use specialized code for getting the length of strings. if (object->IsString() && name->Equals(Heap::length_symbol())) { @@ -778,7 +776,6 @@ Object* KeyedLoadIC::Load(State state, return Accessors::FunctionGetPrototype(*object, 0); } } -#endif // !V8_TARGET_ARCH_X64 // Check if the name is trivially convertible to an index and get // the element or char if so. diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc index 6a038ca..3112ecc 100644 --- a/src/x64/codegen-x64.cc +++ b/src/x64/codegen-x64.cc @@ -5459,7 +5459,8 @@ void Reference::GetValue(TypeofState typeof_state) { __ bind(deferred->patch_site()); // Use masm-> here instead of the double underscore macro since extra // coverage code can interfere with the patching. - masm->movq(kScratchRegister, Factory::null_value(), RelocInfo::EMBEDDED_OBJECT); + masm->movq(kScratchRegister, Factory::null_value(), + RelocInfo::EMBEDDED_OBJECT); masm->cmpq(FieldOperand(receiver.reg(), HeapObject::kMapOffset), kScratchRegister); deferred->Branch(not_equal); diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index 7d7f5eb..091c826 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -1144,6 +1144,36 @@ Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object, } +Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, + JSObject* receiver, + JSObject* holder, + AccessorInfo* callback) { + // ----------- S t a t e ------------- + // -- rsp[0] : return address + // -- rsp[8] : name + // -- rsp[16] : receiver + // ----------------------------------- + Label miss; + + __ movq(rax, Operand(rsp, kPointerSize)); + __ movq(rcx, Operand(rsp, 2 * kPointerSize)); + __ IncrementCounter(&Counters::keyed_load_callback, 1); + + // Check that the name has not changed. + __ Cmp(rax, Handle(name)); + __ j(not_equal, &miss); + + GenerateLoadCallback(receiver, holder, rcx, rax, rbx, rdx, + callback, name, &miss); + __ bind(&miss); + __ DecrementCounter(&Counters::keyed_load_callback, 1); + GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); + + // Return the generated code. + return GetCode(CALLBACKS, name); +} + + Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { // ----------- S t a t e ------------- // -- rsp[0] : return address @@ -1170,15 +1200,6 @@ Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { } -Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, - JSObject* object, - JSObject* holder, - AccessorInfo* callback) { - UNIMPLEMENTED(); - return NULL; -} - - Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, JSObject* receiver, JSObject* holder, -- 2.7.4