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

Unified Diff: src/frames.h

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
« no previous file with comments | « src/builtins.h ('k') | src/frames.cc » ('j') | src/frames.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.h
diff --git a/src/frames.h b/src/frames.h
index 674d7daeca2bc27c29081eaff2e8dcff464df4fd..cb3094eb8fd24677a7e85722247dcb6bf31201e2 100644
--- a/src/frames.h
+++ b/src/frames.h
@@ -183,6 +183,8 @@ class InterpreterFrameConstants : public AllStatic {
StandardFrameConstants::kFixedFrameSizeFromFp + 2 * kPointerSize;
// FP-relative.
+ static const int kBytecodeOffsetFromFp =
+ -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize;
static const int kRegisterFilePointerFromFp =
-StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize;
@@ -249,6 +251,7 @@ class StackFrame BASE_EMBEDDED {
bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; }
bool is_exit() const { return type() == EXIT; }
bool is_optimized() const { return type() == OPTIMIZED; }
+ bool is_interpreted() const { return type() == INTERPRETED; }
bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; }
bool is_internal() const { return type() == INTERNAL; }
bool is_stub_failure_trampoline() const {
@@ -711,8 +714,21 @@ class OptimizedFrame : public JavaScriptFrame {
class InterpretedFrame : public JavaScriptFrame {
+ public:
Type type() const override { return INTERPRETED; }
+ // Lookup exception handler for current {pc}, returns -1 if none found. Also
+ // returns the expected number of stack slots at the handler site.
+ int LookupExceptionHandlerInTable(
+ int* stack_slots, HandlerTable::CatchPrediction* prediction) override;
+
+ // Returns the current offset into the bytecode stream.
+ int GetBytecodeOffset() const;
+
+ // Updates the current offset into the bytecode stream, mainly used for stack
+ // unwinding to continue execution at a different bytecode offset.
+ void PatchBytecodeOffset(int new_offset);
+
protected:
inline explicit InterpretedFrame(StackFrameIteratorBase* iterator);
« no previous file with comments | « src/builtins.h ('k') | src/frames.cc » ('j') | src/frames.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698