Index: src/interpreter/bytecode-generator.h |
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h |
index db21c6b773ddcff39115960e7bfaf273004163cd..9fd4da63da00502cfe2901fa60618593db51d342 100644 |
--- a/src/interpreter/bytecode-generator.h |
+++ b/src/interpreter/bytecode-generator.h |
@@ -124,6 +124,10 @@ class BytecodeGenerator final : public AstVisitor { |
void RecordStoreToRegister(Register reg); |
Register LoadFromAliasedRegister(Register reg); |
+ // Methods for tracking try-block nesting. |
+ bool IsInsideTryCatch() const { return try_catch_nesting_level_ > 0; } |
+ bool IsInsideTryFinally() const { return try_finally_nesting_level_ > 0; } |
+ |
inline void set_builder(BytecodeArrayBuilder* builder) { builder_ = builder; } |
inline BytecodeArrayBuilder* builder() const { return builder_; } |
@@ -170,6 +174,8 @@ class BytecodeGenerator final : public AstVisitor { |
ContextScope* execution_context_; |
ExpressionResultScope* execution_result_; |
RegisterAllocationScope* register_allocator_; |
+ int try_catch_nesting_level_; |
+ int try_finally_nesting_level_; |
}; |
} // namespace interpreter |