15#if V8_ENABLE_WEBASSEMBLY
23 :
HandlerTable(code->handler_table_address(), code->handler_table_size(),
24 kReturnAddressBasedEncoding) {}
26#if V8_ENABLE_WEBASSEMBLY
28 :
HandlerTable(code->handler_table(), code->handler_table_size(),
29 kReturnAddressBasedEncoding) {}
37 byte_array->length(), kRangeBasedEncoding) {}
41 : number_of_entries_(handler_table_size / EntrySizeFromMode(encoding_mode) /
46 raw_encoded_data_(handler_table) {
190 int innermost_start = std::numeric_limits<int>::min();
191 int innermost_end = std::numeric_limits<int>::max();
198 DCHECK_GE(start_offset, innermost_start);
200 innermost_handler =
i;
202 innermost_start = start_offset;
203 innermost_end = end_offset;
206 return innermost_handler;
212 struct Iterator :
base::iterator<std::random_access_iterator_tag, int> {
214 value_type operator*()
const {
return table->GetReturnOffset(index); }
215 bool operator!=(
const Iterator& other)
const {
return !(*
this == other); }
216 bool operator==(
const Iterator& other)
const {
217 return index == other.index;
220 bool operator<=(
const Iterator& other) {
return index <= other.index; }
225 Iterator& operator--() {
229 Iterator& operator+=(difference_type
offset) {
233 difference_type operator-(
const Iterator& other)
const {
234 return index - other.index;
248#ifdef ENABLE_DISASSEMBLER
250void HandlerTable::HandlerTableRangePrint(std::ostream& os) {
251 os <<
" from to hdlr (prediction, data)\n";
258 os <<
" (" << std::setw(4) << pc_start <<
"," << std::setw(4) << pc_end
259 <<
") -> " << std::setw(4) << handler_offset
260 <<
" (prediction=" << prediction <<
", data=" << handler_data <<
")\n";
264void HandlerTable::HandlerTableReturnPrint(std::ostream& os) {
265 os <<
" offset handler\n";
269 os << std::hex <<
" " << std::setw(4) <<
pc_offset <<
" -> "
270 << std::setw(4) << handler_offset << std::dec <<
"\n";
#define SLOW_DCHECK(condition)
static constexpr T decode(U value)
static constexpr U encode(T value)
static V8_NODISCARD constexpr U update(U previous, T value)
V8_INLINE void RecordComment(const char *comment, const SourceLocation &loc=SourceLocation::Current())
static const int kRangeDataIndex
int GetRangeStart(int index) const
HandlerTable(Tagged< InstructionStream > code)
int LookupHandlerIndexForRange(int pc_offset) const
int GetRangeData(int index) const
CatchPrediction GetRangePrediction(int index) const
int GetReturnOffset(int index) const
int NumberOfReturnEntries() const
static const int kRangeStartIndex
static int LengthForRange(int entries)
static const int kReturnOffsetIndex
void MarkHandlerUsed(int index)
static void EmitReturnEntry(Assembler *masm, int offset, int handler)
const int number_of_entries_
int GetRangeHandler(int index) const
static int EntrySizeFromMode(EncodingMode mode)
static const int kReturnHandlerIndex
void SetRangeHandler(int index, int offset, CatchPrediction pred)
bool HandlerWasUsed(int index) const
@ kReturnAddressBasedEncoding
static const int kReturnEntrySize
const Address raw_encoded_data_
int GetRangeHandlerBitfield(int index) const
void SetRangeData(int index, int value)
void SetRangeEnd(int index, int value)
static const int kRangeHandlerIndex
static const int kRangeEndIndex
int NumberOfRangeEntries() const
int GetRangeEnd(int index) const
int GetReturnHandler(int index) const
static const int kNoHandlerFound
static const int kRangeEntrySize
static int EmitReturnTableStart(Assembler *masm)
void SetRangeStart(int index, int value)
int LookupReturn(int pc_offset)
static constexpr int kMetadataAlignment
RecordWriteMode const mode_
ZoneVector< RpoNumber > & result
ZoneVector< Entry > entries
void Relaxed_Store(volatile Atomic8 *ptr, Atomic8 value)
Atomic8 Relaxed_Load(volatile const Atomic8 *ptr)
bool operator!=(ExternalReference lhs, ExternalReference rhs)
V8_INLINE Builtin operator++(Builtin &builtin)
#define DCHECK_GE(v1, v2)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)