5#ifndef V8_CODEGEN_HANDLER_TABLE_H_
6#define V8_CODEGEN_HANDLER_TABLE_H_
18class InstructionStream;
55 enum EncodingMode { kRangeBasedEncoding, kReturnAddressBasedEncoding };
61#if V8_ENABLE_WEBASSEMBLY
65 HandlerTable(Address handler_table,
int handler_table_size,
69 int GetRangeStart(
int index)
const;
70 int GetRangeEnd(
int index)
const;
71 int GetRangeHandler(
int index)
const;
72 int GetRangeData(
int index)
const;
75 void SetRangeStart(
int index,
int value);
76 void SetRangeEnd(
int index,
int value);
78 void SetRangeData(
int index,
int value);
81 static int LengthForRange(
int entries);
84 static int EmitReturnTableStart(
Assembler* masm);
90 int LookupHandlerIndexForRange(
int pc_offset)
const;
96 int NumberOfRangeEntries()
const;
97 int NumberOfReturnEntries()
const;
99#ifdef ENABLE_DISASSEMBLER
100 void HandlerTableRangePrint(std::ostream& os);
101 void HandlerTableReturnPrint(std::ostream& os);
104 bool HandlerWasUsed(
int index)
const;
105 void MarkHandlerUsed(
int index);
109 static const int kNoHandlerFound = -1;
114 int GetRangeHandlerBitfield(
int index)
const;
117 int GetReturnOffset(
int index)
const;
118 int GetReturnHandler(
int index)
const;
137 static const
int kRangeStartIndex = 0;
138 static const
int kRangeEndIndex = 1;
139 static const
int kRangeHandlerIndex = 2;
140 static const
int kRangeDataIndex = 3;
141 static const
int kRangeEntrySize = 4;
144 static const
int kReturnOffsetIndex = 0;
145 static const
int kReturnHandlerIndex = 1;
146 static const
int kReturnEntrySize = 2;
#define DISALLOW_GARBAGE_COLLECTION(name)
HandlerTable(Tagged< InstructionStream > code)
const int number_of_entries_
const Address raw_encoded_data_
RecordWriteMode const mode_
DisallowGarbageCollection no_gc_
ZoneVector< Entry > entries
#define V8_EXPORT_PRIVATE