Revision: 9803
Author:   [email protected]
Date:     Wed Oct 26 05:35:12 2011
Log:      Handlify CompileStoreCallback, CompileStoreInterceptor.

[email protected]
BUG=
TEST=

Review URL: http://codereview.chromium.org/8390045
http://code.google.com/p/v8/source/detail?r=9803

Modified:
 /branches/bleeding_edge/src/arm/stub-cache-arm.cc
 /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc
 /branches/bleeding_edge/src/stub-cache.cc
 /branches/bleeding_edge/src/stub-cache.h
 /branches/bleeding_edge/src/x64/stub-cache-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/stub-cache-arm.cc Wed Oct 26 03:45:24 2011 +++ /branches/bleeding_edge/src/arm/stub-cache-arm.cc Wed Oct 26 05:35:12 2011
@@ -2843,9 +2843,10 @@
 }


-MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
- AccessorInfo* callback,
-                                                     String* name) {
+Handle<Code> StoreStubCompiler::CompileStoreCallback(
+    Handle<JSObject> object,
+    Handle<AccessorInfo> callback,
+    Handle<String> name) {
   // ----------- S t a t e -------------
   //  -- r0    : value
   //  -- r1    : receiver
@@ -2872,7 +2873,7 @@
   ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());

   __ push(r1);  // receiver
-  __ mov(ip, Operand(Handle<AccessorInfo>(callback)));  // callback info
+  __ mov(ip, Operand(callback));  // callback info
   __ Push(ip, r2, r0);

   // Do tail-call to the runtime system.
@@ -2887,12 +2888,13 @@
   __ 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<Code> StoreStubCompiler::CompileStoreInterceptor(
+    Handle<JSObject> receiver,
+    Handle<String> name) {
   // ----------- S t a t e -------------
   //  -- r0    : value
   //  -- r1    : receiver
@@ -2935,7 +2937,7 @@
   __ Jump(ic, RelocInfo::CODE_TARGET);

   // Return the generated code.
-  return TryGetCode(INTERCEPTOR, name);
+  return GetCode(INTERCEPTOR, name);
 }


=======================================
--- /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Wed Oct 26 03:45:24 2011 +++ /branches/bleeding_edge/src/ia32/stub-cache-ia32.cc Wed Oct 26 05:35:12 2011
@@ -2725,9 +2725,10 @@
 }


-MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
- AccessorInfo* callback,
-                                                     String* name) {
+Handle<Code> StoreStubCompiler::CompileStoreCallback(
+    Handle<JSObject> object,
+    Handle<AccessorInfo> callback,
+    Handle<String> name) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : name
@@ -2755,7 +2756,7 @@

   __ pop(ebx);  // remove the return address
   __ push(edx);  // receiver
-  __ push(Immediate(Handle<AccessorInfo>(callback)));  // callback info
+  __ push(Immediate(callback));  // callback info
   __ push(ecx);  // name
   __ push(eax);  // value
   __ push(ebx);  // restore return address
@@ -2771,12 +2772,13 @@
   __ 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<Code> StoreStubCompiler::CompileStoreInterceptor(
+    Handle<JSObject> receiver,
+    Handle<String> name) {
   // ----------- S t a t e -------------
   //  -- eax    : value
   //  -- ecx    : name
@@ -2820,7 +2822,7 @@
   __ jmp(ic, RelocInfo::CODE_TARGET);

   // Return the generated code.
-  return TryGetCode(INTERCEPTOR, name);
+  return GetCode(INTERCEPTOR, name);
 }


=======================================
--- /branches/bleeding_edge/src/stub-cache.cc   Wed Oct 26 03:45:24 2011
+++ /branches/bleeding_edge/src/stub-cache.cc   Wed Oct 26 05:35:12 2011
@@ -516,17 +516,6 @@
   JSObject::UpdateMapCodeCache(receiver, name, code);
   return code;
 }
