Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index 33a11e3902494ba69decf931524367fbd6534d04..238412b3c360840352ac349882890c9df4da24f7 100644 |
--- a/src/x64/builtins-x64.cc |
+++ b/src/x64/builtins-x64.cc |
@@ -898,6 +898,57 @@ void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { |
} |
+void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) { |
Michael Starzinger
2016/01/19 18:21:51
Note that this is an unmodified copy of the code f
oth
2016/01/20 07:49:08
For now I'd settle for a comment at the start of t
rmcilroy
2016/01/20 08:52:13
If it's unmodified let's just factor this out in t
Michael Starzinger
2016/01/20 11:45:27
Done. Since it's unmodified, I went with a minimal
|
+ // Initialize register file register and dispatch table register. |
+ __ movp(kInterpreterRegisterFileRegister, rbp); |
+ __ addp(kInterpreterRegisterFileRegister, |
+ Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
+ __ LoadRoot(kInterpreterDispatchTableRegister, |
+ Heap::kInterpreterTableRootIndex); |
+ __ addp(kInterpreterDispatchTableRegister, |
+ Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); |
+ |
+ // Get the context from the frame. |
+ // TODO(rmcilroy): Update interpreter frame to expect current context at the |
+ // context slot instead of the function context. |
+ __ movp(kContextRegister, |
+ Operand(kInterpreterRegisterFileRegister, |
+ InterpreterFrameConstants::kContextFromRegisterPointer)); |
+ |
+ // Get the bytecode array pointer from the frame. |
+ __ movp(rbx, |
+ Operand(kInterpreterRegisterFileRegister, |
+ InterpreterFrameConstants::kFunctionFromRegisterPointer)); |
+ __ movp(rbx, FieldOperand(rbx, JSFunction::kSharedFunctionInfoOffset)); |
+ __ movp(kInterpreterBytecodeArrayRegister, |
+ FieldOperand(rbx, SharedFunctionInfo::kFunctionDataOffset)); |
+ |
+ if (FLAG_debug_code) { |
+ // Check function data field is actually a BytecodeArray object. |
+ __ AssertNotSmi(kInterpreterBytecodeArrayRegister); |
+ __ CmpObjectType(kInterpreterBytecodeArrayRegister, BYTECODE_ARRAY_TYPE, |
+ rbx); |
+ __ Assert(equal, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
+ } |
+ |
+ // Get the target bytecode offset from the frame. |
+ __ movp( |
+ kInterpreterBytecodeOffsetRegister, |
+ Operand(kInterpreterRegisterFileRegister, |
+ InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); |
+ __ SmiToInteger32(kInterpreterBytecodeOffsetRegister, |
+ kInterpreterBytecodeOffsetRegister); |
+ |
+ // Dispatch to the target bytecode. |
+ __ movzxbp(rbx, Operand(kInterpreterBytecodeArrayRegister, |
+ kInterpreterBytecodeOffsetRegister, times_1, 0)); |
+ __ movp(rbx, Operand(kInterpreterDispatchTableRegister, rbx, |
+ times_pointer_size, 0)); |
+ __ addp(rbx, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
+ __ jmp(rbx); |
+} |
+ |
+ |
void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
GenerateTailCallToReturnedCode(masm); |