Reviewers: Michael Starzinger, Weiliang, rmcilroy,

Message:
PTAL.

Description:
X87: [Interpreter] Pass context to interpreter bytecode handlers and add
LoadConstextSlot

For X87 platform, it has the same general register as ia32 and it will spill
the
   context to the stack too.

port bfdc22d7fc1bc046a38770a676619eee613222f3 (r29325).

original commit message:

Passes the current context to bytecode interpreter handlers. This is held in
the
context register on all architectures except for ia32 where there are too
few
    registers and it is instead spilled to the stack.

Also changes Load/StoreRegister to use kMachAnyTagged representation since
they
    should only ever hold tagged values.

BUG=

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

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

Affected files (+7, -3 lines):
  M src/compiler/linkage.cc
  M src/x87/builtins-x87.cc
  M src/x87/macro-assembler-x87.h


Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 1b342ee472a6aff7a5aaf44eea8be3b1a4f8001f..93112be1af9a995e48ee434292967d977f7ce24c 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -413,7 +413,7 @@ CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) {

   STATIC_ASSERT(5 == Linkage::kInterpreterContextParameter);
   types.AddParam(kMachAnyTagged);
-#if defined(V8_TARGET_ARCH_IA32)
+#if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X87)
   locations.AddParam(
       LinkageLocation::ForCallerFrameSlot(kInterpreterContextSpillSlot));
 #else
Index: src/x87/builtins-x87.cc
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc
index a4f6704d929e0fbaac8470bad2ff6d64ff57eed8..9a1965e76b08050745a00a88bc881a3f70856a0e 100644
--- a/src/x87/builtins-x87.cc
+++ b/src/x87/builtins-x87.cc
@@ -725,8 +725,9 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
   __ add(kInterpreterDispatchTableRegister,
          Immediate(FixedArray::kHeaderSize - kHeapObjectTag));

-  // TODO(rmcilroy) Push our context as a stack located parameter of the
-  // bytecode handler.
+  // Push context as a stack located parameter to the bytecode handler.
+  DCHECK_EQ(-1, kInterpreterContextSpillSlot);
+  __ push(esi);

   // Dispatch to the first bytecode handler for the function.
   __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister,
Index: src/x87/macro-assembler-x87.h
diff --git a/src/x87/macro-assembler-x87.h b/src/x87/macro-assembler-x87.h
index 9a2c903ab0fd0959de917f2cb206b37cd1277f7e..24f7f1e8c23fb2063e6b378124d0c8d5619ebfb8 100644
--- a/src/x87/macro-assembler-x87.h
+++ b/src/x87/macro-assembler-x87.h
@@ -26,6 +26,9 @@ const Register kInterpreterDispatchTableRegister = {kRegister_ebx_Code};
 const Register kRuntimeCallFunctionRegister = {kRegister_ebx_Code};
 const Register kRuntimeCallArgCountRegister = {kRegister_eax_Code};

+// Spill slots used by interpreter dispatch calling convention.
+const int kInterpreterContextSpillSlot = -1;
+
 // Convenience for platform-independent signatures.  We do not normally
 // distinguish memory operands from other operands on ia32.
 typedef Operand MemOperand;


--
--
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