Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Unified Diff: src/x64/builtins-x64.cc

Issue 1605633003: [interpreter] First implementation of stack unwinding. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_int-5
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
« src/frames.cc ('K') | « src/isolate.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698