Revision: 23347
Author:   [email protected]
Date:     Mon Aug 25 11:20:43 2014 UTC
Log:      Move "slow handler" compiler code to handler-compiler

BUG=
[email protected]

Review URL: https://codereview.chromium.org/496283004
https://code.google.com/p/v8/source/detail?r=23347

Modified:
 /branches/bleeding_edge/src/builtins.cc
 /branches/bleeding_edge/src/code-stubs.cc
 /branches/bleeding_edge/src/ic/arm/handler-compiler-arm.cc
 /branches/bleeding_edge/src/ic/arm/ic-arm.cc
 /branches/bleeding_edge/src/ic/arm64/handler-compiler-arm64.cc
 /branches/bleeding_edge/src/ic/arm64/ic-arm64.cc
 /branches/bleeding_edge/src/ic/handler-compiler.cc
 /branches/bleeding_edge/src/ic/handler-compiler.h
 /branches/bleeding_edge/src/ic/ia32/handler-compiler-ia32.cc
 /branches/bleeding_edge/src/ic/ia32/ic-ia32.cc
 /branches/bleeding_edge/src/ic/x64/handler-compiler-x64.cc
 /branches/bleeding_edge/src/ic/x64/ic-x64.cc

=======================================
--- /branches/bleeding_edge/src/builtins.cc     Mon Aug 25 11:17:37 2014 UTC
+++ /branches/bleeding_edge/src/builtins.cc     Mon Aug 25 11:20:43 2014 UTC
@@ -1296,11 +1296,6 @@
 static void Generate_KeyedLoadIC_SloppyArguments(MacroAssembler* masm) {
   KeyedLoadIC::GenerateSloppyArguments(masm);
 }
-
-
-static void Generate_StoreIC_Slow(MacroAssembler* masm) {
-  StoreIC::GenerateSlow(masm);
-}


 static void Generate_StoreIC_Miss(MacroAssembler* masm) {
@@ -1311,6 +1306,16 @@
 static void Generate_StoreIC_Normal(MacroAssembler* masm) {
   StoreIC::GenerateNormal(masm);
 }
+
+
+static void Generate_StoreIC_Slow(MacroAssembler* masm) {
+  NamedStoreHandlerCompiler::GenerateSlow(masm);
+}
+
+
+static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) {
+  ElementHandlerCompiler::GenerateStoreSlow(masm);
+}


 static void Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) {
@@ -1331,11 +1336,6 @@
 static void Generate_KeyedStoreIC_Miss(MacroAssembler* masm) {
   KeyedStoreIC::GenerateMiss(masm);
 }
-
-
-static void Generate_KeyedStoreIC_Slow(MacroAssembler* masm) {
-  KeyedStoreIC::GenerateSlow(masm);
-}


 static void Generate_KeyedStoreIC_Initialize(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/code-stubs.cc   Mon Aug 25 11:17:37 2014 UTC
+++ /branches/bleeding_edge/src/code-stubs.cc   Mon Aug 25 11:20:43 2014 UTC
@@ -690,7 +690,7 @@
       UNREACHABLE();
       break;
     case DICTIONARY_ELEMENTS:
-      ElementHandlerCompiler::GenerateStoreDictionaryElement(masm);
+      ElementHandlerCompiler::GenerateStoreSlow(masm);
       break;
     case SLOPPY_ARGUMENTS_ELEMENTS:
       UNREACHABLE();
=======================================
--- /branches/bleeding_edge/src/ic/arm/handler-compiler-arm.cc Mon Aug 25 11:17:37 2014 UTC +++ /branches/bleeding_edge/src/ic/arm/handler-compiler-arm.cc Mon Aug 25 11:20:43 2014 UTC
@@ -312,6 +312,32 @@

   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
 }
+
+
+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
+  // Push receiver, key and value for runtime call.
+  __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+          StoreIC::ValueRegister());
+
+ // The slow case calls into the runtime to complete the store without causing + // an IC miss that would otherwise cause a transition to the generic stub.
+  ExternalReference ref =
+      ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}
+
+
+void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
+  // Push receiver, key and value for runtime call.
+  __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+          StoreIC::ValueRegister());
+
+ // The slow case calls into the runtime to complete the store without causing + // an IC miss that would otherwise cause a transition to the generic stub.
+  ExternalReference ref =
+ ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/arm/ic-arm.cc Fri Aug 22 12:48:15 2014 UTC +++ /branches/bleeding_edge/src/ic/arm/ic-arm.cc Mon Aug 25 11:20:43 2014 UTC
@@ -731,30 +731,6 @@
       ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
   __ TailCallExternalReference(ref, 3, 1);
 }
