27 !it.
done() && it.code_offset() <=
offset; it.Advance()) {
28 position = it.source_position().ScriptOffset();
37 !it.
done() && it.code_offset() <=
offset; it.Advance()) {
38 if (it.is_statement()) {
39 position = it.source_position().ScriptOffset();
52 bool first_data =
true;
56 while (!iterator.
done()) {
57 if (!first_data) os <<
", ";
61 os <<
"{\"offset\":" << iterator.
current_offset() <<
", \"disassembly\":\"";
63 os,
reinterpret_cast<uint8_t*
>(current_address),
false);
71 bool first_entry =
true;
74 if (!first_entry) os <<
", ";
76 os << entry.target_offset;
88 if (constant_pool_length > 0) {
89 os <<
", \"constantPool\": [";
90 for (
int i = 0;
i < constant_pool_length;
i++) {
92 if (
i > 0) os <<
", ";
93 os <<
"\"" <<
object <<
"\"";
115 os <<
"Parameter count " <<
handle->parameter_count() <<
"\n";
116 os <<
"Register count " <<
handle->register_count() <<
"\n";
117 os <<
"Frame size " <<
handle->frame_size() <<
"\n";
123 while (!iterator.
done()) {
133 os << reinterpret_cast<const void*>(current_address) <<
" @ "
136 os,
reinterpret_cast<uint8_t*
>(current_address));
139 os <<
" (" <<
reinterpret_cast<void*
>(jump_target) <<
" @ "
144 bool first_entry =
true;
152 os <<
" " << entry.case_value <<
": @" << entry.target_offset;
160 os <<
"Constant pool (size = " <<
handle->constant_pool()->length() <<
")\n";
162 if (
handle->constant_pool()->length() > 0) {
167 os <<
"Handler Table (size = " <<
handle->handler_table()->length() <<
")\n";
168#ifdef ENABLE_DISASSEMBLER
169 if (
handle->handler_table()->length() > 0) {
171 table.HandlerTableRangePrint(os);
176 handle->SourcePositionTable();
177 os <<
"Source Position Table (size = " << source_position_table->length()
180 if (source_position_table->length() > 0) {
181 os <<
Brief(source_position_table) << std::endl;
189 CopyBytes(
reinterpret_cast<uint8_t*
>(to->GetFirstBytecodeAddress()),
190 reinterpret_cast<uint8_t*
>(from->GetFirstBytecodeAddress()),
bool HasSourcePositionTable() const
int SourceStatementPosition(int offset) const
int SourcePosition(int offset) const
void CopyBytecodesTo(Tagged< BytecodeArray > to)
Address GetFirstBytecodeAddress()
V8_EXPORT_PRIVATE void Disassemble(std::ostream &os)
V8_EXPORT_PRIVATE void PrintJson(std::ostream &os)
Bytecode current_bytecode() const
int GetJumpTargetOffset() const
int current_offset() const
JumpTableTargetOffsets GetJumpTableTargetOffsets() const
static std::ostream & Decode(std::ostream &os, const uint8_t *bytecode_start, bool with_hex=true)
static constexpr bool IsSwitch(Bytecode bytecode)
static constexpr bool IsJump(Bytecode bytecode)
SourcePositionTable * source_positions
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
void CopyBytes(T *dst, const T *src, size_t num_bytes)
static constexpr AcquireLoadTag kAcquireLoad
#define DCHECK_EQ(v1, v2)