Reviewers: Weiliang,

Message:
PTAL

Description:
X87: HydrogenCodeStubs consume stack arguments via descriptor.

port 3334b830a512eda1f8eed678a0e6fda52b23472a (r20813).

original commit message:

    HydrogenCodeStubs consume stack arguments via descriptor.

    All of this is controlled by the CallDescriptor. It's simply the case
    that if you specify less registers than the function arity calls for,
    the rest are assumed to be on the stack.

    Bailout handlers accept these constant stack arguments too.

BUG=

Please review this at https://codereview.chromium.org/1258553002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+29, -4 lines):
  M src/ic/x87/handler-compiler-x87.cc
  M src/x87/code-stubs-x87.cc
  M src/x87/interface-descriptors-x87.cc


Index: src/ic/x87/handler-compiler-x87.cc
diff --git a/src/ic/x87/handler-compiler-x87.cc b/src/ic/x87/handler-compiler-x87.cc index 056bd952c7d105e4d52872964f5f24dde3c60452..8df6da395ab3fb24ddce98cb2672b64465c2b133 100644
--- a/src/ic/x87/handler-compiler-x87.cc
+++ b/src/ic/x87/handler-compiler-x87.cc
@@ -354,11 +354,20 @@ void NamedStoreHandlerCompiler::GenerateRestoreName(Handle<Name> name) {
 }


+void NamedStoreHandlerCompiler::GeneratePushMap(Register map_reg,
+                                                Register scratch) {
+  // Get the return address, push the argument and then continue.
+  __ pop(scratch);
+  __ push(map_reg);
+  __ push(scratch);
+}
+
+
 void NamedStoreHandlerCompiler::GenerateRestoreMap(Handle<Map> transition,
+                                                   Register map_reg,
                                                    Register scratch,
                                                    Label* miss) {
   Handle<WeakCell> cell = Map::WeakCellForMap(transition);
-  Register map_reg = StoreTransitionDescriptor::MapRegister();
   DCHECK(!map_reg.is(scratch));
   __ LoadWeakValue(map_reg, cell, miss);
   if (transition->CanBeDeprecated()) {
Index: src/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index 1ca2a918709056d85f9126bf72cecc9b3a0bd1cc..97425964ec2d0714159ff05b15a9f62b6f192a72 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -37,7 +37,7 @@ static void InitializeArrayConstructorDescriptor(
                            JS_FUNCTION_STUB_MODE);
   } else {
descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count,
-                           JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
+                           JS_FUNCTION_STUB_MODE);
   }
 }

@@ -56,7 +56,7 @@ static void InitializeInternalArrayConstructorDescriptor(
                            JS_FUNCTION_STUB_MODE);
   } else {
descriptor->Initialize(eax, deopt_handler, constant_stack_parameter_count,
-                           JS_FUNCTION_STUB_MODE, PASS_ARGUMENTS);
+                           JS_FUNCTION_STUB_MODE);
   }
 }

Index: src/x87/interface-descriptors-x87.cc
diff --git a/src/x87/interface-descriptors-x87.cc b/src/x87/interface-descriptors-x87.cc index 333564e09995afffc834146186bd7a14b4567cf8..a71c269f860065bc310cea4bd6442b51e02fa08e 100644
--- a/src/x87/interface-descriptors-x87.cc
+++ b/src/x87/interface-descriptors-x87.cc
@@ -32,7 +32,9 @@ const Register VectorStoreICTrampolineDescriptor::SlotRegister() { return edi; }
 const Register VectorStoreICDescriptor::VectorRegister() { return ebx; }


-const Register StoreTransitionDescriptor::MapRegister() { return ebx; }
+const Register StoreTransitionDescriptor::MapRegister() {
+  return FLAG_vector_stores ? no_reg : ebx;
+}


const Register LoadGlobalViaContextDescriptor::DepthRegister() { return edx; } @@ -69,6 +71,20 @@ const Register GrowArrayElementsDescriptor::ObjectRegister() { return eax; }
 const Register GrowArrayElementsDescriptor::KeyRegister() { return ebx; }


+void StoreTransitionDescriptor::InitializePlatformSpecific(
+    CallInterfaceDescriptorData* data) {
+ Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(),
+                          MapRegister()};
+
+ // When FLAG_vector_stores is true, we want to pass the map register on the
+  // stack instead of in a register.
+  DCHECK(FLAG_vector_stores || !MapRegister().is(no_reg));
+
+  int register_count = FLAG_vector_stores ? 3 : 4;
+  data->InitializePlatformSpecific(register_count, registers);
+}
+
+
 void FastNewClosureDescriptor::InitializePlatformSpecific(
     CallInterfaceDescriptorData* data) {
   Register registers[] = {ebx};


--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to