Revision: 23311
Author:   [email protected]
Date:     Fri Aug 22 12:48:15 2014 UTC
Log: Remove KeyedStoreIC::GenerateRuntimeSetProperty and move Store::GenerateRuntimeSetProperty to the PropertyICCompiler

BUG=
[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/ic/arm/ic-arm.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/arm/ic-arm.cc Fri Aug 22 12:48:15 2014 UTC
@@ -8,6 +8,7 @@

 #include "src/codegen.h"
 #include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
 #include "src/ic/stub-cache.h"

 namespace v8 {
@@ -754,18 +755,6 @@
       ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
   __ TailCallExternalReference(ref, 3, 1);
 }
-
-
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                              StrictMode strict_mode) {
-  // Push receiver, key and value for runtime call.
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
-  __ mov(r0, Operand(Smi::FromInt(strict_mode)));  // Strict mode.
-  __ Push(r0);
-
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}


 static void KeyedStoreGenerateGenericHelper(
@@ -965,7 +954,7 @@
   // r0: value.
   // r1: key.
   // r2: receiver.
-  GenerateRuntimeSetProperty(masm, strict_mode);
+  PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);

   // Extra capacity case: Check if there is extra capacity to
   // perform the store and update the length. Used for adding one
@@ -1060,18 +1049,6 @@
   __ IncrementCounter(counters->store_normal_miss(), 1, r4, r5);
   GenerateMiss(masm);
 }
-
-
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                         StrictMode strict_mode) {
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
-  __ mov(r0, Operand(Smi::FromInt(strict_mode)));
-  __ Push(r0);
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/arm/ic-compiler-arm.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/arm/ic-compiler-arm.cc Fri Aug 22 12:48:15 2014 UTC
@@ -962,6 +962,19 @@

   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
 }
+
+
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+  __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+          StoreIC::ValueRegister());
+
+  __ mov(r0, Operand(Smi::FromInt(strict_mode)));
+  __ Push(r0);
+
+  // Do tail-call to runtime routine.
+  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/arm64/ic-arm64.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/arm64/ic-arm64.cc Fri Aug 22 12:48:15 2014 UTC
@@ -8,6 +8,7 @@

 #include "src/codegen.h"
 #include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
 #include "src/ic/stub-cache.h"

 namespace v8 {
@@ -786,21 +787,6 @@
       ExternalReference(IC_Utility(kKeyedStoreIC_Slow), masm->isolate());
   __ TailCallExternalReference(ref, 3, 1);
 }
-
-
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                              StrictMode strict_mode) {
-  ASM_LOCATION("KeyedStoreIC::GenerateRuntimeSetProperty");
-
-  // Push receiver, key and value for runtime call.
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
-  // Push strict_mode for runtime call.
-  __ Mov(x10, Smi::FromInt(strict_mode));
-  __ Push(x10);
-
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}


 static void KeyedStoreGenerateGenericHelper(
@@ -989,7 +975,7 @@
   //  x0: value
   //  x1: key
   //  x2: receiver
-  GenerateRuntimeSetProperty(masm, strict_mode);
+  PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);


   __ Bind(&extra);
@@ -1081,20 +1067,6 @@
   __ IncrementCounter(counters->store_normal_miss(), 1, x4, x5);
   GenerateMiss(masm);
 }
-
-
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                         StrictMode strict_mode) {
-  ASM_LOCATION("StoreIC::GenerateRuntimeSetProperty");
-
-  __ Push(ReceiverRegister(), NameRegister(), ValueRegister());
-
-  __ Mov(x10, Smi::FromInt(strict_mode));
-  __ Push(x10);
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}


 void StoreIC::GenerateSlow(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/ic/arm64/ic-compiler-arm64.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/arm64/ic-compiler-arm64.cc Fri Aug 22 12:48:15 2014 UTC
@@ -973,6 +973,22 @@
   __ Bind(&miss);
   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
 }
