Commit cdb2ef01 authored by Georgia Kouveli's avatar Georgia Kouveli Committed by Commit Bot

[arm64] Remove deopt tables.

We can instead pass the deopt id in a register, where before we were passing the
deopt entry address. This removes the need for the deopt tables altogether,
saving 192kB.

Change-Id: I479d4de1a0245de328720b6b03a1955c8c63f696
Reviewed-on: https://chromium-review.googlesource.com/1076472Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Cr-Commit-Position: refs/heads/master@{#53863}
parent 8c4a30ac
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/base/cpu.h" #include "src/base/cpu.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/deoptimizer.h"
#include "src/macro-assembler.h" #include "src/macro-assembler.h"
#include "src/objects-inl.h" #include "src/objects-inl.h"
...@@ -338,6 +339,11 @@ bool RelocInfo::IsInConstantPool() { ...@@ -338,6 +339,11 @@ bool RelocInfo::IsInConstantPool() {
return Assembler::is_constant_pool_load(pc_); return Assembler::is_constant_pool_load(pc_);
} }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
return Deoptimizer::GetDeoptimizationId(isolate, target_address(), kind);
}
void RelocInfo::set_js_to_wasm_address(Address address, void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) { ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL); DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
...@@ -358,7 +358,9 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -358,7 +358,9 @@ class TurboAssembler : public TurboAssemblerBase {
// This should only be used when assembling a deoptimizer call because of // This should only be used when assembling a deoptimizer call because of
// the CheckConstPool invocation, which is only needed for deoptimization. // the CheckConstPool invocation, which is only needed for deoptimization.
void CallForDeoptimization(Address target, RelocInfo::Mode rmode) { void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) {
USE(deopt_id);
Call(target, rmode); Call(target, rmode);
CheckConstPool(false, false); CheckConstPool(false, false);
} }
......
...@@ -180,6 +180,17 @@ bool RelocInfo::IsInConstantPool() { ...@@ -180,6 +180,17 @@ bool RelocInfo::IsInConstantPool() {
return instr->IsLdrLiteralX(); return instr->IsLdrLiteralX();
} }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
Instruction* movz_instr = reinterpret_cast<Instruction*>(pc_)->preceding();
DCHECK(movz_instr->IsMovz());
uint64_t imm = static_cast<uint64_t>(movz_instr->ImmMoveWide())
<< (16 * movz_instr->ShiftMoveWide());
DCHECK_LE(imm, INT_MAX);
return static_cast<int>(imm);
}
void RelocInfo::set_js_to_wasm_address(Address address, void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) { ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL); DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
...@@ -275,50 +275,18 @@ void Deoptimizer::TableEntryGenerator::Generate() { ...@@ -275,50 +275,18 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ Br(continuation); __ Br(continuation);
} }
// Size of an entry of the second level deopt table. // Size of an entry of the second level deopt table. Since we do not generate
// This is the code size generated by GeneratePrologue for one entry. // a table for ARM64, the size is zero.
const int Deoptimizer::table_entry_size_ = kInstructionSize; const int Deoptimizer::table_entry_size_ = 0 * kInstructionSize;
void Deoptimizer::TableEntryGenerator::GeneratePrologue() { void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
UseScratchRegisterScope temps(masm()); UseScratchRegisterScope temps(masm());
// The address at which the deopt table is entered should be in x16, the first // The MacroAssembler will have put the deoptimization id in x16, the first
// temp register allocated. We can't assert that the address is in there, but // temp register allocated. We can't assert that the id is in there, but we
// we can check that it's the first allocated temp. Later, we'll also check // can check that x16 the first allocated temp and that the value it contains
// the computed entry_id is in the expected range. // is in the expected range.
Register entry_addr = temps.AcquireX();
Register entry_id = temps.AcquireX(); Register entry_id = temps.AcquireX();
DCHECK(entry_addr.Is(x16)); DCHECK(entry_id.Is(x16));
DCHECK(entry_id.Is(x17));
// Create a sequence of deoptimization entries.
// Note that registers are still live when jumping to an entry.
{
InstructionAccurateScope scope(masm());
Label start_of_table, end_of_table;
__ bind(&start_of_table);
for (int i = 0; i < count(); i++) {
int start = masm()->pc_offset();
USE(start);
__ b(&end_of_table);
DCHECK(masm()->pc_offset() - start == table_entry_size_);
}
__ bind(&end_of_table);
// Get the address of the start of the table.
DCHECK(is_int21(table_entry_size_ * count()));
__ adr(entry_id, &start_of_table);
// Compute the gap in bytes between the entry address, which should have
// been left in entry_addr (x16) by CallForDeoptimization, and the start of
// the table.
__ sub(entry_id, entry_addr, entry_id);
// Shift down to obtain the entry_id.
DCHECK_EQ(table_entry_size_, kInstructionSize);
__ lsr(entry_id, entry_id, kInstructionSizeLog2);
}
__ Push(padreg, entry_id); __ Push(padreg, entry_id);
if (__ emit_debug_code()) { if (__ emit_debug_code()) {
......
...@@ -2091,7 +2091,7 @@ bool TurboAssembler::IsNearCallOffset(int64_t offset) { ...@@ -2091,7 +2091,7 @@ bool TurboAssembler::IsNearCallOffset(int64_t offset) {
return is_int26(offset); return is_int26(offset);
} }
void TurboAssembler::CallForDeoptimization(Address target, void TurboAssembler::CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) { RelocInfo::Mode rmode) {
DCHECK_EQ(rmode, RelocInfo::RUNTIME_ENTRY); DCHECK_EQ(rmode, RelocInfo::RUNTIME_ENTRY);
...@@ -2100,22 +2100,20 @@ void TurboAssembler::CallForDeoptimization(Address target, ...@@ -2100,22 +2100,20 @@ void TurboAssembler::CallForDeoptimization(Address target,
Label start_call; Label start_call;
Bind(&start_call); Bind(&start_call);
#endif #endif
// The deoptimizer requires the deoptimization id to be in x16.
UseScratchRegisterScope temps(this); UseScratchRegisterScope temps(this);
Register temp = temps.AcquireX(); Register temp = temps.AcquireX();
// Deoptimisation table entries require the call address to be in x16, in
// order to compute the entry id.
// TODO(all): Put the entry id back in the table now that we are using
// a direct branch for the call and do not need to set up x16.
DCHECK(temp.Is(x16)); DCHECK(temp.Is(x16));
Mov(temp, Immediate(target, rmode)); // Make sure that the deopt id can be encoded in 16 bits, so can be encoded
// in a single movz instruction with a zero shift.
DCHECK(is_uint16(deopt_id));
movz(temp, deopt_id);
int64_t offset = static_cast<int64_t>(target) - int64_t offset = static_cast<int64_t>(target) -
static_cast<int64_t>(isolate_data().code_range_start); static_cast<int64_t>(isolate_data().code_range_start);
DCHECK_EQ(offset % kInstructionSize, 0); DCHECK_EQ(offset % kInstructionSize, 0);
offset = offset / static_cast<int>(kInstructionSize); offset = offset / static_cast<int>(kInstructionSize);
DCHECK(IsNearCallOffset(offset)); DCHECK(IsNearCallOffset(offset));
near_call(static_cast<int>(offset), rmode); near_call(static_cast<int>(offset), RelocInfo::RUNTIME_ENTRY);
#ifdef DEBUG #ifdef DEBUG
AssertSizeOfCodeGeneratedSince(&start_call, kNearCallSize + kInstructionSize); AssertSizeOfCodeGeneratedSince(&start_call, kNearCallSize + kInstructionSize);
......
...@@ -902,7 +902,8 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -902,7 +902,8 @@ class TurboAssembler : public TurboAssemblerBase {
// Generate an indirect call (for when a direct call's range is not adequate). // Generate an indirect call (for when a direct call's range is not adequate).
void IndirectCall(Address target, RelocInfo::Mode rmode); void IndirectCall(Address target, RelocInfo::Mode rmode);
void CallForDeoptimization(Address target, RelocInfo::Mode rmode); void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode);
// For every Call variant, there is a matching CallSize function that returns // For every Call variant, there is a matching CallSize function that returns
// the size (in bytes) of the call sequence. // the size (in bytes) of the call sequence.
......
...@@ -595,11 +595,12 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT ...@@ -595,11 +595,12 @@ void RelocInfo::Print(Isolate* isolate, std::ostream& os) { // NOLINT
os << ") "; os << ") ";
os << " (" << reinterpret_cast<const void*>(target_address()) << ")"; os << " (" << reinterpret_cast<const void*>(target_address()) << ")";
} else if (IsRuntimeEntry(rmode_) && isolate->deoptimizer_data() != nullptr) { } else if (IsRuntimeEntry(rmode_) && isolate->deoptimizer_data() != nullptr) {
// Depotimization bailouts are stored as runtime entries. // Deoptimization bailouts are stored as runtime entries.
int id = Deoptimizer::GetDeoptimizationId(isolate, target_address(), DeoptimizeKind type;
DeoptimizeKind::kEager); if (Deoptimizer::IsDeoptimizationEntry(isolate, target_address(), &type)) {
if (id != Deoptimizer::kNotDeoptimizationEntry) { int id = GetDeoptimizationId(isolate, type);
os << " (deoptimization bailout " << id << ")"; os << " (" << Deoptimizer::MessageFor(type) << " deoptimization bailout "
<< id << ")";
} }
} else if (IsConstPool(rmode_)) { } else if (IsConstPool(rmode_)) {
os << " (size " << static_cast<int>(data_) << ")"; os << " (size " << static_cast<int>(data_) << ")";
......
...@@ -571,6 +571,11 @@ class RelocInfo { ...@@ -571,6 +571,11 @@ class RelocInfo {
// constant pool, otherwise the pointer is embedded in the instruction stream. // constant pool, otherwise the pointer is embedded in the instruction stream.
bool IsInConstantPool(); bool IsInConstantPool();
// Returns the deoptimization id for the entry associated with the reloc info
// where {kind} is the deoptimization kind.
// This is only used for printing RUNTIME_ENTRY relocation info.
int GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind);
Address wasm_call_address() const; Address wasm_call_address() const;
Address wasm_stub_call_address() const; Address wasm_stub_call_address() const;
Address js_to_wasm_address() const; Address js_to_wasm_address() const;
......
...@@ -126,7 +126,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall( ...@@ -126,7 +126,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleDeoptimizerCall(
if (info()->is_source_positions_enabled()) { if (info()->is_source_positions_enabled()) {
tasm()->RecordDeoptReason(deoptimization_reason, pos, deoptimization_id); tasm()->RecordDeoptReason(deoptimization_reason, pos, deoptimization_id);
} }
tasm()->CallForDeoptimization(deopt_entry, RelocInfo::RUNTIME_ENTRY); tasm()->CallForDeoptimization(deopt_entry, deoptimization_id,
RelocInfo::RUNTIME_ENTRY);
return kSuccess; return kSuccess;
} }
......
...@@ -600,18 +600,43 @@ int Deoptimizer::GetDeoptimizationId(Isolate* isolate, Address addr, ...@@ -600,18 +600,43 @@ int Deoptimizer::GetDeoptimizationId(Isolate* isolate, Address addr,
DeoptimizeKind kind) { DeoptimizeKind kind) {
DeoptimizerData* data = isolate->deoptimizer_data(); DeoptimizerData* data = isolate->deoptimizer_data();
CHECK_LE(kind, DeoptimizerData::kLastDeoptimizeKind); CHECK_LE(kind, DeoptimizerData::kLastDeoptimizeKind);
DCHECK(IsInDeoptimizationTable(isolate, addr, kind));
Code* code = data->deopt_entry_code(kind); Code* code = data->deopt_entry_code(kind);
if (code == nullptr) return kNotDeoptimizationEntry;
Address start = code->raw_instruction_start(); Address start = code->raw_instruction_start();
if (addr < start ||
addr >= start + (kMaxNumberOfEntries * table_entry_size_)) {
return kNotDeoptimizationEntry;
}
DCHECK_EQ(0, DCHECK_EQ(0,
static_cast<int>(addr - start) % table_entry_size_); static_cast<int>(addr - start) % table_entry_size_);
return static_cast<int>(addr - start) / table_entry_size_; return static_cast<int>(addr - start) / table_entry_size_;
} }
bool Deoptimizer::IsInDeoptimizationTable(Isolate* isolate, Address addr,
DeoptimizeKind type) {
DeoptimizerData* data = isolate->deoptimizer_data();
CHECK_LE(type, DeoptimizerData::kLastDeoptimizeKind);
Code* code = data->deopt_entry_code(type);
if (code == nullptr) return false;
Address start = code->raw_instruction_start();
return ((table_entry_size_ == 0 && addr == start) ||
(addr >= start &&
addr < start + (kMaxNumberOfEntries * table_entry_size_)));
}
bool Deoptimizer::IsDeoptimizationEntry(Isolate* isolate, Address addr,
DeoptimizeKind* type) {
if (IsInDeoptimizationTable(isolate, addr, DeoptimizeKind::kEager)) {
*type = DeoptimizeKind::kEager;
return true;
}
if (IsInDeoptimizationTable(isolate, addr, DeoptimizeKind::kSoft)) {
*type = DeoptimizeKind::kSoft;
return true;
}
if (IsInDeoptimizationTable(isolate, addr, DeoptimizeKind::kLazy)) {
*type = DeoptimizeKind::kLazy;
return true;
}
return false;
}
int Deoptimizer::GetDeoptimizedCodeCount(Isolate* isolate) { int Deoptimizer::GetDeoptimizedCodeCount(Isolate* isolate) {
int length = 0; int length = 0;
// Count all entries in the deoptimizing code list of every context. // Count all entries in the deoptimizing code list of every context.
......
...@@ -478,6 +478,11 @@ class Deoptimizer : public Malloced { ...@@ -478,6 +478,11 @@ class Deoptimizer : public Malloced {
static int GetDeoptimizationId(Isolate* isolate, Address addr, static int GetDeoptimizationId(Isolate* isolate, Address addr,
DeoptimizeKind kind); DeoptimizeKind kind);
// Returns true if {addr} is a deoptimization entry and stores its type in
// {type}. Returns false if {addr} is not a deoptimization entry.
static bool IsDeoptimizationEntry(Isolate* isolate, Address addr,
DeoptimizeKind* type);
// Code generation support. // Code generation support.
static int input_offset() { return OFFSET_OF(Deoptimizer, input_); } static int input_offset() { return OFFSET_OF(Deoptimizer, input_); }
static int output_count_offset() { static int output_count_offset() {
...@@ -536,6 +541,9 @@ class Deoptimizer : public Malloced { ...@@ -536,6 +541,9 @@ class Deoptimizer : public Malloced {
void PrintFunctionName(); void PrintFunctionName();
void DeleteFrameDescriptions(); void DeleteFrameDescriptions();
static bool IsInDeoptimizationTable(Isolate* isolate, Address addr,
DeoptimizeKind type);
void DoComputeOutputFrames(); void DoComputeOutputFrames();
void DoComputeInterpretedFrame(TranslatedFrame* translated_frame, void DoComputeInterpretedFrame(TranslatedFrame* translated_frame,
int frame_index, bool goto_catch_handler); int frame_index, bool goto_catch_handler);
......
...@@ -152,26 +152,15 @@ static void PrintRelocInfo(StringBuilder* out, Isolate* isolate, ...@@ -152,26 +152,15 @@ static void PrintRelocInfo(StringBuilder* out, Isolate* isolate,
} }
} else if (RelocInfo::IsRuntimeEntry(rmode) && isolate && } else if (RelocInfo::IsRuntimeEntry(rmode) && isolate &&
isolate->deoptimizer_data() != nullptr) { isolate->deoptimizer_data() != nullptr) {
// A runtime entry reloinfo might be a deoptimization bailout-> // A runtime entry relocinfo might be a deoptimization bailout.
Address addr = relocinfo->target_address(); Address addr = relocinfo->target_address();
int id = DeoptimizeKind type;
Deoptimizer::GetDeoptimizationId(isolate, addr, DeoptimizeKind::kEager); if (Deoptimizer::IsDeoptimizationEntry(isolate, addr, &type)) {
if (id == Deoptimizer::kNotDeoptimizationEntry) { int id = relocinfo->GetDeoptimizationId(isolate, type);
id = Deoptimizer::GetDeoptimizationId(isolate, addr, out->AddFormatted(" ;; %s deoptimization bailout %d",
DeoptimizeKind::kLazy); Deoptimizer::MessageFor(type), id);
if (id == Deoptimizer::kNotDeoptimizationEntry) {
id = Deoptimizer::GetDeoptimizationId(isolate, addr,
DeoptimizeKind::kSoft);
if (id == Deoptimizer::kNotDeoptimizationEntry) {
out->AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode));
} else {
out->AddFormatted(" ;; soft deoptimization bailout %d", id);
}
} else { } else {
out->AddFormatted(" ;; lazy deoptimization bailout %d", id); out->AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode));
}
} else {
out->AddFormatted(" ;; deoptimization bailout %d", id);
} }
} else { } else {
out->AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode)); out->AddFormatted(" ;; %s", RelocInfo::RelocModeName(rmode));
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "src/base/cpu.h" #include "src/base/cpu.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/conversions-inl.h" #include "src/conversions-inl.h"
#include "src/deoptimizer.h"
#include "src/disassembler.h" #include "src/disassembler.h"
#include "src/macro-assembler.h" #include "src/macro-assembler.h"
#include "src/v8.h" #include "src/v8.h"
...@@ -205,6 +206,11 @@ bool RelocInfo::IsInConstantPool() { ...@@ -205,6 +206,11 @@ bool RelocInfo::IsInConstantPool() {
return false; return false;
} }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
return Deoptimizer::GetDeoptimizationId(isolate, target_address(), kind);
}
void RelocInfo::set_js_to_wasm_address(Address address, void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) { ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL); DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
...@@ -122,7 +122,9 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -122,7 +122,9 @@ class TurboAssembler : public TurboAssemblerBase {
void RetpolineJump(Register reg); void RetpolineJump(Register reg);
void CallForDeoptimization(Address target, RelocInfo::Mode rmode) { void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) {
USE(deopt_id);
call(target, rmode); call(target, rmode);
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/base/cpu.h" #include "src/base/cpu.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/deoptimizer.h"
#include "src/mips/assembler-mips-inl.h" #include "src/mips/assembler-mips-inl.h"
namespace v8 { namespace v8 {
...@@ -198,6 +199,11 @@ bool RelocInfo::IsInConstantPool() { ...@@ -198,6 +199,11 @@ bool RelocInfo::IsInConstantPool() {
return false; return false;
} }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
return Deoptimizer::GetDeoptimizationId(isolate, target_address(), kind);
}
void RelocInfo::set_js_to_wasm_address(Address address, void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) { ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL); DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
...@@ -281,7 +281,9 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -281,7 +281,9 @@ class TurboAssembler : public TurboAssemblerBase {
COND_ARGS); COND_ARGS);
void Call(Label* target); void Call(Label* target);
void CallForDeoptimization(Address target, RelocInfo::Mode rmode) { void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) {
USE(deopt_id);
Call(target, rmode); Call(target, rmode);
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "src/base/cpu.h" #include "src/base/cpu.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/deoptimizer.h"
#include "src/mips64/assembler-mips64-inl.h" #include "src/mips64/assembler-mips64-inl.h"
namespace v8 { namespace v8 {
...@@ -176,6 +177,11 @@ bool RelocInfo::IsInConstantPool() { ...@@ -176,6 +177,11 @@ bool RelocInfo::IsInConstantPool() {
return false; return false;
} }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
return Deoptimizer::GetDeoptimizationId(isolate, target_address(), kind);
}
void RelocInfo::set_js_to_wasm_address(Address address, void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) { ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL); DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
...@@ -298,7 +298,9 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -298,7 +298,9 @@ class TurboAssembler : public TurboAssemblerBase {
COND_ARGS); COND_ARGS);
void Call(Label* target); void Call(Label* target);
void CallForDeoptimization(Address target, RelocInfo::Mode rmode) { void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) {
USE(deopt_id);
Call(target, rmode); Call(target, rmode);
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/base/cpu.h" #include "src/base/cpu.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/deoptimizer.h"
#include "src/macro-assembler.h" #include "src/macro-assembler.h"
#include "src/ppc/assembler-ppc-inl.h" #include "src/ppc/assembler-ppc-inl.h"
...@@ -161,6 +162,11 @@ bool RelocInfo::IsInConstantPool() { ...@@ -161,6 +162,11 @@ bool RelocInfo::IsInConstantPool() {
return false; return false;
} }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
return Deoptimizer::GetDeoptimizationId(isolate, target_address(), kind);
}
void RelocInfo::set_js_to_wasm_address(Address address, void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) { ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL); DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
...@@ -471,7 +471,9 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -471,7 +471,9 @@ class TurboAssembler : public TurboAssemblerBase {
Condition cond = al); Condition cond = al);
void Call(Label* target); void Call(Label* target);
void CallForDeoptimization(Address target, RelocInfo::Mode rmode) { void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) {
USE(deopt_id);
Call(target, rmode); Call(target, rmode);
} }
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/base/cpu.h" #include "src/base/cpu.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/deoptimizer.h"
#include "src/macro-assembler.h" #include "src/macro-assembler.h"
#include "src/s390/assembler-s390-inl.h" #include "src/s390/assembler-s390-inl.h"
...@@ -271,6 +272,11 @@ bool RelocInfo::IsCodedSpecially() { ...@@ -271,6 +272,11 @@ bool RelocInfo::IsCodedSpecially() {
bool RelocInfo::IsInConstantPool() { return false; } bool RelocInfo::IsInConstantPool() { return false; }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
return Deoptimizer::GetDeoptimizationId(isolate, target_address(), kind);
}
void RelocInfo::set_js_to_wasm_address(Address address, void RelocInfo::set_js_to_wasm_address(Address address,
ICacheFlushMode icache_flush_mode) { ICacheFlushMode icache_flush_mode) {
DCHECK_EQ(rmode_, JS_TO_WASM_CALL); DCHECK_EQ(rmode_, JS_TO_WASM_CALL);
......
...@@ -215,7 +215,9 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -215,7 +215,9 @@ class TurboAssembler : public TurboAssemblerBase {
void Ret() { b(r14); } void Ret() { b(r14); }
void Ret(Condition cond) { b(cond, r14); } void Ret(Condition cond) { b(cond, r14); }
void CallForDeoptimization(Address target, RelocInfo::Mode rmode) { void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) {
USE(deopt_id);
Call(target, rmode); Call(target, rmode);
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "src/base/bits.h" #include "src/base/bits.h"
#include "src/base/cpu.h" #include "src/base/cpu.h"
#include "src/code-stubs.h" #include "src/code-stubs.h"
#include "src/deoptimizer.h"
#include "src/macro-assembler.h" #include "src/macro-assembler.h"
#include "src/v8.h" #include "src/v8.h"
...@@ -4857,6 +4858,10 @@ bool RelocInfo::IsInConstantPool() { ...@@ -4857,6 +4858,10 @@ bool RelocInfo::IsInConstantPool() {
return false; return false;
} }
int RelocInfo::GetDeoptimizationId(Isolate* isolate, DeoptimizeKind kind) {
DCHECK(IsRuntimeEntry(rmode_));
return Deoptimizer::GetDeoptimizationId(isolate, target_address(), kind);
}
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -410,7 +410,9 @@ class TurboAssembler : public TurboAssemblerBase { ...@@ -410,7 +410,9 @@ class TurboAssembler : public TurboAssemblerBase {
void RetpolineJump(Register reg); void RetpolineJump(Register reg);
void CallForDeoptimization(Address target, RelocInfo::Mode rmode) { void CallForDeoptimization(Address target, int deopt_id,
RelocInfo::Mode rmode) {
USE(deopt_id);
call(target, rmode); call(target, rmode);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment