[codet] Remove obsolete CodeT dispatch functions
These are no longer relevant now that CodeT is an unconditional alias for CodeDataContainer. Bug: v8:13654 Change-Id: Ia283f735cad380d1b97606715cc3b99768e49464 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4161762 Auto-Submit: Jakob Linke <jgruber@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/heads/main@{#85276}
This commit is contained in:
parent
b791f4f040
commit
651d4d9748
@ -550,7 +550,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
__ Mov(x1, x4);
|
||||
static_assert(kJavaScriptCallCodeStartRegister == x2, "ABI mismatch");
|
||||
__ LoadTaggedPointerField(x2, FieldMemOperand(x1, JSFunction::kCodeOffset));
|
||||
__ JumpCodeTObject(x2);
|
||||
__ JumpCodeDataContainerObject(x2);
|
||||
}
|
||||
|
||||
__ Bind(&prepare_step_in_if_stepping);
|
||||
@ -1503,7 +1503,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(
|
||||
__ Move(x2, kInterpreterBytecodeArrayRegister);
|
||||
static_assert(kJavaScriptCallCodeStartRegister == x2, "ABI mismatch");
|
||||
__ ReplaceClosureCodeWithOptimizedCode(x2, closure);
|
||||
__ JumpCodeTObject(x2);
|
||||
__ JumpCodeDataContainerObject(x2);
|
||||
|
||||
__ bind(&install_baseline_code);
|
||||
__ GenerateTailCallToReturnedCode(Runtime::kInstallBaselineCode);
|
||||
@ -1743,7 +1743,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
|
||||
|
||||
__ LoadTaggedPointerField(
|
||||
x1, FieldMemOperand(x1, InterpreterData::kInterpreterTrampolineOffset));
|
||||
__ LoadCodeTEntry(x1, x1);
|
||||
__ LoadCodeDataContainerEntry(x1, x1);
|
||||
__ B(&trampoline_loaded);
|
||||
|
||||
__ Bind(&builtin_trampoline);
|
||||
|
@ -468,12 +468,8 @@ Handle<Code> Builtins::CreateInterpreterEntryTrampolineForProfiling(
|
||||
|
||||
CodeDesc::Verify(&desc);
|
||||
|
||||
int kind_specific_flags;
|
||||
{
|
||||
CodeT code = isolate->builtins()->code(builtin);
|
||||
kind_specific_flags =
|
||||
CodeDataContainerFromCodeT(code).kind_specific_flags(kRelaxedLoad);
|
||||
}
|
||||
const int kind_specific_flags =
|
||||
isolate->builtins()->code(builtin).kind_specific_flags(kRelaxedLoad);
|
||||
|
||||
return Factory::CodeBuilder(isolate, desc, CodeKind::BUILTIN)
|
||||
.set_kind_specific_flags(kind_specific_flags)
|
||||
|
@ -825,7 +825,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
// undefined because generator functions are non-constructable.
|
||||
static_assert(kJavaScriptCallCodeStartRegister == rcx, "ABI mismatch");
|
||||
__ LoadTaggedPointerField(rcx, FieldOperand(rdi, JSFunction::kCodeOffset));
|
||||
__ JumpCodeTObject(rcx);
|
||||
__ JumpCodeDataContainerObject(rcx);
|
||||
}
|
||||
|
||||
__ bind(&prepare_step_in_if_stepping);
|
||||
@ -1242,7 +1242,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(
|
||||
__ ReplaceClosureCodeWithOptimizedCode(
|
||||
rcx, closure, kInterpreterBytecodeArrayRegister,
|
||||
WriteBarrierDescriptor::SlotAddressRegister());
|
||||
__ JumpCodeTObject(rcx);
|
||||
__ JumpCodeDataContainerObject(rcx);
|
||||
|
||||
__ bind(&install_baseline_code);
|
||||
__ GenerateTailCallToReturnedCode(Runtime::kInstallBaselineCode);
|
||||
@ -1428,7 +1428,7 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
|
||||
|
||||
__ LoadTaggedPointerField(
|
||||
rbx, FieldOperand(rbx, InterpreterData::kInterpreterTrampolineOffset));
|
||||
__ LoadCodeTEntry(rbx, rbx);
|
||||
__ LoadCodeDataContainerEntry(rbx, rbx);
|
||||
__ jmp(&trampoline_loaded, Label::kNear);
|
||||
|
||||
__ bind(&builtin_trampoline);
|
||||
@ -2877,7 +2877,7 @@ void Builtins::Generate_MaglevOutOfLinePrologue(MacroAssembler* masm) {
|
||||
__ Drop(kStackParameterCount + kReturnAddressCount);
|
||||
__ Move(scratch0,
|
||||
BUILTIN_CODE(masm->isolate(), CompileLazyDeoptimizedCode));
|
||||
__ LoadCodeObjectEntry(scratch0, scratch0);
|
||||
__ LoadCodeDataContainerEntry(scratch0, scratch0);
|
||||
__ PushReturnAddressFrom(scratch0);
|
||||
__ ret(0);
|
||||
}
|
||||
|
@ -339,12 +339,6 @@ void TurboAssembler::TailCallBuiltin(Builtin builtin, Condition cond) {
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeObjectEntry(Register destination,
|
||||
Register code_object) {
|
||||
// TODO(jgruber): Remove this method and similar methods below.
|
||||
LoadCodeDataContainerEntry(destination, code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeDataContainerEntry(
|
||||
Register destination, Register code_data_container_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
@ -378,19 +372,6 @@ void TurboAssembler::JumpCodeDataContainerObject(
|
||||
Jump(code_data_container_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::CallCodeObject(Register code_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
Call(code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::JumpCodeObject(Register code_object, JumpMode jump_mode) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
DCHECK_EQ(JumpMode::kJump, jump_mode);
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
Jump(code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::StoreReturnAddressAndCall(Register target) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
// This generates the final instruction sequence for calls to C functions
|
||||
|
@ -323,11 +323,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
|
||||
void CallBuiltin(Builtin builtin, Condition cond = al);
|
||||
void TailCallBuiltin(Builtin builtin, Condition cond = al);
|
||||
|
||||
void LoadCodeObjectEntry(Register destination, Register code_object);
|
||||
void CallCodeObject(Register code_object);
|
||||
void JumpCodeObject(Register code_object,
|
||||
JumpMode jump_mode = JumpMode::kJump);
|
||||
|
||||
// Load the code entry point from the CodeDataContainer object.
|
||||
void LoadCodeDataContainerEntry(Register destination,
|
||||
Register code_data_container_object);
|
||||
|
@ -1422,7 +1422,7 @@ void TailCallOptimizedCodeSlot(MacroAssembler* masm,
|
||||
__ ReplaceClosureCodeWithOptimizedCode(optimized_code_entry, closure);
|
||||
static_assert(kJavaScriptCallCodeStartRegister == x2, "ABI mismatch");
|
||||
__ Move(x2, optimized_code_entry);
|
||||
__ JumpCodeTObject(x2);
|
||||
__ JumpCodeDataContainerObject(x2);
|
||||
|
||||
// Optimized code slot contains deoptimized code or code is cleared and
|
||||
// optimized code marker isn't updated. Evict the code, update the marker
|
||||
@ -1483,7 +1483,7 @@ void MacroAssembler::GenerateTailCallToReturnedCode(
|
||||
}
|
||||
|
||||
static_assert(kJavaScriptCallCodeStartRegister == x2, "ABI mismatch");
|
||||
JumpCodeTObject(x2);
|
||||
JumpCodeDataContainerObject(x2);
|
||||
}
|
||||
|
||||
// Read off the flags in the feedback vector and check if there
|
||||
@ -2348,31 +2348,6 @@ void TurboAssembler::TailCallBuiltin(Builtin builtin, Condition cond) {
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeObjectEntry(Register destination,
|
||||
Register code_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
LoadCodeDataContainerEntry(destination, code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::CallCodeObject(Register code_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
Call(code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::JumpCodeObject(Register code_object, JumpMode jump_mode) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
DCHECK_EQ(JumpMode::kJump, jump_mode);
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
|
||||
UseScratchRegisterScope temps(this);
|
||||
if (code_object != x17) {
|
||||
temps.Exclude(x17);
|
||||
Mov(x17, code_object);
|
||||
}
|
||||
Jump(x17);
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeDataContainerEntry(
|
||||
Register destination, Register code_data_container_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
@ -2411,19 +2386,6 @@ void TurboAssembler::JumpCodeDataContainerObject(
|
||||
Jump(x17);
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeTEntry(Register destination, Register code) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
LoadCodeDataContainerEntry(destination, code);
|
||||
}
|
||||
|
||||
void TurboAssembler::CallCodeTObject(Register code) {
|
||||
CallCodeDataContainerObject(code);
|
||||
}
|
||||
|
||||
void TurboAssembler::JumpCodeTObject(Register code, JumpMode jump_mode) {
|
||||
JumpCodeDataContainerObject(code, jump_mode);
|
||||
}
|
||||
|
||||
void TurboAssembler::StoreReturnAddressAndCall(Register target) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
// This generates the final instruction sequence for calls to C functions
|
||||
@ -2699,10 +2661,10 @@ void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
|
||||
FieldMemOperand(function, JSFunction::kCodeOffset));
|
||||
switch (type) {
|
||||
case InvokeType::kCall:
|
||||
CallCodeTObject(code);
|
||||
CallCodeDataContainerObject(code);
|
||||
break;
|
||||
case InvokeType::kJump:
|
||||
JumpCodeTObject(code);
|
||||
JumpCodeDataContainerObject(code);
|
||||
break;
|
||||
}
|
||||
B(&done);
|
||||
|
@ -994,11 +994,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
|
||||
void CallBuiltin(Builtin builtin);
|
||||
void TailCallBuiltin(Builtin builtin, Condition cond = al);
|
||||
|
||||
void LoadCodeObjectEntry(Register destination, Register code_object);
|
||||
void CallCodeObject(Register code_object);
|
||||
void JumpCodeObject(Register code_object,
|
||||
JumpMode jump_mode = JumpMode::kJump);
|
||||
|
||||
// Load code entry point from the CodeDataContainer object.
|
||||
void LoadCodeDataContainerEntry(Register destination,
|
||||
Register code_data_container_object);
|
||||
@ -1012,13 +1007,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
|
||||
void JumpCodeDataContainerObject(Register code_data_container_object,
|
||||
JumpMode jump_mode = JumpMode::kJump);
|
||||
|
||||
// Helper functions that dispatch either to Call/JumpCodeObject or to
|
||||
// Call/JumpCodeDataContainerObject.
|
||||
// TODO(v8:11880): remove since CodeT targets are now default.
|
||||
void LoadCodeTEntry(Register destination, Register code);
|
||||
void CallCodeTObject(Register code);
|
||||
void JumpCodeTObject(Register code, JumpMode jump_mode = JumpMode::kJump);
|
||||
|
||||
// Generates an instruction sequence s.t. the return address points to the
|
||||
// instruction following the call.
|
||||
// The return address on the stack is used by frame iteration.
|
||||
|
@ -15600,14 +15600,13 @@ TNode<CodeT> CodeStubAssembler::GetSharedFunctionInfoCode(
|
||||
}
|
||||
|
||||
TNode<RawPtrT> CodeStubAssembler::GetCodeEntry(TNode<CodeT> code) {
|
||||
TNode<CodeDataContainer> cdc = CodeDataContainerFromCodeT(code);
|
||||
return LoadObjectField<RawPtrT>(
|
||||
cdc, IntPtrConstant(CodeDataContainer::kCodeEntryPointOffset));
|
||||
code, IntPtrConstant(CodeDataContainer::kCodeEntryPointOffset));
|
||||
}
|
||||
|
||||
TNode<BoolT> CodeStubAssembler::IsMarkedForDeoptimization(TNode<CodeT> codet) {
|
||||
return IsSetWord32<Code::MarkedForDeoptimizationField>(
|
||||
LoadObjectField<Int32T>(CodeDataContainerFromCodeT(codet),
|
||||
LoadObjectField<Int32T>(codet,
|
||||
CodeDataContainer::kKindSpecificFlagsOffset));
|
||||
}
|
||||
|
||||
|
@ -853,10 +853,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
|
||||
return CAST(o);
|
||||
}
|
||||
|
||||
TNode<CodeDataContainer> CodeDataContainerFromCodeT(TNode<CodeT> code) {
|
||||
return code;
|
||||
}
|
||||
|
||||
TNode<CodeT> ToCodeT(TNode<Code> code) {
|
||||
return LoadObjectField<CodeDataContainer>(code,
|
||||
Code::kCodeDataContainerOffset);
|
||||
|
@ -2045,33 +2045,6 @@ Operand TurboAssembler::EntryFromBuiltinAsOperand(Builtin builtin) {
|
||||
return Operand(kRootRegister, IsolateData::BuiltinEntrySlotOffset(builtin));
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeObjectEntry(Register destination,
|
||||
Register code_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
mov(destination,
|
||||
FieldOperand(code_object, CodeDataContainer::kCodeEntryPointOffset));
|
||||
}
|
||||
|
||||
void TurboAssembler::CallCodeObject(Register code_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
call(code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::JumpCodeObject(Register code_object, JumpMode jump_mode) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
switch (jump_mode) {
|
||||
case JumpMode::kJump:
|
||||
jmp(code_object);
|
||||
return;
|
||||
case JumpMode::kPushAndReturn:
|
||||
push(code_object);
|
||||
ret(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeDataContainerEntry(
|
||||
Register destination, Register code_data_container_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
|
@ -158,11 +158,6 @@ class V8_EXPORT_PRIVATE TurboAssembler
|
||||
void CallBuiltin(Builtin builtin);
|
||||
void TailCallBuiltin(Builtin builtin);
|
||||
|
||||
void LoadCodeObjectEntry(Register destination, Register code_object);
|
||||
void CallCodeObject(Register code_object);
|
||||
void JumpCodeObject(Register code_object,
|
||||
JumpMode jump_mode = JumpMode::kJump);
|
||||
|
||||
// Load the code entry point from the CodeDataContainer object.
|
||||
void LoadCodeDataContainerEntry(Register destination,
|
||||
Register code_data_container_object);
|
||||
|
@ -844,7 +844,7 @@ void TailCallOptimizedCodeSlot(MacroAssembler* masm,
|
||||
scratch1, scratch2);
|
||||
static_assert(kJavaScriptCallCodeStartRegister == rcx, "ABI mismatch");
|
||||
__ Move(rcx, optimized_code_entry);
|
||||
__ JumpCodeTObject(rcx, jump_mode);
|
||||
__ JumpCodeDataContainerObject(rcx, jump_mode);
|
||||
|
||||
// Optimized code slot contains deoptimized code or code is cleared and
|
||||
// optimized code marker isn't updated. Evict the code, update the marker
|
||||
@ -893,7 +893,7 @@ void MacroAssembler::GenerateTailCallToReturnedCode(
|
||||
Pop(kJavaScriptCallTargetRegister);
|
||||
}
|
||||
static_assert(kJavaScriptCallCodeStartRegister == rcx, "ABI mismatch");
|
||||
JumpCodeTObject(rcx, jump_mode);
|
||||
JumpCodeDataContainerObject(rcx, jump_mode);
|
||||
}
|
||||
|
||||
void MacroAssembler::ReplaceClosureCodeWithOptimizedCode(
|
||||
@ -2293,30 +2293,6 @@ void TurboAssembler::TailCallBuiltin(Builtin builtin, Condition cc) {
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeObjectEntry(Register destination,
|
||||
Register code_object) {
|
||||
// TODO(jgruber): Remove this method and similar methods below.
|
||||
LoadCodeDataContainerEntry(destination, code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::CallCodeObject(Register code_object) {
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
call(code_object);
|
||||
}
|
||||
|
||||
void TurboAssembler::JumpCodeObject(Register code_object, JumpMode jump_mode) {
|
||||
LoadCodeObjectEntry(code_object, code_object);
|
||||
switch (jump_mode) {
|
||||
case JumpMode::kJump:
|
||||
jmp(code_object);
|
||||
return;
|
||||
case JumpMode::kPushAndReturn:
|
||||
pushq(code_object);
|
||||
Ret();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeDataContainerEntry(
|
||||
Register destination, Register code_data_container_object) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
@ -2355,28 +2331,6 @@ void TurboAssembler::JumpCodeDataContainerObject(
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::LoadCodeTEntry(Register destination, Register code) {
|
||||
ASM_CODE_COMMENT(this);
|
||||
AssertCodeT(code);
|
||||
LoadCodeDataContainerEntry(destination, code);
|
||||
}
|
||||
|
||||
void TurboAssembler::CallCodeTObject(Register code) {
|
||||
AssertCodeT(code);
|
||||
CallCodeDataContainerObject(code);
|
||||
}
|
||||
|
||||
void TurboAssembler::JumpCodeTObject(Register code, JumpMode jump_mode) {
|
||||
AssertCodeT(code);
|
||||
JumpCodeDataContainerObject(code, jump_mode);
|
||||
}
|
||||
|
||||
void TurboAssembler::CodeDataContainerFromCodeT(Register destination,
|
||||
Register codet) {
|
||||
AssertCodeT(codet);
|
||||
Move(destination, codet);
|
||||
}
|
||||
|
||||
void TurboAssembler::PextrdPreSse41(Register dst, XMMRegister src,
|
||||
uint8_t imm8) {
|
||||
if (imm8 == 0) {
|
||||
@ -2901,10 +2855,10 @@ void MacroAssembler::InvokeFunctionCode(Register function, Register new_target,
|
||||
LoadTaggedPointerField(rcx, FieldOperand(function, JSFunction::kCodeOffset));
|
||||
switch (type) {
|
||||
case InvokeType::kCall:
|
||||
CallCodeTObject(rcx);
|
||||
CallCodeDataContainerObject(rcx);
|
||||
break;
|
||||
case InvokeType::kJump:
|
||||
JumpCodeTObject(rcx);
|
||||
JumpCodeDataContainerObject(rcx);
|
||||
break;
|
||||
}
|
||||
jmp(&done, Label::kNear);
|
||||
|
@ -400,11 +400,6 @@ class V8_EXPORT_PRIVATE TurboAssembler
|
||||
void TailCallBuiltin(Builtin builtin);
|
||||
void TailCallBuiltin(Builtin builtin, Condition cc);
|
||||
|
||||
void LoadCodeObjectEntry(Register destination, Register code_object);
|
||||
void CallCodeObject(Register code_object);
|
||||
void JumpCodeObject(Register code_object,
|
||||
JumpMode jump_mode = JumpMode::kJump);
|
||||
|
||||
// Load the code entry point from the CodeDataContainer object.
|
||||
void LoadCodeDataContainerEntry(Register destination,
|
||||
Register code_data_container_object);
|
||||
@ -418,14 +413,6 @@ class V8_EXPORT_PRIVATE TurboAssembler
|
||||
void JumpCodeDataContainerObject(Register code_data_container_object,
|
||||
JumpMode jump_mode = JumpMode::kJump);
|
||||
|
||||
// Helper functions that dispatch either to Call/JumpCodeObject or to
|
||||
// Call/JumpCodeDataContainerObject.
|
||||
// TODO(v8:11880): remove since CodeT targets are now default.
|
||||
void LoadCodeTEntry(Register destination, Register code);
|
||||
void CallCodeTObject(Register code);
|
||||
void JumpCodeTObject(Register code, JumpMode jump_mode = JumpMode::kJump);
|
||||
void CodeDataContainerFromCodeT(Register destination, Register codet);
|
||||
|
||||
void Jump(Address destination, RelocInfo::Mode rmode);
|
||||
void Jump(Address destination, RelocInfo::Mode rmode, Condition cc);
|
||||
void Jump(const ExternalReference& reference);
|
||||
|
@ -669,7 +669,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
DCHECK_IMPLIES(
|
||||
instr->HasCallDescriptorFlag(CallDescriptor::kFixedTargetRegister),
|
||||
reg == kJavaScriptCallCodeStartRegister);
|
||||
__ CallCodeObject(reg);
|
||||
__ CallCodeDataContainerObject(reg);
|
||||
}
|
||||
RecordCallPosition(instr);
|
||||
frame_access_state()->ClearSPDelta();
|
||||
@ -723,7 +723,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
DCHECK_IMPLIES(
|
||||
instr->HasCallDescriptorFlag(CallDescriptor::kFixedTargetRegister),
|
||||
reg == kJavaScriptCallCodeStartRegister);
|
||||
__ JumpCodeObject(reg);
|
||||
__ JumpCodeDataContainerObject(reg);
|
||||
}
|
||||
unwinding_info_writer_.MarkBlockWillExit();
|
||||
frame_access_state()->ClearSPDelta();
|
||||
@ -759,7 +759,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
static_assert(kJavaScriptCallCodeStartRegister == x2, "ABI mismatch");
|
||||
__ LoadTaggedPointerField(x2,
|
||||
FieldMemOperand(func, JSFunction::kCodeOffset));
|
||||
__ CallCodeTObject(x2);
|
||||
__ CallCodeDataContainerObject(x2);
|
||||
RecordCallPosition(instr);
|
||||
frame_access_state()->ClearSPDelta();
|
||||
break;
|
||||
|
@ -1270,7 +1270,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
DCHECK_IMPLIES(
|
||||
instr->HasCallDescriptorFlag(CallDescriptor::kFixedTargetRegister),
|
||||
reg == kJavaScriptCallCodeStartRegister);
|
||||
__ LoadCodeObjectEntry(reg, reg);
|
||||
__ LoadCodeDataContainerEntry(reg, reg);
|
||||
__ call(reg);
|
||||
}
|
||||
RecordCallPosition(instr);
|
||||
@ -1330,7 +1330,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
DCHECK_IMPLIES(
|
||||
instr->HasCallDescriptorFlag(CallDescriptor::kFixedTargetRegister),
|
||||
reg == kJavaScriptCallCodeStartRegister);
|
||||
__ LoadCodeObjectEntry(reg, reg);
|
||||
__ LoadCodeDataContainerEntry(reg, reg);
|
||||
__ jmp(reg);
|
||||
}
|
||||
unwinding_info_writer_.MarkBlockWillExit();
|
||||
@ -1360,7 +1360,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
static_assert(kJavaScriptCallCodeStartRegister == rcx, "ABI mismatch");
|
||||
__ LoadTaggedPointerField(rcx,
|
||||
FieldOperand(func, JSFunction::kCodeOffset));
|
||||
__ CallCodeTObject(rcx);
|
||||
__ CallCodeDataContainerObject(rcx);
|
||||
frame_access_state()->ClearSPDelta();
|
||||
RecordCallPosition(instr);
|
||||
break;
|
||||
|
@ -1953,7 +1953,7 @@ void CallKnownJSFunction::GenerateCode(MaglevAssembler* masm,
|
||||
__ LoadTaggedPointerField(kJavaScriptCallCodeStartRegister,
|
||||
FieldMemOperand(kJavaScriptCallTargetRegister,
|
||||
JSFunction::kCodeOffset));
|
||||
__ CallCodeTObject(kJavaScriptCallCodeStartRegister);
|
||||
__ CallCodeDataContainerObject(kJavaScriptCallCodeStartRegister);
|
||||
}
|
||||
masm->DefineExceptionHandlerAndLazyDeoptPoint(this);
|
||||
}
|
||||
|
@ -417,8 +417,6 @@ inline Handle<AbstractCode> ToAbstractCode(Handle<CodeT> code,
|
||||
return Handle<AbstractCode>::cast(code);
|
||||
}
|
||||
|
||||
inline CodeDataContainer CodeDataContainerFromCodeT(CodeT code) { return code; }
|
||||
|
||||
#define CODE_LOOKUP_RESULT_FWD_ACCESSOR(name, Type) \
|
||||
Type CodeLookupResult::name() const { \
|
||||
DCHECK(IsFound()); \
|
||||
|
@ -851,53 +851,37 @@ V8_EXPORT_PRIVATE int OffHeapUnwindingInfoSize(HeapObject code,
|
||||
Builtin builtin);
|
||||
V8_EXPORT_PRIVATE int OffHeapStackSlots(HeapObject code, Builtin builtin);
|
||||
|
||||
// Represents result of the code by inner address (or pc) lookup.
|
||||
// When V8_EXTERNAL_CODE_SPACE is disabled there might be two variants:
|
||||
// - the pc does not correspond to any known code and IsFound() will return
|
||||
// false,
|
||||
// - the pc corresponds to existing Code object or embedded builtin (in which
|
||||
// case the code() will return the respective Code object or the trampoline
|
||||
// Code object that corresponds to the builtin).
|
||||
// Represents result of the code by inner address (or pc) lookup. There are
|
||||
// three possible result cases:
|
||||
//
|
||||
// When V8_EXTERNAL_CODE_SPACE is enabled there might be three variants:
|
||||
// - the pc does not correspond to any known code (in which case IsFound()
|
||||
// will return false),
|
||||
// - the pc corresponds to existing Code object (in which case the code() will
|
||||
// - the pc corresponds to an existing Code object (in which case code() will
|
||||
// return the respective Code object),
|
||||
// - the pc corresponds to an embedded builtin (in which case the
|
||||
// code_data_container() will return CodeDataContainer object corresponding
|
||||
// to the builtin).
|
||||
// code_data_container() will return the CodeDataContainer object
|
||||
// corresponding to the builtin).
|
||||
class CodeLookupResult {
|
||||
public:
|
||||
// Not found.
|
||||
CodeLookupResult() = default;
|
||||
|
||||
// Code object was found.
|
||||
// A Code object was found.
|
||||
explicit CodeLookupResult(Code code) : code_(code) {}
|
||||
|
||||
// Embedded builtin was found.
|
||||
// An embedded builtin was found.
|
||||
explicit CodeLookupResult(CodeDataContainer code_data_container)
|
||||
: code_data_container_(code_data_container) {}
|
||||
|
||||
// Returns true if the lookup was successful.
|
||||
bool IsFound() const { return IsCode() || IsCodeDataContainer(); }
|
||||
|
||||
// Returns true if the lookup found a Code object.
|
||||
bool IsCode() const { return !code_.is_null(); }
|
||||
|
||||
// Returns true if V8_EXTERNAL_CODE_SPACE is enabled and the lookup found
|
||||
// an embedded builtin.
|
||||
bool IsCodeDataContainer() const { return !code_data_container_.is_null(); }
|
||||
|
||||
// Returns the Code object containing the address in question.
|
||||
Code code() const {
|
||||
DCHECK(IsCode());
|
||||
return code_;
|
||||
}
|
||||
|
||||
// Returns the CodeDataContainer object corresponding to an embedded builtin
|
||||
// containing the address in question.
|
||||
// Can be used only when V8_EXTERNAL_CODE_SPACE is enabled.
|
||||
CodeDataContainer code_data_container() const {
|
||||
DCHECK(IsCodeDataContainer());
|
||||
return code_data_container_;
|
||||
@ -930,17 +914,18 @@ class CodeLookupResult {
|
||||
inline MaglevSafepointEntry GetMaglevSafepointEntry(Isolate* isolate,
|
||||
Address pc) const;
|
||||
|
||||
// Helper method, coverts the successful lookup result to AbstractCode object.
|
||||
// Helper method, converts the successful lookup result to an AbstractCode
|
||||
// object.
|
||||
inline AbstractCode ToAbstractCode() const;
|
||||
|
||||
// Helper method, coverts the successful lookup result to Code object.
|
||||
// It's not safe to be used from GC because conversion to Code might perform
|
||||
// a map check.
|
||||
// Helper method, converts the successful lookup result to a Code object.
|
||||
// It's not safe to be used from GC because conversion might perform a map
|
||||
// check.
|
||||
inline Code ToCode() const;
|
||||
|
||||
// Helper method, coverts the successful lookup result to CodeT object.
|
||||
// It's not safe to be used from GC because conversion to CodeT might perform
|
||||
// a map check.
|
||||
// Helper method, converts the successful lookup result to CodeT object.
|
||||
// It's not safe to be used from GC because conversion might perform a map
|
||||
// check.
|
||||
inline CodeT ToCodeT() const;
|
||||
|
||||
bool operator==(const CodeLookupResult& other) const {
|
||||
@ -983,7 +968,6 @@ inline Handle<Code> FromCodeT(Handle<CodeT> code, Isolate* isolate);
|
||||
inline AbstractCode ToAbstractCode(CodeT code);
|
||||
inline Handle<AbstractCode> ToAbstractCode(Handle<CodeT> code,
|
||||
Isolate* isolate);
|
||||
inline CodeDataContainer CodeDataContainerFromCodeT(CodeT code);
|
||||
|
||||
// AbstractCode is a helper wrapper around
|
||||
// {Code|CodeDataContainer|BytecodeArray}. Note that the same abstract code
|
||||
|
Loading…
Reference in New Issue
Block a user