-
-
-Handle<Code> StoreStubCompiler::CompileStoreCallback(
-    Handle<JSObject> object,
-    Handle<AccessorInfo> callback,
-    Handle<String> name) {
-  CALL_HEAP_FUNCTION(isolate(),
-                     (set_failure(NULL),
-                      CompileStoreCallback(*object, *callback, *name)),
-                     Code);
-}


 Handle<Code> StubCache::ComputeStoreCallback(Handle<String> name,
@@ -546,15 +535,6 @@
   JSObject::UpdateMapCodeCache(receiver, name, code);
   return code;
 }
-
-
-Handle<Code> StoreStubCompiler::CompileStoreInterceptor(Handle<JSObject> object, - Handle<String> name) {
-  CALL_HEAP_FUNCTION(isolate(),
-                     (set_failure(NULL),
-                      CompileStoreInterceptor(*object, *name)),
-                     Code);
-}


 Handle<Code> StubCache::ComputeStoreInterceptor(Handle<String> name,
@@ -1556,25 +1536,6 @@
   GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code));
   return code;
 }
-
-
-// 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<Code> KeyedStoreStubCompiler::GetCode(PropertyType type,
=======================================
--- /branches/bleeding_edge/src/stub-cache.h    Wed Oct 26 03:45:24 2011
+++ /branches/bleeding_edge/src/stub-cache.h    Wed Oct 26 05:35:12 2011
@@ -712,22 +712,14 @@
                                     Handle<AccessorInfo> callback,
                                     Handle<String> name);

-  MUST_USE_RESULT MaybeObject* CompileStoreCallback(JSObject* object,
-                                                    AccessorInfo* callback,
-                                                    String* name);
   Handle<Code> CompileStoreInterceptor(Handle<JSObject> object,
                                        Handle<String> name);

-  MUST_USE_RESULT MaybeObject* CompileStoreInterceptor(JSObject* object,
-                                                       String* name);
-
   Handle<Code> CompileStoreGlobal(Handle<GlobalObject> object,
                                   Handle<JSGlobalPropertyCell> holder,
                                   Handle<String> name);

  private:
-  MaybeObject* TryGetCode(PropertyType type, String* name);
-
   Handle<Code> GetCode(PropertyType type, Handle<String> name);

   StrictModeFlag strict_mode_;
=======================================
--- /branches/bleeding_edge/src/x64/stub-cache-x64.cc Wed Oct 26 03:45:24 2011 +++ /branches/bleeding_edge/src/x64/stub-cache-x64.cc Wed Oct 26 05:35:12 2011
@@ -2593,9 +2593,10 @@
 }


-MaybeObject* StoreStubCompiler::CompileStoreCallback(JSObject* object,
- AccessorInfo* callback,
-                                                     String* name) {
+Handle<Code> StoreStubCompiler::CompileStoreCallback(
+    Handle<JSObject> object,
+    Handle<AccessorInfo> callback,
+    Handle<String> name) {
   // ----------- S t a t e -------------
   //  -- rax    : value
   //  -- rcx    : name
@@ -2623,7 +2624,7 @@

   __ pop(rbx);  // remove the return address
   __ push(rdx);  // receiver
-  __ Push(Handle<AccessorInfo>(callback));  // callback info
+  __ Push(callback);  // callback info
   __ push(rcx);  // name
   __ push(rax);  // value
   __ push(rbx);  // restore return address
@@ -2639,12 +2640,13 @@
   __ 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<Code> StoreStubCompiler::CompileStoreInterceptor(
+    Handle<JSObject> receiver,
+    Handle<String> name) {
   // ----------- S t a t e -------------
   //  -- rax    : value
   //  -- rcx    : name
@@ -2688,7 +2690,7 @@
   __ Jump(ic, RelocInfo::CODE_TARGET);

   // Return the generated code.
-  return TryGetCode(INTERCEPTOR, name);
+  return GetCode(INTERCEPTOR, name);
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to