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

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: Rebase and skip one more test. 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
« no previous file with comments | « src/frames.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index d60ab29c4e62c2e60cc52a7b1cf54378076ed8e3..dfaf3ca5e4d6e838caf31913e62d46ec88375f10 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1128,6 +1128,33 @@ 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 {
+ const int index = InterpreterFrameConstants::kBytecodeOffsetExpressionIndex;
+ DCHECK_EQ(InterpreterFrameConstants::kBytecodeOffsetFromFp,
+ StandardFrameConstants::kExpressionsOffset - index * kPointerSize);
+ int raw_offset = Smi::cast(GetExpression(index))->value();
+ return raw_offset - BytecodeArray::kHeaderSize + kHeapObjectTag;
+}
+
+
+void InterpretedFrame::PatchBytecodeOffset(int new_offset) {
+ const int index = InterpreterFrameConstants::kBytecodeOffsetExpressionIndex;
+ DCHECK_EQ(InterpreterFrameConstants::kBytecodeOffsetFromFp,
+ StandardFrameConstants::kExpressionsOffset - index * kPointerSize);
+ int raw_offset = new_offset + BytecodeArray::kHeaderSize - kHeapObjectTag;
+ SetExpression(index, Smi::FromInt(raw_offset));
+}
+
+
int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const {
return Smi::cast(GetExpression(0))->value();
}
« no previous file with comments | « src/frames.h ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698