From 405d57fe005cefaa6a9847e62a2f207cdb26c4c7 Mon Sep 17 00:00:00 2001 From: "ulan@chromium.org" Date: Wed, 26 Oct 2011 12:35:12 +0000 Subject: [PATCH] Handlify CompileStoreCallback, CompileStoreInterceptor. R=kmillikin@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/8390045 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/stub-cache-arm.cc | 18 ++++++++++-------- src/ia32/stub-cache-ia32.cc | 18 ++++++++++-------- src/stub-cache.cc | 39 --------------------------------------- src/stub-cache.h | 8 -------- src/x64/stub-cache-x64.cc | 18 ++++++++++-------- 5 files changed, 30 insertions(+), 71 deletions(-) diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc index ff2873d..f9a10c4 100644 --- a/src/arm/stub-cache-arm.cc +++ b/src/arm/stub-cache-arm.cc @@ -2843,9 +2843,10 @@ Handle StoreStubCompiler::CompileStoreField(Handle object, } -MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, - AccessorInfo* callback, - String* name) { +Handle StoreStubCompiler::CompileStoreCallback( + Handle object, + Handle callback, + Handle name) { // ----------- S t a t e ------------- // -- r0 : value // -- r1 : receiver @@ -2872,7 +2873,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); __ push(r1); // receiver - __ mov(ip, Operand(Handle(callback))); // callback info + __ mov(ip, Operand(callback)); // callback info __ Push(ip, r2, r0); // Do tail-call to the runtime system. @@ -2887,12 +2888,13 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, __ Jump(ic, RelocInfo::CODE_TARGET); // Return the generated code. - return TryGetCode(CALLBACKS, name); + return GetCode(CALLBACKS, name); } -MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, - String* name) { +Handle StoreStubCompiler::CompileStoreInterceptor( + Handle receiver, + Handle name) { // ----------- S t a t e ------------- // -- r0 : value // -- r1 : receiver @@ -2935,7 +2937,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, __ Jump(ic, RelocInfo::CODE_TARGET); // Return the generated code. - return TryGetCode(INTERCEPTOR, name); + return GetCode(INTERCEPTOR, name); } diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc index 4b43aa9..af53acd 100644 --- a/src/ia32/stub-cache-ia32.cc +++ b/src/ia32/stub-cache-ia32.cc @@ -2725,9 +2725,10 @@ Handle StoreStubCompiler::CompileStoreField(Handle object, } -MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, - AccessorInfo* callback, - String* name) { +Handle StoreStubCompiler::CompileStoreCallback( + Handle object, + Handle callback, + Handle name) { // ----------- S t a t e ------------- // -- eax : value // -- ecx : name @@ -2755,7 +2756,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, __ pop(ebx); // remove the return address __ push(edx); // receiver - __ push(Immediate(Handle(callback))); // callback info + __ push(Immediate(callback)); // callback info __ push(ecx); // name __ push(eax); // value __ push(ebx); // restore return address @@ -2771,12 +2772,13 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, __ jmp(ic, RelocInfo::CODE_TARGET); // Return the generated code. - return TryGetCode(CALLBACKS, name); + return GetCode(CALLBACKS, name); } -MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, - String* name) { +Handle StoreStubCompiler::CompileStoreInterceptor( + Handle receiver, + Handle name) { // ----------- S t a t e ------------- // -- eax : value // -- ecx : name @@ -2820,7 +2822,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, __ jmp(ic, RelocInfo::CODE_TARGET); // Return the generated code. - return TryGetCode(INTERCEPTOR, name); + return GetCode(INTERCEPTOR, name); } diff --git a/src/stub-cache.cc b/src/stub-cache.cc index ad7a684..139bc2d 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -518,17 +518,6 @@ Handle StubCache::ComputeStoreGlobal(Handle name, } -Handle StoreStubCompiler::CompileStoreCallback( - Handle object, - Handle callback, - Handle name) { - CALL_HEAP_FUNCTION(isolate(), - (set_failure(NULL), - CompileStoreCallback(*object, *callback, *name)), - Code); -} - - Handle StubCache::ComputeStoreCallback(Handle name, Handle receiver, Handle callback, @@ -548,15 +537,6 @@ Handle StubCache::ComputeStoreCallback(Handle name, } -Handle StoreStubCompiler::CompileStoreInterceptor(Handle object, - Handle name) { - CALL_HEAP_FUNCTION(isolate(), - (set_failure(NULL), - CompileStoreInterceptor(*object, *name)), - Code); -} - - Handle StubCache::ComputeStoreInterceptor(Handle name, Handle receiver, StrictModeFlag strict_mode) { @@ -1558,25 +1538,6 @@ Handle StoreStubCompiler::GetCode(PropertyType type, } -// TODO(ulan): Eliminate this function when the stub cache is fully -// handlified. -MaybeObject* StoreStubCompiler::TryGetCode(PropertyType type, String* name) { - Code::Flags flags = - Code::ComputeMonomorphicFlags(Code::STORE_IC, type, strict_mode_); - MaybeObject* result = TryGetCodeWithFlags(flags, name); - if (!result->IsFailure()) { - PROFILE(isolate(), - CodeCreateEvent(Logger::STORE_IC_TAG, - Code::cast(result->ToObjectUnchecked()), - name)); - GDBJIT(AddCode(GDBJITInterface::STORE_IC, - name, - Code::cast(result->ToObjectUnchecked()))); - } - return result; -} - - Handle KeyedStoreStubCompiler::GetCode(PropertyType type, Handle name, InlineCacheState state) { diff --git a/src/stub-cache.h b/src/stub-cache.h index 0edbb4e..11fdb89 100644 --- a/src/stub-cache.h +++ b/src/stub-cache.h @@ -712,22 +712,14 @@ class StoreStubCompiler: public StubCompiler { Handle callback, Handle name); - MUST_USE_RESULT MaybeObject* CompileStoreCallback(JSObject* object, - AccessorInfo* callback, - String* name); Handle CompileStoreInterceptor(Handle object, Handle name); - MUST_USE_RESULT MaybeObject* CompileStoreInterceptor(JSObject* object, - String* name); - Handle CompileStoreGlobal(Handle object, Handle holder, Handle name); private: - MaybeObject* TryGetCode(PropertyType type, String* name); - Handle GetCode(PropertyType type, Handle name); StrictModeFlag strict_mode_; diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc index 6ddfbd9..8af1bf2 100644 --- a/src/x64/stub-cache-x64.cc +++ b/src/x64/stub-cache-x64.cc @@ -2593,9 +2593,10 @@ Handle StoreStubCompiler::CompileStoreField(Handle object, } -MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, - AccessorInfo* callback, - String* name) { +Handle StoreStubCompiler::CompileStoreCallback( + Handle object, + Handle callback, + Handle name) { // ----------- S t a t e ------------- // -- rax : value // -- rcx : name @@ -2623,7 +2624,7 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, __ pop(rbx); // remove the return address __ push(rdx); // receiver - __ Push(Handle(callback)); // callback info + __ Push(callback); // callback info __ push(rcx); // name __ push(rax); // value __ push(rbx); // restore return address @@ -2639,12 +2640,13 @@ MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object, __ Jump(ic, RelocInfo::CODE_TARGET); // Return the generated code. - return TryGetCode(CALLBACKS, name); + return GetCode(CALLBACKS, name); } -MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, - String* name) { +Handle StoreStubCompiler::CompileStoreInterceptor( + Handle receiver, + Handle name) { // ----------- S t a t e ------------- // -- rax : value // -- rcx : name @@ -2688,7 +2690,7 @@ MaybeObject* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver, __ Jump(ic, RelocInfo::CODE_TARGET); // Return the generated code. - return TryGetCode(INTERCEPTOR, name); + return GetCode(INTERCEPTOR, name); } -- 2.7.4