+
+
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+  ASM_LOCATION("PropertyICCompiler::GenerateRuntimeSetProperty");
+
+  __ Push(StoreIC::ReceiverRegister(), StoreIC::NameRegister(),
+          StoreIC::ValueRegister());
+
+  __ Mov(x10, Smi::FromInt(strict_mode));
+  __ Push(x10);
+
+  // Do tail-call to runtime routine.
+  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}
+

 #undef __
 }
=======================================
--- /branches/bleeding_edge/src/ic/ia32/ic-compiler-ia32.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/ia32/ic-compiler-ia32.cc Fri Aug 22 12:48:15 2014 UTC
@@ -977,6 +977,23 @@
   // -----------------------------------
   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
 }
+
+
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+  // Return address is on the stack.
+  DCHECK(!ebx.is(StoreIC::ReceiverRegister()) &&
+ !ebx.is(StoreIC::NameRegister()) && !ebx.is(StoreIC::ValueRegister()));
+  __ pop(ebx);
+  __ push(StoreIC::ReceiverRegister());
+  __ push(StoreIC::NameRegister());
+  __ push(StoreIC::ValueRegister());
+  __ push(Immediate(Smi::FromInt(strict_mode)));
+  __ push(ebx);  // return address
+
+  // Do tail-call to runtime routine.
+  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/ia32/ic-ia32.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/ia32/ic-ia32.cc Fri Aug 22 12:48:15 2014 UTC
@@ -8,6 +8,7 @@

 #include "src/codegen.h"
 #include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
 #include "src/ic/stub-cache.h"

 namespace v8 {
@@ -777,7 +778,7 @@

   // Slow case: call runtime.
   __ bind(&slow);
-  GenerateRuntimeSetProperty(masm, strict_mode);
+  PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);

   // Extra capacity case: Check if there is extra capacity to
   // perform the store and update the length. Used for adding one
@@ -1004,40 +1005,6 @@
   __ IncrementCounter(counters->store_normal_miss(), 1);
   GenerateMiss(masm);
 }
-
-
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                         StrictMode strict_mode) {
-  // Return address is on the stack.
-  DCHECK(!ebx.is(ReceiverRegister()) && !ebx.is(NameRegister()) &&
-         !ebx.is(ValueRegister()));
-  __ pop(ebx);
-  __ push(ReceiverRegister());
-  __ push(NameRegister());
-  __ push(ValueRegister());
-  __ push(Immediate(Smi::FromInt(strict_mode)));
-  __ push(ebx);  // return address
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                              StrictMode strict_mode) {
-  // Return address is on the stack.
-  DCHECK(!ebx.is(ReceiverRegister()) && !ebx.is(NameRegister()) &&
-         !ebx.is(ValueRegister()));
-  __ pop(ebx);
-  __ push(ReceiverRegister());
-  __ push(NameRegister());
-  __ push(ValueRegister());
-  __ push(Immediate(Smi::FromInt(strict_mode)));
-  __ push(ebx);  // return address
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}


 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/ic/ic-compiler.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/ic-compiler.cc Fri Aug 22 12:48:15 2014 UTC
@@ -387,7 +387,7 @@
 Handle<Code> PropertyICCompiler::CompileStoreGeneric(Code::Flags flags) {
   ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
   StrictMode strict_mode = StoreIC::GetStrictMode(extra_state);
-  StoreIC::GenerateRuntimeSetProperty(masm(), strict_mode);
+  GenerateRuntimeSetProperty(masm(), strict_mode);
   Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreGeneric");
   PROFILE(isolate(), CodeCreateEvent(Logger::STORE_GENERIC_TAG, *code, 0));
   return code;
=======================================
--- /branches/bleeding_edge/src/ic/ic-compiler.h Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/ic-compiler.h Fri Aug 22 12:48:15 2014 UTC
@@ -125,6 +125,12 @@
   static Handle<Code> ComputeCompareNil(Handle<Map> receiver_map,
                                         CompareNilICStub* stub);

+  // Helpers
+ // TODO(verwaest): Move all uses of these helpers to the PropertyICCompiler
+  // and make the helpers private.
+  static void GenerateRuntimeSetProperty(MacroAssembler* masm,
+                                         StrictMode strict_mode);
+

  private:
   PropertyICCompiler(Isolate* isolate, Code::Kind kind,
=======================================
--- /branches/bleeding_edge/src/ic/ic.h Fri Aug 22 11:43:39 2014 UTC
+++ /branches/bleeding_edge/src/ic/ic.h Fri Aug 22 12:48:15 2014 UTC
@@ -650,8 +650,6 @@
   }
   static void GenerateMiss(MacroAssembler* masm);
   static void GenerateSlow(MacroAssembler* masm);
-  static void GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                         StrictMode strict_mode);
static void GenerateGeneric(MacroAssembler* masm, StrictMode strict_mode);
   static void GenerateSloppyArguments(MacroAssembler* masm);

