From: chunyang.dai Date: Wed, 26 Aug 2015 01:17:11 +0000 (-0700) Subject: X87: [Interpreter] Pass context to interpreter bytecode handlers and add LoadConstextSlot X-Git-Tag: upstream/4.7.83~672 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5911513ccb137307f14844ac202fcc905a3087e;p=platform%2Fupstream%2Fv8.git 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= Review URL: https://codereview.chromium.org/1316583003 Cr-Commit-Position: refs/heads/master@{#30368} --- diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc index 1b342ee..93112be 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 diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc index a4f6704..9a1965e 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, diff --git a/src/x87/macro-assembler-x87.h b/src/x87/macro-assembler-x87.h index 9a2c903..24f7f1e 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;