[mips] Fix build failed

Port 407317a284

Change-Id: I6d46b2c9b9bafb0287fa711822aac8ffdb30c7ba
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2962153
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#75141}
This commit is contained in:
Liu Yu 2021-06-15 11:32:59 +08:00 committed by V8 LUCI CQ
parent e54c28ba0a
commit 76a42474d2
5 changed files with 56 additions and 66 deletions

View File

@ -297,20 +297,19 @@ void TurboAssembler::CallRecordWriteStub(
if (false) {
#endif
} else {
auto builtin_index =
Builtin builtin =
Builtins::GetRecordWriteStub(remembered_set_action, fp_mode);
if (options().inline_offheap_trampolines) {
// Inline the trampoline.
DCHECK(Builtins::IsBuiltinId(builtin_index));
RecordCommentForOffHeapTrampoline(builtin_index);
CHECK_NE(builtin_index, Builtin::kNoBuiltinId);
DCHECK(Builtins::IsBuiltinId(builtin));
RecordCommentForOffHeapTrampoline(builtin);
CHECK_NE(builtin, Builtin::kNoBuiltinId);
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Address entry = d.InstructionStartOfBuiltin(builtin);
li(t9, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Call(t9);
} else {
Handle<Code> code_target =
isolate()->builtins()->code_handle(builtin_index);
Handle<Code> code_target = isolate()->builtins()->code_handle(builtin);
Call(code_target, RelocInfo::CODE_TARGET);
}
}
@ -3798,10 +3797,10 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
} else if (target_is_isolate_independent_builtin &&
options().inline_offheap_trampolines) {
// Inline the trampoline.
RecordCommentForOffHeapTrampoline(builtin_index);
CHECK_NE(builtin_index, Builtin::kNoBuiltinId);
RecordCommentForOffHeapTrampoline(builtin);
CHECK_NE(builtin, Builtin::kNoBuiltinId);
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Address entry = d.InstructionStartOfBuiltin(builtin);
li(t9, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Jump(t9, 0, cond, rs, rt, bd);
return;
@ -3964,26 +3963,26 @@ void TurboAssembler::LoadEntryFromBuiltinIndex(Register builtin_index) {
lw(builtin_index,
MemOperand(builtin_index, IsolateData::builtin_entry_table_offset()));
}
void TurboAssembler::LoadEntryFromBuiltin(Builtin builtin_index,
void TurboAssembler::LoadEntryFromBuiltin(Builtin builtin,
Register destination) {
Lw(destination, EntryFromBuiltinAsOperand(builtin_index));
Lw(destination, EntryFromBuiltinAsOperand(builtin));
}
MemOperand TurboAssembler::EntryFromBuiltinAsOperand(Builtin builtin_index) {
MemOperand TurboAssembler::EntryFromBuiltinAsOperand(Builtin builtin) {
DCHECK(root_array_available());
return MemOperand(kRootRegister,
IsolateData::builtin_entry_slot_offset(builtin_index));
IsolateData::builtin_entry_slot_offset(builtin));
}
void TurboAssembler::CallBuiltinByIndex(Register builtin_index) {
LoadEntryFromBuiltinIndex(builtin_index);
Call(builtin_index);
}
void TurboAssembler::CallBuiltin(int builtin_index) {
DCHECK(Builtin::IsBuiltinId(builtin_index));
RecordCommentForOffHeapTrampoline(builtin_index);
CHECK_NE(builtin_index, Builtin::kNoBuiltinId);
void TurboAssembler::CallBuiltin(Builtin builtin) {
DCHECK(Builtin::IsBuiltinId(builtin));
RecordCommentForOffHeapTrampoline(builtin);
CHECK_NE(builtin, Builtin::kNoBuiltinId);
EmbeddedData d = EmbeddedData::FromBlob(isolate());
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Address entry = d.InstructionStartOfBuiltin(builtin);
Call(entry, RelocInfo::OFF_HEAP_TARGET);
if (FLAG_code_comments) RecordComment("]");
}

View File

@ -220,18 +220,14 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void Call(Label* target);
void LoadAddress(Register dst, Label* target);
// Load the builtin given by the Smi in |builtin_index| into the same
// Load the builtin given by the Smi in |builtin| into the same
// register.
void LoadEntryFromBuiltinIndex(Register builtin_index);
void LoadEntryFromBuiltin(Builtin builtin_index, Register destination);
MemOperand EntryFromBuiltinAsOperand(Builtin builtin_index);
void LoadEntryFromBuiltinIndex(Register builtin);
void LoadEntryFromBuiltin(Builtin builtin, Register destination);
MemOperand EntryFromBuiltinAsOperand(Builtin builtin);
void CallBuiltinByIndex(Register builtin_index);
void CallBuiltin(Builtin builtin) {
// TODO(11527): drop the int overload in favour of the Builtin one.
return CallBuiltin(static_cast<int>(builtin));
}
void CallBuiltin(int builtin_index);
void CallBuiltin(Builtin builtin);
void LoadCodeObjectEntry(Register destination, Register code_object);
void CallCodeObject(Register code_object);

View File

@ -295,20 +295,18 @@ void TurboAssembler::CallRecordWriteStub(
if (false) {
#endif
} else {
auto builtin_index =
Builtins::GetRecordWriteStub(remembered_set_action, fp_mode);
auto builtin = Builtins::GetRecordWriteStub(remembered_set_action, fp_mode);
if (options().inline_offheap_trampolines) {
// Inline the trampoline.
DCHECK(Builtins::IsBuiltinId(builtin_index));
RecordCommentForOffHeapTrampoline(builtin_index);
CHECK_NE(builtin_index, Builtin::kNoBuiltinId);
DCHECK(Builtins::IsBuiltinId(builtin));
RecordCommentForOffHeapTrampoline(builtin);
CHECK_NE(builtin, Builtin::kNoBuiltinId);
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Address entry = d.InstructionStartOfBuiltin(builtin);
li(t9, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Call(t9);
} else {
Handle<Code> code_target =
isolate()->builtins()->code_handle(builtin_index);
Handle<Code> code_target = isolate()->builtins()->code_handle(builtin);
Call(code_target, RelocInfo::CODE_TARGET);
}
}
@ -4344,14 +4342,14 @@ void TurboAssembler::Jump(Handle<Code> code, RelocInfo::Mode rmode,
Jump(t9, cond, rs, rt, bd);
return;
} else if (options().inline_offheap_trampolines) {
int builtin_index = Builtin::kNoBuiltinId;
if (isolate()->builtins()->IsBuiltinHandle(code, &builtin_index) &&
Builtins::IsIsolateIndependent(builtin_index)) {
Builtin builtin = Builtin::kNoBuiltinId;
if (isolate()->builtins()->IsBuiltinHandle(code, &builtin) &&
Builtins::IsIsolateIndependent(builtin)) {
// Inline the trampoline.
RecordCommentForOffHeapTrampoline(builtin_index);
CHECK_NE(builtin_index, Builtin::kNoBuiltinId);
RecordCommentForOffHeapTrampoline(builtin);
CHECK_NE(builtin, Builtin::kNoBuiltinId);
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Address entry = d.InstructionStartOfBuiltin(builtin);
li(t9, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Jump(t9, cond, rs, rt, bd);
return;
@ -4423,14 +4421,14 @@ void TurboAssembler::Call(Handle<Code> code, RelocInfo::Mode rmode,
Call(t9, cond, rs, rt, bd);
return;
} else if (options().inline_offheap_trampolines) {
int builtin_index = Builtin::kNoBuiltinId;
if (isolate()->builtins()->IsBuiltinHandle(code, &builtin_index) &&
Builtins::IsIsolateIndependent(builtin_index)) {
Builtin builtin = Builtin::kNoBuiltinId;
if (isolate()->builtins()->IsBuiltinHandle(code, &builtin) &&
Builtins::IsIsolateIndependent(builtin)) {
// Inline the trampoline.
RecordCommentForOffHeapTrampoline(builtin_index);
CHECK_NE(builtin_index, Builtin::kNoBuiltinId);
RecordCommentForOffHeapTrampoline(builtin);
CHECK_NE(builtin, Builtin::kNoBuiltinId);
EmbeddedData d = EmbeddedData::FromBlob();
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Address entry = d.InstructionStartOfBuiltin(builtin);
li(t9, Operand(entry, RelocInfo::OFF_HEAP_TARGET));
Call(t9, cond, rs, rt, bd);
return;
@ -4453,26 +4451,26 @@ void TurboAssembler::LoadEntryFromBuiltinIndex(Register builtin_index) {
Ld(builtin_index,
MemOperand(builtin_index, IsolateData::builtin_entry_table_offset()));
}
void TurboAssembler::LoadEntryFromBuiltin(Builtin builtin_index,
void TurboAssembler::LoadEntryFromBuiltin(Builtin builtin,
Register destination) {
Ld(destination, EntryFromBuiltinAsOperand(builtin_index));
Ld(destination, EntryFromBuiltinAsOperand(builtin));
}
MemOperand TurboAssembler::EntryFromBuiltinAsOperand(Builtin builtin_index) {
MemOperand TurboAssembler::EntryFromBuiltinAsOperand(Builtin builtin) {
DCHECK(root_array_available());
return MemOperand(kRootRegister,
IsolateData::builtin_entry_slot_offset(builtin_index));
IsolateData::builtin_entry_slot_offset(builtin));
}
void TurboAssembler::CallBuiltinByIndex(Register builtin_index) {
LoadEntryFromBuiltinIndex(builtin_index);
Call(builtin_index);
}
void TurboAssembler::CallBuiltin(int builtin_index) {
DCHECK(Builtin::IsBuiltinId(builtin_index));
RecordCommentForOffHeapTrampoline(builtin_index);
CHECK_NE(builtin_index, Builtin::kNoBuiltinId);
void TurboAssembler::CallBuiltin(Builtin builtin) {
DCHECK(Builtin::IsBuiltinId(builtin));
RecordCommentForOffHeapTrampoline(builtin);
CHECK_NE(builtin, Builtin::kNoBuiltinId);
EmbeddedData d = EmbeddedData::FromBlob(isolate());
Address entry = d.InstructionStartOfBuiltin(builtin_index);
Address entry = d.InstructionStartOfBuiltin(builtin);
Call(entry, RelocInfo::OFF_HEAP_TARGET);
if (FLAG_code_comments) RecordComment("]");
}

View File

@ -246,16 +246,12 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
// Load the builtin given by the Smi in |builtin_index| into the same
// register.
void LoadEntryFromBuiltinIndex(Register builtin_index);
void LoadEntryFromBuiltin(Builtin builtin_index, Register destination);
MemOperand EntryFromBuiltinAsOperand(Builtin builtin_index);
void LoadEntryFromBuiltinIndex(Register builtin);
void LoadEntryFromBuiltin(Builtin builtin, Register destination);
MemOperand EntryFromBuiltinAsOperand(Builtin builtin);
void CallBuiltinByIndex(Register builtin_index);
void CallBuiltin(Builtin builtin) {
// TODO(11527): drop the int overload in favour of the Builtin one.
return CallBuiltin(static_cast<int>(builtin));
}
void CallBuiltin(int builtin_index);
void CallBuiltinByIndex(Register builtin);
void CallBuiltin(Builtin builtin);
void LoadCodeObjectEntry(Register destination, Register code_object);
void CallCodeObject(Register code_object);

View File

@ -29,6 +29,7 @@
#include <iostream>
#include "src/base/utils/random-number-generator.h"
#include "src/codegen/assembler-inl.h"
#include "src/codegen/macro-assembler.h"
#include "src/deoptimizer/deoptimizer.h"