// Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_CODEGEN_HANDLER_TABLE_H_ #define V8_CODEGEN_HANDLER_TABLE_H_ #include "src/base/bit-field.h" #include "src/common/assert-scope.h" #include "src/common/globals.h" namespace v8 { namespace internal { class Assembler; class TrustedByteArray; class BytecodeArray; class InstructionStream; class Code; namespace wasm { class WasmCode; } // namespace wasm // HandlerTable is a byte array containing entries for exception handlers in // the code object it is associated with. The tables come in two flavors: // 1) Based on ranges: Used for unoptimized code. Stored in a // {TrustedByteArray} that is attached to each {BytecodeArray}. Contains one // entry per exception handler and a range representing the try-block covered // by that handler. Layout looks as follows: // [ range-start , range-end , handler-offset , handler-data ] // 2) Based on return addresses: Used for turbofanned code. Stored directly in // the instruction stream of the {InstructionStream} object. Contains one // entry per call-site that could throw an exception. Layout looks as // follows: // [ return-address-offset , handler-offset ] class V8_EXPORT_PRIVATE HandlerTable { … }; } // namespace internal } // namespace v8 #endif // V8_CODEGEN_HANDLER_TABLE_H_