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

Unified Diff: src/frames.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/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index d60ab29c4e62c2e60cc52a7b1cf54378076ed8e3..3cf1dd82464010aafc47aeabf258e89d0e2212f8 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1128,6 +1128,31 @@ Object* OptimizedFrame::StackSlotAt(int index) const {
}
+int InterpretedFrame::LookupExceptionHandlerInTable(
+ int* stack_slots, HandlerTable::CatchPrediction* prediction) {
+ BytecodeArray* bytecode = function()->shared()->bytecode_array();
+ HandlerTable* table = HandlerTable::cast(bytecode->handler_table());
+ int pc_offset = GetBytecodeOffset() + 1; // Point after current bytecode.
+ return table->LookupRange(pc_offset, stack_slots, prediction);
+}
+
+
+int InterpretedFrame::GetBytecodeOffset() const {
+ STATIC_ASSERT(InterpreterFrameConstants::kBytecodeOffsetFromFp ==
+ StandardFrameConstants::kExpressionsOffset - kPointerSize);
+ int raw_offset = Smi::cast(GetExpression(1))->value();
rmcilroy 2016/01/20 08:52:13 Nit - could you pull the '1' out to a constant som
Michael Starzinger 2016/01/20 11:45:27 Done. Added the constant to the InterpreterFrameCo
+ return raw_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
+}
+
+
+void InterpretedFrame::PatchBytecodeOffset(int new_offset) {
+ STATIC_ASSERT(InterpreterFrameConstants::kBytecodeOffsetFromFp ==
+ StandardFrameConstants::kExpressionsOffset - kPointerSize);
+ int raw_offset = new_offset + BytecodeArray::kHeaderSize - kHeapObjectTag;
+ SetExpression(1, Smi::FromInt(raw_offset));
+}
+
+
int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const {
return Smi::cast(GetExpression(0))->value();
}
« no previous file with comments | « src/frames.h ('k') | src/interpreter/bytecode-generator.h » ('j') | src/x64/builtins-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698