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

Unified Diff: src/interpreter/bytecode-array-builder.h

Issue 1607433005: [interpreter] Implement exception handler table building. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added moar tests. 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 | « BUILD.gn ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.h
diff --git a/src/interpreter/bytecode-array-builder.h b/src/interpreter/bytecode-array-builder.h
index 402a810d4aaa7aec1e31859cb7e63b3fa532151d..7cdb72fed21ea3d7df0839c851e0a014a89db126 100644
--- a/src/interpreter/bytecode-array-builder.h
+++ b/src/interpreter/bytecode-array-builder.h
@@ -8,6 +8,7 @@
#include "src/ast/ast.h"
#include "src/interpreter/bytecodes.h"
#include "src/interpreter/constant-array-builder.h"
+#include "src/interpreter/handler-table-builder.h"
#include "src/zone-containers.h"
namespace v8 {
@@ -225,6 +226,15 @@ class BytecodeArrayBuilder final {
Register cache_type_array_pair);
BytecodeArrayBuilder& ForInStep(Register index);
+ // Exception handling.
+ BytecodeArrayBuilder& MarkHandler(int handler_id, bool will_catch);
+ BytecodeArrayBuilder& MarkTryBegin(int handler_id, Register context);
+ BytecodeArrayBuilder& MarkTryEnd(int handler_id);
+
+ // Creates a new handler table entry and returns a {hander_id} identifying the
+ // entry, so that it can be referenced by above exception handling support.
+ int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); }
+
// Accessors
Zone* zone() const { return zone_; }
@@ -315,12 +325,16 @@ class BytecodeArrayBuilder final {
const ConstantArrayBuilder* constant_array_builder() const {
return &constant_array_builder_;
}
+ HandlerTableBuilder* handler_table_builder() {
+ return &handler_table_builder_;
+ }
Isolate* isolate_;
Zone* zone_;
ZoneVector<uint8_t> bytecodes_;
bool bytecode_generated_;
ConstantArrayBuilder constant_array_builder_;
+ HandlerTableBuilder handler_table_builder_;
size_t last_block_end_;
size_t last_bytecode_start_;
bool exit_seen_in_block_;
« no previous file with comments | « BUILD.gn ('k') | src/interpreter/bytecode-array-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698