-
-
-void StoreIC::GenerateSlow(MacroAssembler* masm) {
-  // Push receiver, key and value for runtime call.
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- // The slow case calls into the runtime to complete the store without causing - // an IC miss that would otherwise cause a transition to the generic stub.
-  ExternalReference ref =
-      ExternalReference(IC_Utility(kStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}
-
-
-void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
-  // Push receiver, key and value for runtime call.
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- // The slow case calls into the runtime to complete the store without causing - // an IC miss that would otherwise cause a transition to the generic stub.
-  ExternalReference ref =
-      ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}


 static void KeyedStoreGenerateGenericHelper(
=======================================
--- /branches/bleeding_edge/src/ic/arm64/handler-compiler-arm64.cc Mon Aug 25 11:17:37 2014 UTC +++ /branches/bleeding_edge/src/ic/arm64/handler-compiler-arm64.cc Mon Aug 25 11:20:43 2014 UTC
@@ -304,6 +304,34 @@
   __ Bind(&miss);
   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
 }
+
+
+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
+  // Push receiver, name and value for runtime call.
+  __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+          StoreIC::ValueRegister());
+
+ // The slow case calls into the runtime to complete the store without causing + // an IC miss that would otherwise cause a transition to the generic stub.
+  ExternalReference ref =
+      ExternalReference(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}
+
+
+void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
+  ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow");
+
+  // Push receiver, key and value for runtime call.
+  __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+          StoreIC::ValueRegister());
+
+ // The slow case calls into the runtime to complete the store without causing + // an IC miss that would otherwise cause a transition to the generic stub.
+  ExternalReference ref =
+ ExternalReference(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/arm64/ic-arm64.cc Fri Aug 22 12:48:15 2014 UTC +++ /branches/bleeding_edge/src/ic/arm64/ic-arm64.cc Mon Aug 25 11:20:43 2014 UTC
@@ -773,20 +773,6 @@
       ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
   __ TailCallExternalReference(ref, 3, 1);
 }
-
-
-void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
-  ASM_LOCATION("KeyedStoreIC::GenerateSlow");
-
-  // Push receiver, key and value for runtime call.
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- // The slow case calls into the runtime to complete the store without causing - // an IC miss that would otherwise cause a transition to the generic stub.
-  ExternalReference ref =
-      ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}


 static void KeyedStoreGenerateGenericHelper(
@@ -1067,25 +1053,6 @@
   __ IncrementCounter(counters->store_normal_miss(), 1, x4, x5);
   GenerateMiss(masm);
 }
-
-
-void StoreIC::GenerateSlow(MacroAssembler* masm) {
-  // ---------- S t a t e --------------
-  //  -- x0     : value
-  //  -- x1     : receiver
-  //  -- x2     : name
-  //  -- lr     : return address
-  // -----------------------------------
-
-  // Push receiver, name and value for runtime call.
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
- // The slow case calls into the runtime to complete the store without causing - // an IC miss that would otherwise cause a transition to the generic stub.
-  ExternalReference ref =
-      ExternalReference(IC_Utility(kStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}


 Condition CompareIC::ComputeCondition(Token::Value op) {
=======================================
--- /branches/bleeding_edge/src/ic/handler-compiler.cc Mon Aug 25 11:17:37 2014 UTC +++ /branches/bleeding_edge/src/ic/handler-compiler.cc Mon Aug 25 11:20:43 2014 UTC
@@ -388,11 +388,5 @@
     handlers->Add(cached_stub);
   }
 }
-
-
-void ElementHandlerCompiler::GenerateStoreDictionaryElement(
-    MacroAssembler* masm) {
-  KeyedStoreIC::GenerateSlow(masm);
-}
 }
 }  // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/ic/handler-compiler.h Mon Aug 25 11:17:37 2014 UTC +++ /branches/bleeding_edge/src/ic/handler-compiler.h Mon Aug 25 11:20:43 2014 UTC
@@ -220,6 +220,8 @@
     GenerateStoreViaSetter(masm, Handle<HeapType>::null(), no_reg,
                            Handle<JSFunction>());
   }
+
+  static void GenerateSlow(MacroAssembler* masm);

  protected:
   virtual Register FrontendHeader(Register object_reg, Handle<Name> name,
@@ -267,7 +269,7 @@
                               CodeHandleList* handlers);

   static void GenerateLoadDictionaryElement(MacroAssembler* masm);
-  static void GenerateStoreDictionaryElement(MacroAssembler* masm);
+  static void GenerateStoreSlow(MacroAssembler* masm);
 };
 }
 }  // namespace v8::internal
