X87: [Interpreter] Pass context to interpreter bytecode handlers and add LoadConstextSlot
authorchunyang.dai <chunyang.dai@intel.com>
Wed, 26 Aug 2015 01:17:11 +0000 (18:17 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 26 Aug 2015 01:17:19 +0000 (01:17 +0000)
   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=

Review URL: https://codereview.chromium.org/1316583003

Cr-Commit-Position: refs/heads/master@{#30368}

src/compiler/linkage.cc
src/x87/builtins-x87.cc
src/x87/macro-assembler-x87.h

index 1b342ee..93112be 100644 (file)
@@ -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 a4f6704..9a1965e 100644 (file)
@@ -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 9a2c903..24f7f1e 100644 (file)
@@ -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;