=======================================
--- /branches/bleeding_edge/src/ic/x64/ic-compiler-x64.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/x64/ic-compiler-x64.cc Fri Aug 22 12:48:15 2014 UTC
@@ -966,6 +966,24 @@
   // -----------------------------------
   TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
 }
+
+
+void PropertyICCompiler::GenerateRuntimeSetProperty(MacroAssembler* masm,
+ StrictMode strict_mode) {
+  // Return address is on the stack.
+  DCHECK(!rbx.is(StoreIC::ReceiverRegister()) &&
+ !rbx.is(StoreIC::NameRegister()) && !rbx.is(StoreIC::ValueRegister()));
+
+  __ PopReturnAddressTo(rbx);
+  __ Push(StoreIC::ReceiverRegister());
+  __ Push(StoreIC::NameRegister());
+  __ Push(StoreIC::ValueRegister());
+  __ Push(Smi::FromInt(strict_mode));
+  __ PushReturnAddressFrom(rbx);
+
+  // Do tail-call to runtime routine.
+  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
+}


 #undef __
=======================================
--- /branches/bleeding_edge/src/ic/x64/ic-x64.cc Fri Aug 22 11:43:39 2014 UTC +++ /branches/bleeding_edge/src/ic/x64/ic-x64.cc Fri Aug 22 12:48:15 2014 UTC
@@ -8,6 +8,7 @@

 #include "src/codegen.h"
 #include "src/ic/ic.h"
+#include "src/ic/ic-compiler.h"
 #include "src/ic/stub-cache.h"

 namespace v8 {
@@ -649,7 +650,7 @@
   __ bind(&slow);
   __ Integer32ToSmi(key, key);
   __ bind(&slow_with_tagged_index);
-  GenerateRuntimeSetProperty(masm, strict_mode);
+  PropertyICCompiler::GenerateRuntimeSetProperty(masm, strict_mode);
   // Never returns to here.

   // Extra capacity case: Check if there is extra capacity to
@@ -1009,42 +1010,6 @@
   __ IncrementCounter(counters->store_normal_miss(), 1);
   GenerateMiss(masm);
 }
-
-
-void StoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                         StrictMode strict_mode) {
-  // Return address is on the stack.
-  DCHECK(!rbx.is(ReceiverRegister()) && !rbx.is(NameRegister()) &&
-         !rbx.is(ValueRegister()));
-
-  __ PopReturnAddressTo(rbx);
-  __ Push(ReceiverRegister());
-  __ Push(NameRegister());
-  __ Push(ValueRegister());
-  __ Push(Smi::FromInt(strict_mode));
-  __ PushReturnAddressFrom(rbx);
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}
-
-
-void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm,
-                                              StrictMode strict_mode) {
-  // Return address is on the stack.
-  DCHECK(!rbx.is(ReceiverRegister()) && !rbx.is(NameRegister()) &&
-         !rbx.is(ValueRegister()));
-
-  __ PopReturnAddressTo(rbx);
-  __ Push(ReceiverRegister());
-  __ Push(NameRegister());
-  __ Push(ValueRegister());
-  __ Push(Smi::FromInt(strict_mode));  // Strict mode.
-  __ PushReturnAddressFrom(rbx);
-
-  // Do tail-call to runtime routine.
-  __ TailCallRuntime(Runtime::kSetProperty, 4, 1);
-}


 void StoreIC::GenerateSlow(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