=======================================
--- /branches/bleeding_edge/src/ic/ia32/handler-compiler-ia32.cc Mon Aug 25 11:17:37 2014 UTC +++ /branches/bleeding_edge/src/ic/ia32/handler-compiler-ia32.cc Mon Aug 25 11:20:43 2014 UTC
@@ -324,6 +324,41 @@
__ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), NamedLoadHandlerCompiler::kInterceptorArgsLength);
 }
+
+
+static void StoreIC_PushArgs(MacroAssembler* masm) {
+  Register receiver = StoreIC::ReceiverRegister();
+  Register name = StoreIC::NameRegister();
+  Register value = StoreIC::ValueRegister();
+
+  DCHECK(!ebx.is(receiver) && !ebx.is(name) && !ebx.is(value));
+
+  __ pop(ebx);
+  __ push(receiver);
+  __ push(name);
+  __ push(value);
+  __ push(ebx);
+}
+
+
+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
+  // Return address is on the stack.
+  StoreIC_PushArgs(masm);
+
+  // Do tail-call to runtime routine.
+  ExternalReference ref(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}
+
+
+void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
+  // Return address is on the stack.
+  StoreIC_PushArgs(masm);
+
+  // Do tail-call to runtime routine.
+ ExternalReference ref(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/ia32/ic-ia32.cc Fri Aug 22 12:48:15 2014 UTC +++ /branches/bleeding_edge/src/ic/ia32/ic-ia32.cc Mon Aug 25 11:20:43 2014 UTC
@@ -1016,26 +1016,6 @@
       ExternalReference(IC_Utility(kKeyedStoreIC_Miss), masm->isolate());
   __ TailCallExternalReference(ref, 3, 1);
 }
-
-
-void StoreIC::GenerateSlow(MacroAssembler* masm) {
-  // Return address is on the stack.
-  StoreIC_PushArgs(masm);
-
-  // Do tail-call to runtime routine.
-  ExternalReference ref(IC_Utility(kStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}
-
-
-void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
-  // Return address is on the stack.
-  StoreIC_PushArgs(masm);
-
-  // Do tail-call to runtime routine.
-  ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/x64/handler-compiler-x64.cc Mon Aug 25 11:17:37 2014 UTC +++ /branches/bleeding_edge/src/ic/x64/handler-compiler-x64.cc Mon Aug 25 11:20:43 2014 UTC
@@ -8,6 +8,7 @@

 #include "src/ic/call-optimization.h"
 #include "src/ic/handler-compiler.h"
+#include "src/ic/ic.h"

 namespace v8 {
 namespace internal {
@@ -317,6 +318,41 @@
   // -----------------------------------
   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
 }
+
+
+static void StoreIC_PushArgs(MacroAssembler* masm) {
+  Register receiver = StoreIC::ReceiverRegister();
+  Register name = StoreIC::NameRegister();
+  Register value = StoreIC::ValueRegister();
+
+  DCHECK(!rbx.is(receiver) && !rbx.is(name) && !rbx.is(value));
+
+  __ PopReturnAddressTo(rbx);
+  __ Push(receiver);
+  __ Push(name);
+  __ Push(value);
+  __ PushReturnAddressFrom(rbx);
+}
+
+
+void NamedStoreHandlerCompiler::GenerateSlow(MacroAssembler* masm) {
+  // Return address is on the stack.
+  StoreIC_PushArgs(masm);
+
+  // Do tail-call to runtime routine.
+  ExternalReference ref(IC_Utility(IC::kStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}
+
+
+void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
+  // Return address is on the stack.
+  StoreIC_PushArgs(masm);
+
+  // Do tail-call to runtime routine.
+ ExternalReference ref(IC_Utility(IC::kKeyedStoreIC_Slow), masm->isolate());
+  __ TailCallExternalReference(ref, 3, 1);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/x64/ic-x64.cc Fri Aug 22 12:48:15 2014 UTC +++ /branches/bleeding_edge/src/ic/x64/ic-x64.cc Mon Aug 25 11:20:43 2014 UTC
@@ -1010,26 +1010,6 @@
   __ IncrementCounter(counters->store_normal_miss(), 1);
   GenerateMiss(masm);
 }
-
-
-void StoreIC::GenerateSlow(MacroAssembler* masm) {
-  // Return address is on the stack.
-  StoreIC_PushArgs(masm);
-
-  // Do tail-call to runtime routine.
-  ExternalReference ref(IC_Utility(kStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}
-
-
-void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
-  // Return address is on the stack.
-  StoreIC_PushArgs(masm);
-
-  // Do tail-call to runtime routine.
-  ExternalReference ref(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
-  __ TailCallExternalReference(ref, 3, 1);
-}


 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to