[cleanup] Convert some global enums to enum class
Convert StoreOrigin, TypeOfMode, SaveFPRegsMode and ArgvMode to enum classes with k-prefixed values. Change-Id: Ib6ca3a9995297e8303a7e013b1d829613c0db510 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2885042 Reviewed-by: Maya Lekova <mslekova@chromium.org> Reviewed-by: Mythri Alle <mythria@chromium.org> Reviewed-by: Zhi An Ng <zhin@chromium.org> Commit-Queue: Camillo Bruni <cbruni@chromium.org> Cr-Commit-Position: refs/heads/master@{#74497}
This commit is contained in:
parent
c29395ae51
commit
cc06b8c778
@ -351,7 +351,7 @@ void BaselineAssembler::StoreTaggedFieldWithWriteBarrier(Register target,
|
||||
Register value) {
|
||||
__ str(value, FieldMemOperand(target, offset));
|
||||
__ RecordWriteField(target, offset, value, kLRHasNotBeenSaved,
|
||||
kDontSaveFPRegs);
|
||||
SaveFPRegsMode::kIgnore);
|
||||
}
|
||||
void BaselineAssembler::StoreTaggedFieldNoWriteBarrier(Register target,
|
||||
int offset,
|
||||
|
@ -422,7 +422,7 @@ void BaselineAssembler::StoreTaggedFieldWithWriteBarrier(Register target,
|
||||
Register value) {
|
||||
__ StoreTaggedField(value, FieldMemOperand(target, offset));
|
||||
__ RecordWriteField(target, offset, value, kLRHasNotBeenSaved,
|
||||
kDontSaveFPRegs);
|
||||
SaveFPRegsMode::kIgnore);
|
||||
}
|
||||
void BaselineAssembler::StoreTaggedFieldNoWriteBarrier(Register target,
|
||||
int offset,
|
||||
|
@ -320,7 +320,7 @@ void BaselineAssembler::StoreTaggedFieldWithWriteBarrier(Register target,
|
||||
Register scratch = scratch_scope.AcquireScratch();
|
||||
DCHECK(!AreAliased(scratch, target, value));
|
||||
__ mov(FieldOperand(target, offset), value);
|
||||
__ RecordWriteField(target, offset, value, scratch, kDontSaveFPRegs);
|
||||
__ RecordWriteField(target, offset, value, scratch, SaveFPRegsMode::kIgnore);
|
||||
}
|
||||
void BaselineAssembler::StoreTaggedFieldNoWriteBarrier(Register target,
|
||||
int offset,
|
||||
|
@ -464,7 +464,7 @@ void BaselineAssembler::StoreTaggedFieldWithWriteBarrier(Register target,
|
||||
ScratchRegisterScope temps(this);
|
||||
Register tmp = temps.AcquireScratch();
|
||||
__ RecordWriteField(target, offset, value, tmp, kRAHasNotBeenSaved,
|
||||
kDontSaveFPRegs);
|
||||
SaveFPRegsMode::kIgnore);
|
||||
}
|
||||
void BaselineAssembler::StoreTaggedFieldNoWriteBarrier(Register target,
|
||||
int offset,
|
||||
|
@ -325,7 +325,7 @@ void BaselineAssembler::StoreTaggedFieldWithWriteBarrier(Register target,
|
||||
DCHECK_NE(target, scratch);
|
||||
DCHECK_NE(value, scratch);
|
||||
__ StoreTaggedField(FieldOperand(target, offset), value);
|
||||
__ RecordWriteField(target, offset, value, scratch, kDontSaveFPRegs);
|
||||
__ RecordWriteField(target, offset, value, scratch, SaveFPRegsMode::kIgnore);
|
||||
}
|
||||
void BaselineAssembler::StoreTaggedFieldNoWriteBarrier(Register target,
|
||||
int offset,
|
||||
|
@ -338,7 +338,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
// Store input value into generator object.
|
||||
__ str(r0, FieldMemOperand(r1, JSGeneratorObject::kInputOrDebugPosOffset));
|
||||
__ RecordWriteField(r1, JSGeneratorObject::kInputOrDebugPosOffset, r0,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs);
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset));
|
||||
@ -797,7 +797,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
// Store code entry in the closure.
|
||||
__ str(optimized_code, FieldMemOperand(closure, JSFunction::kCodeOffset));
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, optimized_code,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs,
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore,
|
||||
RememberedSetAction::kOmit, SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -2658,12 +2658,12 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// sp: stack pointer (restored as callee's sp after C call)
|
||||
// cp: current context (C callee-saved)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// r2: pointer to the first argument
|
||||
|
||||
__ mov(r5, Operand(r1));
|
||||
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
// Move argv into the correct register.
|
||||
__ mov(r1, Operand(r2));
|
||||
} else {
|
||||
@ -2675,7 +2675,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// Enter the exit frame that transitions from JavaScript to C++.
|
||||
FrameScope scope(masm, StackFrame::MANUAL);
|
||||
__ EnterExitFrame(
|
||||
save_doubles == kSaveFPRegs, 0,
|
||||
save_doubles == SaveFPRegsMode::kSave, 0,
|
||||
builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
|
||||
|
||||
// Store a copy of argc in callee-saved registers for later.
|
||||
@ -2732,12 +2732,12 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// r0:r1: result
|
||||
// sp: stack pointer
|
||||
// fp: frame pointer
|
||||
Register argc = argv_mode == kArgvInRegister
|
||||
Register argc = argv_mode == ArgvMode::kRegister
|
||||
// We don't want to pop arguments so set argc to no_reg.
|
||||
? no_reg
|
||||
// Callee-saved register r4 still holds argc.
|
||||
: r4;
|
||||
__ LeaveExitFrame(save_doubles == kSaveFPRegs, argc);
|
||||
__ LeaveExitFrame(save_doubles == SaveFPRegsMode::kSave, argc);
|
||||
__ mov(pc, lr);
|
||||
|
||||
// Handling of exception.
|
||||
|
@ -443,7 +443,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
__ StoreTaggedField(
|
||||
x0, FieldMemOperand(x1, JSGeneratorObject::kInputOrDebugPosOffset));
|
||||
__ RecordWriteField(x1, JSGeneratorObject::kInputOrDebugPosOffset, x0,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs);
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ LoadTaggedPointerField(
|
||||
@ -968,7 +968,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
__ StoreTaggedField(optimized_code,
|
||||
FieldMemOperand(closure, JSFunction::kCodeOffset));
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, optimized_code,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs,
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore,
|
||||
RememberedSetAction::kOmit, SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -3063,7 +3063,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// Register parameters:
|
||||
// x0: argc (including receiver, untagged)
|
||||
// x1: target
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// x11: argv (pointer to first argument)
|
||||
//
|
||||
// The stack on entry holds the arguments and the receiver, with the receiver
|
||||
@ -3095,7 +3095,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// (arg[argc-2]), or just below the receiver in case there are no arguments.
|
||||
// - Adjust for the arg[] array.
|
||||
Register temp_argv = x11;
|
||||
if (argv_mode == kArgvOnStack) {
|
||||
if (argv_mode == ArgvMode::kStack) {
|
||||
__ SlotAddress(temp_argv, x0);
|
||||
// - Adjust for the receiver.
|
||||
__ Sub(temp_argv, temp_argv, 1 * kSystemPointerSize);
|
||||
@ -3106,7 +3106,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// Enter the exit frame.
|
||||
FrameScope scope(masm, StackFrame::MANUAL);
|
||||
__ EnterExitFrame(
|
||||
save_doubles == kSaveFPRegs, x10, extra_stack_space,
|
||||
save_doubles == SaveFPRegsMode::kSave, x10, extra_stack_space,
|
||||
builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
|
||||
|
||||
// Poke callee-saved registers into reserved space.
|
||||
@ -3187,8 +3187,8 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
__ Peek(argc, 2 * kSystemPointerSize);
|
||||
__ Peek(target, 3 * kSystemPointerSize);
|
||||
|
||||
__ LeaveExitFrame(save_doubles == kSaveFPRegs, x10, x9);
|
||||
if (argv_mode == kArgvOnStack) {
|
||||
__ LeaveExitFrame(save_doubles == SaveFPRegsMode::kSave, x10, x9);
|
||||
if (argv_mode == ArgvMode::kStack) {
|
||||
// Drop the remaining stack slots and return from the stub.
|
||||
__ DropArguments(x11);
|
||||
}
|
||||
|
@ -169,61 +169,61 @@ void Builtins::Generate_KeyedHasIC_PolymorphicName(
|
||||
|
||||
void Builtins::Generate_LoadGlobalIC(compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLoadGlobalIC(NOT_INSIDE_TYPEOF);
|
||||
assembler.GenerateLoadGlobalIC(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LoadGlobalICInsideTypeof(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLoadGlobalIC(INSIDE_TYPEOF);
|
||||
assembler.GenerateLoadGlobalIC(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LoadGlobalICTrampoline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLoadGlobalICTrampoline(NOT_INSIDE_TYPEOF);
|
||||
assembler.GenerateLoadGlobalICTrampoline(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LoadGlobalICInsideTypeofTrampoline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLoadGlobalICTrampoline(INSIDE_TYPEOF);
|
||||
assembler.GenerateLoadGlobalICTrampoline(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LoadGlobalICBaseline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLoadGlobalICBaseline(NOT_INSIDE_TYPEOF);
|
||||
assembler.GenerateLoadGlobalICBaseline(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LoadGlobalICInsideTypeofBaseline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLoadGlobalICBaseline(INSIDE_TYPEOF);
|
||||
assembler.GenerateLoadGlobalICBaseline(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LookupGlobalICBaseline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLookupGlobalICBaseline(NOT_INSIDE_TYPEOF);
|
||||
assembler.GenerateLookupGlobalICBaseline(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LookupGlobalICInsideTypeofBaseline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLookupGlobalICBaseline(INSIDE_TYPEOF);
|
||||
assembler.GenerateLookupGlobalICBaseline(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LookupContextBaseline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLookupContextBaseline(NOT_INSIDE_TYPEOF);
|
||||
assembler.GenerateLookupContextBaseline(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void Builtins::Generate_LookupContextInsideTypeofBaseline(
|
||||
compiler::CodeAssemblerState* state) {
|
||||
AccessorAssembler assembler(state);
|
||||
assembler.GenerateLookupContextBaseline(INSIDE_TYPEOF);
|
||||
assembler.GenerateLookupContextBaseline(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
TF_BUILTIN(DynamicCheckMaps, CodeStubAssembler) {
|
||||
|
@ -173,7 +173,7 @@ class RecordWriteCodeStubAssembler : public CodeStubAssembler {
|
||||
}
|
||||
|
||||
TNode<BoolT> ShouldSkipFPRegs(TNode<Smi> mode) {
|
||||
return TaggedEqual(mode, SmiConstant(kDontSaveFPRegs));
|
||||
return TaggedEqual(mode, SmiConstant(SaveFPRegsMode::kIgnore));
|
||||
}
|
||||
|
||||
TNode<BoolT> ShouldEmitRememberSet(TNode<Smi> remembered_set) {
|
||||
@ -189,7 +189,7 @@ class RecordWriteCodeStubAssembler : public CodeStubAssembler {
|
||||
BIND(&dont_save_fp);
|
||||
{
|
||||
CallCFunctionWithCallerSavedRegisters(
|
||||
function, MachineTypeOf<Ret>::value, kDontSaveFPRegs,
|
||||
function, MachineTypeOf<Ret>::value, SaveFPRegsMode::kIgnore,
|
||||
std::make_pair(MachineTypeOf<Arg0>::value, arg0),
|
||||
std::make_pair(MachineTypeOf<Arg1>::value, arg1));
|
||||
Goto(next);
|
||||
@ -198,7 +198,7 @@ class RecordWriteCodeStubAssembler : public CodeStubAssembler {
|
||||
BIND(&save_fp);
|
||||
{
|
||||
CallCFunctionWithCallerSavedRegisters(
|
||||
function, MachineTypeOf<Ret>::value, kSaveFPRegs,
|
||||
function, MachineTypeOf<Ret>::value, SaveFPRegsMode::kSave,
|
||||
std::make_pair(MachineTypeOf<Arg0>::value, arg0),
|
||||
std::make_pair(MachineTypeOf<Arg1>::value, arg1));
|
||||
Goto(next);
|
||||
@ -214,7 +214,7 @@ class RecordWriteCodeStubAssembler : public CodeStubAssembler {
|
||||
BIND(&dont_save_fp);
|
||||
{
|
||||
CallCFunctionWithCallerSavedRegisters(
|
||||
function, MachineTypeOf<Ret>::value, kDontSaveFPRegs,
|
||||
function, MachineTypeOf<Ret>::value, SaveFPRegsMode::kIgnore,
|
||||
std::make_pair(MachineTypeOf<Arg0>::value, arg0),
|
||||
std::make_pair(MachineTypeOf<Arg1>::value, arg1),
|
||||
std::make_pair(MachineTypeOf<Arg2>::value, arg2));
|
||||
@ -224,7 +224,7 @@ class RecordWriteCodeStubAssembler : public CodeStubAssembler {
|
||||
BIND(&save_fp);
|
||||
{
|
||||
CallCFunctionWithCallerSavedRegisters(
|
||||
function, MachineTypeOf<Ret>::value, kSaveFPRegs,
|
||||
function, MachineTypeOf<Ret>::value, SaveFPRegsMode::kSave,
|
||||
std::make_pair(MachineTypeOf<Arg0>::value, arg0),
|
||||
std::make_pair(MachineTypeOf<Arg1>::value, arg1),
|
||||
std::make_pair(MachineTypeOf<Arg2>::value, arg2));
|
||||
@ -822,8 +822,9 @@ TF_BUILTIN(AdaptorWithBuiltinExitFrame, CodeStubAssembler) {
|
||||
Int32Constant(BuiltinExitFrameConstants::kNumExtraArgsWithReceiver));
|
||||
|
||||
const bool builtin_exit_frame = true;
|
||||
TNode<Code> code = HeapConstant(CodeFactory::CEntry(
|
||||
isolate(), 1, kDontSaveFPRegs, kArgvOnStack, builtin_exit_frame));
|
||||
TNode<Code> code =
|
||||
HeapConstant(CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame));
|
||||
|
||||
// Unconditionally push argc, target and new target as extra stack arguments.
|
||||
// They will be used by stack frame iterators when constructing stack trace.
|
||||
@ -892,54 +893,54 @@ TF_BUILTIN(AbortCSAAssert, CodeStubAssembler) {
|
||||
|
||||
void Builtins::Generate_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 1, kDontSaveFPRegs, kArgvOnStack, false);
|
||||
Generate_CEntry(masm, 1, SaveFPRegsMode::kIgnore, ArgvMode::kStack, false);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 1, kDontSaveFPRegs, kArgvOnStack, true);
|
||||
Generate_CEntry(masm, 1, SaveFPRegsMode::kIgnore, ArgvMode::kStack, true);
|
||||
}
|
||||
|
||||
void Builtins::
|
||||
Generate_CEntry_Return1_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 1, kDontSaveFPRegs, kArgvInRegister, false);
|
||||
Generate_CEntry(masm, 1, SaveFPRegsMode::kIgnore, ArgvMode::kRegister, false);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return1_SaveFPRegs_ArgvOnStack_NoBuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 1, kSaveFPRegs, kArgvOnStack, false);
|
||||
Generate_CEntry(masm, 1, SaveFPRegsMode::kSave, ArgvMode::kStack, false);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return1_SaveFPRegs_ArgvOnStack_BuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 1, kSaveFPRegs, kArgvOnStack, true);
|
||||
Generate_CEntry(masm, 1, SaveFPRegsMode::kSave, ArgvMode::kStack, true);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return2_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 2, kDontSaveFPRegs, kArgvOnStack, false);
|
||||
Generate_CEntry(masm, 2, SaveFPRegsMode::kIgnore, ArgvMode::kStack, false);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return2_DontSaveFPRegs_ArgvOnStack_BuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 2, kDontSaveFPRegs, kArgvOnStack, true);
|
||||
Generate_CEntry(masm, 2, SaveFPRegsMode::kIgnore, ArgvMode::kStack, true);
|
||||
}
|
||||
|
||||
void Builtins::
|
||||
Generate_CEntry_Return2_DontSaveFPRegs_ArgvInRegister_NoBuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 2, kDontSaveFPRegs, kArgvInRegister, false);
|
||||
Generate_CEntry(masm, 2, SaveFPRegsMode::kIgnore, ArgvMode::kRegister, false);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return2_SaveFPRegs_ArgvOnStack_NoBuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 2, kSaveFPRegs, kArgvOnStack, false);
|
||||
Generate_CEntry(masm, 2, SaveFPRegsMode::kSave, ArgvMode::kStack, false);
|
||||
}
|
||||
|
||||
void Builtins::Generate_CEntry_Return2_SaveFPRegs_ArgvOnStack_BuiltinExit(
|
||||
MacroAssembler* masm) {
|
||||
Generate_CEntry(masm, 2, kSaveFPRegs, kArgvOnStack, true);
|
||||
Generate_CEntry(masm, 2, SaveFPRegsMode::kSave, ArgvMode::kStack, true);
|
||||
}
|
||||
|
||||
#if !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS)
|
||||
|
@ -598,7 +598,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
// Store input value into generator object.
|
||||
__ mov(FieldOperand(edx, JSGeneratorObject::kInputOrDebugPosOffset), eax);
|
||||
__ RecordWriteField(edx, JSGeneratorObject::kInputOrDebugPosOffset, eax, ecx,
|
||||
kDontSaveFPRegs);
|
||||
SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ mov(edi, FieldOperand(edx, JSGeneratorObject::kFunctionOffset));
|
||||
@ -738,7 +738,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
__ mov(FieldOperand(closure, JSFunction::kCodeOffset), optimized_code);
|
||||
__ mov(scratch1, optimized_code); // Write barrier clobbers scratch1 below.
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
|
||||
kDontSaveFPRegs, RememberedSetAction::kOmit,
|
||||
SaveFPRegsMode::kIgnore, RememberedSetAction::kOmit,
|
||||
SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -2915,7 +2915,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// esi: current context (C callee-saved)
|
||||
// edi: JS function of the caller (C callee-saved)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// ecx: pointer to the first argument
|
||||
|
||||
STATIC_ASSERT(eax == kRuntimeCallArgCountRegister);
|
||||
@ -2935,8 +2935,8 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
int arg_stack_space = 3;
|
||||
|
||||
// Enter the exit frame that transitions from JavaScript to C++.
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
DCHECK(save_doubles == kDontSaveFPRegs);
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
DCHECK(save_doubles == SaveFPRegsMode::kIgnore);
|
||||
DCHECK(!builtin_exit_frame);
|
||||
__ EnterApiExitFrame(arg_stack_space, edi);
|
||||
|
||||
@ -2945,7 +2945,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
__ mov(edi, eax);
|
||||
} else {
|
||||
__ EnterExitFrame(
|
||||
arg_stack_space, save_doubles == kSaveFPRegs,
|
||||
arg_stack_space, save_doubles == SaveFPRegsMode::kSave,
|
||||
builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
|
||||
}
|
||||
|
||||
@ -2992,7 +2992,8 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
}
|
||||
|
||||
// Exit the JavaScript to C++ exit frame.
|
||||
__ LeaveExitFrame(save_doubles == kSaveFPRegs, argv_mode == kArgvOnStack);
|
||||
__ LeaveExitFrame(save_doubles == SaveFPRegsMode::kSave,
|
||||
argv_mode == ArgvMode::kStack);
|
||||
__ ret(0);
|
||||
|
||||
// Handling of exception.
|
||||
|
@ -638,7 +638,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
// Store input value into generator object.
|
||||
__ sw(v0, FieldMemOperand(a1, JSGeneratorObject::kInputOrDebugPosOffset));
|
||||
__ RecordWriteField(a1, JSGeneratorObject::kInputOrDebugPosOffset, v0, a3,
|
||||
kRAHasNotBeenSaved, kDontSaveFPRegs);
|
||||
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset));
|
||||
@ -762,7 +762,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
__ sw(optimized_code, FieldMemOperand(closure, JSFunction::kCodeOffset));
|
||||
__ mov(scratch1, optimized_code); // Write barrier clobbers scratch1 below.
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
|
||||
kRAHasNotBeenSaved, kDontSaveFPRegs,
|
||||
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore,
|
||||
RememberedSetAction::kOmit, SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -2383,10 +2383,10 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// sp: stack pointer (restored as callee's sp after C call)
|
||||
// cp: current context (C callee-saved)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// a2: pointer to the first argument
|
||||
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
// Move argv into the correct register.
|
||||
__ mov(s1, a2);
|
||||
} else {
|
||||
@ -2398,7 +2398,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// Enter the exit frame that transitions from JavaScript to C++.
|
||||
FrameScope scope(masm, StackFrame::MANUAL);
|
||||
__ EnterExitFrame(
|
||||
save_doubles == kSaveFPRegs, 0,
|
||||
save_doubles == SaveFPRegsMode::kSave, 0,
|
||||
builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
|
||||
|
||||
// s0: number of arguments including receiver (C callee-saved)
|
||||
@ -2447,12 +2447,12 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// v0:v1: result
|
||||
// sp: stack pointer
|
||||
// fp: frame pointer
|
||||
Register argc = argv_mode == kArgvInRegister
|
||||
Register argc = argv_mode == ArgvMode::kRegister
|
||||
// We don't want to pop arguments so set argc to no_reg.
|
||||
? no_reg
|
||||
// s0: still holds argc (callee-saved).
|
||||
: s0;
|
||||
__ LeaveExitFrame(save_doubles == kSaveFPRegs, argc, EMIT_RETURN);
|
||||
__ LeaveExitFrame(save_doubles == SaveFPRegsMode::kSave, argc, EMIT_RETURN);
|
||||
|
||||
// Handling of exception.
|
||||
__ bind(&exception_returned);
|
||||
|
@ -325,7 +325,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
// Store input value into generator object.
|
||||
__ Sd(v0, FieldMemOperand(a1, JSGeneratorObject::kInputOrDebugPosOffset));
|
||||
__ RecordWriteField(a1, JSGeneratorObject::kInputOrDebugPosOffset, v0, a3,
|
||||
kRAHasNotBeenSaved, kDontSaveFPRegs);
|
||||
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ Ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset));
|
||||
@ -778,7 +778,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
__ Sd(optimized_code, FieldMemOperand(closure, JSFunction::kCodeOffset));
|
||||
__ mov(scratch1, optimized_code); // Write barrier clobbers scratch1 below.
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
|
||||
kRAHasNotBeenSaved, kDontSaveFPRegs,
|
||||
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore,
|
||||
RememberedSetAction::kOmit, SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -2475,10 +2475,10 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// sp: stack pointer (restored as callee's sp after C call)
|
||||
// cp: current context (C callee-saved)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// a2: pointer to the first argument
|
||||
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
// Move argv into the correct register.
|
||||
__ mov(s1, a2);
|
||||
} else {
|
||||
@ -2490,7 +2490,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// Enter the exit frame that transitions from JavaScript to C++.
|
||||
FrameScope scope(masm, StackFrame::MANUAL);
|
||||
__ EnterExitFrame(
|
||||
save_doubles == kSaveFPRegs, 0,
|
||||
save_doubles == SaveFPRegsMode::kSave, 0,
|
||||
builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
|
||||
|
||||
// s0: number of arguments including receiver (C callee-saved)
|
||||
@ -2539,12 +2539,12 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// v0:v1: result
|
||||
// sp: stack pointer
|
||||
// fp: frame pointer
|
||||
Register argc = argv_mode == kArgvInRegister
|
||||
Register argc = argv_mode == ArgvMode::kRegister
|
||||
// We don't want to pop arguments so set argc to no_reg.
|
||||
? no_reg
|
||||
// s0: still holds argc (callee-saved).
|
||||
: s0;
|
||||
__ LeaveExitFrame(save_doubles == kSaveFPRegs, argc, EMIT_RETURN);
|
||||
__ LeaveExitFrame(save_doubles == SaveFPRegsMode::kSave, argc, EMIT_RETURN);
|
||||
|
||||
// Handling of exception.
|
||||
__ bind(&exception_returned);
|
||||
|
@ -348,7 +348,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
__ StoreTaggedField(
|
||||
r3, FieldMemOperand(r4, JSGeneratorObject::kInputOrDebugPosOffset), r0);
|
||||
__ RecordWriteField(r4, JSGeneratorObject::kInputOrDebugPosOffset, r3, r6,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs);
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ LoadTaggedPointerField(
|
||||
@ -798,7 +798,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
FieldMemOperand(closure, JSFunction::kCodeOffset), r0);
|
||||
__ mr(scratch1, optimized_code); // Write barrier clobbers scratch1 below.
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs,
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore,
|
||||
RememberedSetAction::kOmit, SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -2527,12 +2527,12 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// sp: stack pointer (restored as callee's sp after C call)
|
||||
// cp: current context (C callee-saved)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// r5: pointer to the first argument
|
||||
|
||||
__ mr(r15, r4);
|
||||
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
// Move argv into the correct register.
|
||||
__ mr(r4, r5);
|
||||
} else {
|
||||
@ -2617,7 +2617,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// r3:r4: result
|
||||
// sp: stack pointer
|
||||
// fp: frame pointer
|
||||
Register argc = argv_mode == kArgvInRegister
|
||||
Register argc = argv_mode == ArgvMode::kRegister
|
||||
// We don't want to pop arguments so set argc to no_reg.
|
||||
? no_reg
|
||||
// r14: still holds argc (callee-saved).
|
||||
|
@ -330,7 +330,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
// Store input value into generator object.
|
||||
__ Sd(a0, FieldMemOperand(a1, JSGeneratorObject::kInputOrDebugPosOffset));
|
||||
__ RecordWriteField(a1, JSGeneratorObject::kInputOrDebugPosOffset, a0, a3,
|
||||
kRAHasNotBeenSaved, kDontSaveFPRegs);
|
||||
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ Ld(a4, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset));
|
||||
@ -770,7 +770,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
__ Sd(optimized_code, FieldMemOperand(closure, JSFunction::kCodeOffset));
|
||||
__ Move(scratch1, optimized_code); // Write barrier clobbers scratch1 below.
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
|
||||
kRAHasNotBeenSaved, kDontSaveFPRegs,
|
||||
kRAHasNotBeenSaved, SaveFPRegsMode::kIgnore,
|
||||
RememberedSetAction::kOmit, SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -2684,10 +2684,10 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// sp: stack pointer (restored as callee's sp after C call)
|
||||
// cp: current context (C callee-saved)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// a2: pointer to the first argument
|
||||
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
// Move argv into the correct register.
|
||||
__ Move(s1, a2);
|
||||
} else {
|
||||
@ -2699,7 +2699,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// Enter the exit frame that transitions from JavaScript to C++.
|
||||
FrameScope scope(masm, StackFrame::MANUAL);
|
||||
__ EnterExitFrame(
|
||||
save_doubles == kSaveFPRegs, 0,
|
||||
save_doubles == SaveFPRegsMode::kSave, 0,
|
||||
builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
|
||||
|
||||
// s3: number of arguments including receiver (C callee-saved)
|
||||
@ -2748,12 +2748,12 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// a0:a1: result
|
||||
// sp: stack pointer
|
||||
// fp: frame pointer
|
||||
Register argc = argv_mode == kArgvInRegister
|
||||
Register argc = argv_mode == ArgvMode::kRegister
|
||||
// We don't want to pop arguments so set argc to no_reg.
|
||||
? no_reg
|
||||
// s3: still holds argc (callee-saved).
|
||||
: s3;
|
||||
__ LeaveExitFrame(save_doubles == kSaveFPRegs, argc, EMIT_RETURN);
|
||||
__ LeaveExitFrame(save_doubles == SaveFPRegsMode::kSave, argc, EMIT_RETURN);
|
||||
|
||||
// Handling of exception.
|
||||
__ bind(&exception_returned);
|
||||
|
@ -340,7 +340,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
__ StoreTaggedField(
|
||||
r2, FieldMemOperand(r3, JSGeneratorObject::kInputOrDebugPosOffset), r0);
|
||||
__ RecordWriteField(r3, JSGeneratorObject::kInputOrDebugPosOffset, r2, r5,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs);
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Load suspended function and context.
|
||||
__ LoadTaggedPointerField(
|
||||
@ -855,7 +855,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
__ mov(scratch1,
|
||||
optimized_code); // Write barrier clobbers scratch1 below.
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
|
||||
kLRHasNotBeenSaved, kDontSaveFPRegs,
|
||||
kLRHasNotBeenSaved, SaveFPRegsMode::kIgnore,
|
||||
RememberedSetAction::kOmit, SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -2565,12 +2565,12 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// sp: stack pointer (restored as callee's sp after C call)
|
||||
// cp: current context (C callee-saved)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// r4: pointer to the first argument
|
||||
|
||||
__ mov(r7, r3);
|
||||
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
// Move argv into the correct register.
|
||||
__ mov(r3, r4);
|
||||
} else {
|
||||
@ -2661,7 +2661,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// r2:r3: result
|
||||
// sp: stack pointer
|
||||
// fp: frame pointer
|
||||
Register argc = argv_mode == kArgvInRegister
|
||||
Register argc = argv_mode == ArgvMode::kRegister
|
||||
// We don't want to pop arguments so set argc to no_reg.
|
||||
? no_reg
|
||||
// r6: still holds argc (callee-saved).
|
||||
|
@ -689,7 +689,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
|
||||
__ StoreTaggedField(
|
||||
FieldOperand(rdx, JSGeneratorObject::kInputOrDebugPosOffset), rax);
|
||||
__ RecordWriteField(rdx, JSGeneratorObject::kInputOrDebugPosOffset, rax, rcx,
|
||||
kDontSaveFPRegs);
|
||||
SaveFPRegsMode::kIgnore);
|
||||
|
||||
Register decompr_scratch1 = COMPRESS_POINTERS_BOOL ? r11 : no_reg;
|
||||
|
||||
@ -838,7 +838,7 @@ static void ReplaceClosureCodeWithOptimizedCode(MacroAssembler* masm,
|
||||
optimized_code);
|
||||
__ movq(scratch1, optimized_code); // Write barrier clobbers scratch1 below.
|
||||
__ RecordWriteField(closure, JSFunction::kCodeOffset, scratch1, scratch2,
|
||||
kDontSaveFPRegs, RememberedSetAction::kOmit,
|
||||
SaveFPRegsMode::kIgnore, RememberedSetAction::kOmit,
|
||||
SmiCheck::kOmit);
|
||||
}
|
||||
|
||||
@ -3538,7 +3538,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
// rsp: stack pointer (restored after C call)
|
||||
// rsi: current context (restored)
|
||||
//
|
||||
// If argv_mode == kArgvInRegister:
|
||||
// If argv_mode == ArgvMode::kRegister:
|
||||
// r15: pointer to the first argument
|
||||
|
||||
#ifdef V8_TARGET_OS_WIN
|
||||
@ -3569,15 +3569,15 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
int arg_stack_space =
|
||||
kArgExtraStackSpace +
|
||||
(result_size <= kMaxRegisterResultSize ? 0 : result_size);
|
||||
if (argv_mode == kArgvInRegister) {
|
||||
DCHECK(save_doubles == kDontSaveFPRegs);
|
||||
if (argv_mode == ArgvMode::kRegister) {
|
||||
DCHECK(save_doubles == SaveFPRegsMode::kIgnore);
|
||||
DCHECK(!builtin_exit_frame);
|
||||
__ EnterApiExitFrame(arg_stack_space);
|
||||
// Move argc into r12 (argv is already in r15).
|
||||
__ movq(r12, rax);
|
||||
} else {
|
||||
__ EnterExitFrame(
|
||||
arg_stack_space, save_doubles == kSaveFPRegs,
|
||||
arg_stack_space, save_doubles == SaveFPRegsMode::kSave,
|
||||
builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT);
|
||||
}
|
||||
|
||||
@ -3641,7 +3641,8 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size,
|
||||
}
|
||||
|
||||
// Exit the JavaScript to C++ exit frame.
|
||||
__ LeaveExitFrame(save_doubles == kSaveFPRegs, argv_mode == kArgvOnStack);
|
||||
__ LeaveExitFrame(save_doubles == SaveFPRegsMode::kSave,
|
||||
argv_mode == ArgvMode::kStack);
|
||||
__ ret(0);
|
||||
|
||||
// Handling of exception.
|
||||
|
@ -60,7 +60,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
bytes += DwVfpRegister::kNumRegisters * DwVfpRegister::kSizeInBytes;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
SaveFPRegs(sp, lr);
|
||||
bytes += DwVfpRegister::kNumRegisters * DwVfpRegister::kSizeInBytes;
|
||||
}
|
||||
@ -97,7 +97,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
RestoreFPRegs(sp, lr);
|
||||
bytes += DwVfpRegister::kNumRegisters * DwVfpRegister::kSizeInBytes;
|
||||
}
|
||||
@ -1985,8 +1985,8 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
|
||||
DCHECK_EQ(builtin.address() & 1, 1);
|
||||
#endif
|
||||
Move(r1, builtin);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
@ -779,18 +779,18 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
|
||||
// Call a runtime routine.
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
|
||||
int bytes = list.Count() * kXRegSizeInBits / 8;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
DCHECK_EQ(kCallerSavedV.Count() % 2, 0);
|
||||
bytes += kCallerSavedV.Count() * kDRegSizeInBits / 8;
|
||||
}
|
||||
@ -70,7 +70,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode,
|
||||
|
||||
int bytes = list.Count() * kXRegSizeInBits / 8;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
DCHECK_EQ(kCallerSavedV.Count() % 2, 0);
|
||||
PushCPURegList(kCallerSavedV);
|
||||
bytes += kCallerSavedV.Count() * kDRegSizeInBits / 8;
|
||||
@ -80,7 +80,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode,
|
||||
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
DCHECK_EQ(kCallerSavedV.Count() % 2, 0);
|
||||
PopCPURegList(kCallerSavedV);
|
||||
bytes += kCallerSavedV.Count() * kDRegSizeInBits / 8;
|
||||
@ -1600,8 +1600,8 @@ void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
|
||||
bool builtin_exit_frame) {
|
||||
Mov(x1, builtin);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
@ -1847,17 +1847,17 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
// ---- Calling / Jumping helpers ----
|
||||
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
@ -31,25 +31,35 @@ Handle<Code> CodeFactory::CEntry(Isolate* isolate, int result_size,
|
||||
const ArgvMode am = argv_mode;
|
||||
const bool be = builtin_exit_frame;
|
||||
|
||||
if (rs == 1 && sd == kDontSaveFPRegs && am == kArgvOnStack && !be) {
|
||||
if (rs == 1 && sd == SaveFPRegsMode::kIgnore && am == ArgvMode::kStack &&
|
||||
!be) {
|
||||
return CENTRY_CODE(Return1, DontSaveFPRegs, ArgvOnStack, NoBuiltinExit);
|
||||
} else if (rs == 1 && sd == kDontSaveFPRegs && am == kArgvOnStack && be) {
|
||||
} else if (rs == 1 && sd == SaveFPRegsMode::kIgnore &&
|
||||
am == ArgvMode::kStack && be) {
|
||||
return CENTRY_CODE(Return1, DontSaveFPRegs, ArgvOnStack, BuiltinExit);
|
||||
} else if (rs == 1 && sd == kDontSaveFPRegs && am == kArgvInRegister && !be) {
|
||||
} else if (rs == 1 && sd == SaveFPRegsMode::kIgnore &&
|
||||
am == ArgvMode::kRegister && !be) {
|
||||
return CENTRY_CODE(Return1, DontSaveFPRegs, ArgvInRegister, NoBuiltinExit);
|
||||
} else if (rs == 1 && sd == kSaveFPRegs && am == kArgvOnStack && !be) {
|
||||
} else if (rs == 1 && sd == SaveFPRegsMode::kSave && am == ArgvMode::kStack &&
|
||||
!be) {
|
||||
return CENTRY_CODE(Return1, SaveFPRegs, ArgvOnStack, NoBuiltinExit);
|
||||
} else if (rs == 1 && sd == kSaveFPRegs && am == kArgvOnStack && be) {
|
||||
} else if (rs == 1 && sd == SaveFPRegsMode::kSave && am == ArgvMode::kStack &&
|
||||
be) {
|
||||
return CENTRY_CODE(Return1, SaveFPRegs, ArgvOnStack, BuiltinExit);
|
||||
} else if (rs == 2 && sd == kDontSaveFPRegs && am == kArgvOnStack && !be) {
|
||||
} else if (rs == 2 && sd == SaveFPRegsMode::kIgnore &&
|
||||
am == ArgvMode::kStack && !be) {
|
||||
return CENTRY_CODE(Return2, DontSaveFPRegs, ArgvOnStack, NoBuiltinExit);
|
||||
} else if (rs == 2 && sd == kDontSaveFPRegs && am == kArgvOnStack && be) {
|
||||
} else if (rs == 2 && sd == SaveFPRegsMode::kIgnore &&
|
||||
am == ArgvMode::kStack && be) {
|
||||
return CENTRY_CODE(Return2, DontSaveFPRegs, ArgvOnStack, BuiltinExit);
|
||||
} else if (rs == 2 && sd == kDontSaveFPRegs && am == kArgvInRegister && !be) {
|
||||
} else if (rs == 2 && sd == SaveFPRegsMode::kIgnore &&
|
||||
am == ArgvMode::kRegister && !be) {
|
||||
return CENTRY_CODE(Return2, DontSaveFPRegs, ArgvInRegister, NoBuiltinExit);
|
||||
} else if (rs == 2 && sd == kSaveFPRegs && am == kArgvOnStack && !be) {
|
||||
} else if (rs == 2 && sd == SaveFPRegsMode::kSave && am == ArgvMode::kStack &&
|
||||
!be) {
|
||||
return CENTRY_CODE(Return2, SaveFPRegs, ArgvOnStack, NoBuiltinExit);
|
||||
} else if (rs == 2 && sd == kSaveFPRegs && am == kArgvOnStack && be) {
|
||||
} else if (rs == 2 && sd == SaveFPRegsMode::kSave && am == ArgvMode::kStack &&
|
||||
be) {
|
||||
return CENTRY_CODE(Return2, SaveFPRegs, ArgvOnStack, BuiltinExit);
|
||||
}
|
||||
|
||||
@ -70,7 +80,7 @@ Callable CodeFactory::CallApiCallback(Isolate* isolate) {
|
||||
|
||||
// static
|
||||
Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) {
|
||||
return typeof_mode == NOT_INSIDE_TYPEOF
|
||||
return typeof_mode == TypeofMode::kNotInside
|
||||
? Builtins::CallableFor(isolate, Builtins::kLoadGlobalICTrampoline)
|
||||
: Builtins::CallableFor(
|
||||
isolate, Builtins::kLoadGlobalICInsideTypeofTrampoline);
|
||||
@ -79,7 +89,7 @@ Callable CodeFactory::LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode) {
|
||||
// static
|
||||
Callable CodeFactory::LoadGlobalICInOptimizedCode(Isolate* isolate,
|
||||
TypeofMode typeof_mode) {
|
||||
return typeof_mode == NOT_INSIDE_TYPEOF
|
||||
return typeof_mode == TypeofMode::kNotInside
|
||||
? Builtins::CallableFor(isolate, Builtins::kLoadGlobalIC)
|
||||
: Builtins::CallableFor(isolate,
|
||||
Builtins::kLoadGlobalICInsideTypeof);
|
||||
@ -378,8 +388,8 @@ Callable CodeFactory::InterpreterPushArgsThenConstruct(
|
||||
Callable CodeFactory::InterpreterCEntry(Isolate* isolate, int result_size) {
|
||||
// Note: If we ever use fpregs in the interpreter then we will need to
|
||||
// save fpregs too.
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate, result_size, kDontSaveFPRegs,
|
||||
kArgvInRegister);
|
||||
Handle<Code> code = CodeFactory::CEntry(
|
||||
isolate, result_size, SaveFPRegsMode::kIgnore, ArgvMode::kRegister);
|
||||
if (result_size == 1) {
|
||||
return Callable(code, InterpreterCEntry1Descriptor{});
|
||||
} else {
|
||||
|
@ -28,10 +28,10 @@ class V8_EXPORT_PRIVATE CodeFactory final {
|
||||
// is exported here.
|
||||
static Handle<Code> RuntimeCEntry(Isolate* isolate, int result_size = 1);
|
||||
|
||||
static Handle<Code> CEntry(Isolate* isolate, int result_size = 1,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs,
|
||||
ArgvMode argv_mode = kArgvOnStack,
|
||||
bool builtin_exit_frame = false);
|
||||
static Handle<Code> CEntry(
|
||||
Isolate* isolate, int result_size = 1,
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore,
|
||||
ArgvMode argv_mode = ArgvMode::kStack, bool builtin_exit_frame = false);
|
||||
|
||||
// Initial states for ICs.
|
||||
static Callable LoadGlobalIC(Isolate* isolate, TypeofMode typeof_mode);
|
||||
|
@ -294,7 +294,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
}
|
||||
}
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
// Count all XMM registers except XMM0.
|
||||
bytes += kDoubleSize * (XMMRegister::kNumRegisters - 1);
|
||||
}
|
||||
@ -316,7 +316,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
}
|
||||
}
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
// Save all XMM registers except XMM0.
|
||||
int delta = kDoubleSize * (XMMRegister::kNumRegisters - 1);
|
||||
AllocateStackSpace(delta);
|
||||
@ -333,7 +333,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
// Restore all XMM registers except XMM0.
|
||||
int delta = kDoubleSize * (XMMRegister::kNumRegisters - 1);
|
||||
for (int i = XMMRegister::kNumRegisters - 1; i > 0; i--) {
|
||||
@ -1376,8 +1376,8 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
|
||||
bool builtin_exit_frame) {
|
||||
// Set the entry point and jump to the C entry runtime stub.
|
||||
Move(kRuntimeCallFunctionRegister, Immediate(ext));
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
@ -675,18 +675,18 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
|
||||
// Call a runtime routine.
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
RegList list = kJSCallerSaved & ~exclusions;
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
MultiPush(list);
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPushFPU(kCallerSavedFPU);
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
@ -101,7 +101,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPopFPU(kCallerSavedFPU);
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
@ -4695,8 +4695,8 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
|
||||
BranchDelaySlot bd,
|
||||
bool builtin_exit_frame) {
|
||||
PrepareCEntryFunction(builtin);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), bd);
|
||||
}
|
||||
|
||||
|
@ -1052,18 +1052,18 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
|
||||
// Call a runtime routine.
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId id, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(id), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
RegList list = kJSCallerSaved & ~exclusions;
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
MultiPush(list);
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPushFPU(kCallerSavedFPU);
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
@ -101,7 +101,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPopFPU(kCallerSavedFPU);
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
@ -5209,8 +5209,8 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
|
||||
BranchDelaySlot bd,
|
||||
bool builtin_exit_frame) {
|
||||
PrepareCEntryFunction(builtin);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg), bd);
|
||||
}
|
||||
|
||||
|
@ -1107,18 +1107,18 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
|
||||
// Call a runtime routine.
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
RegList list = kJSCallerSaved & ~exclusions;
|
||||
bytes += NumRegs(list) * kSystemPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
bytes += kNumCallerSavedDoubles * kDoubleSize;
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
MultiPush(list);
|
||||
bytes += NumRegs(list) * kSystemPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPushDoubles(kCallerSavedDoubles);
|
||||
bytes += kNumCallerSavedDoubles * kDoubleSize;
|
||||
}
|
||||
@ -92,7 +92,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPopDoubles(kCallerSavedDoubles);
|
||||
bytes += kNumCallerSavedDoubles * kDoubleSize;
|
||||
}
|
||||
@ -1865,8 +1865,8 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
|
||||
bool builtin_exit_frame) {
|
||||
Move(r4, builtin);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
@ -919,22 +919,22 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
|
||||
// Call a runtime routine.
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
void CallRuntimeSaveDoubles(Runtime::FunctionId fid) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, kSaveFPRegs);
|
||||
CallRuntime(function, function->nargs, SaveFPRegsMode::kSave);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
RegList list = kJSCallerSaved & ~exclusions;
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
MultiPush(list);
|
||||
bytes += NumRegs(list) * kPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPushFPU(kCallerSavedFPU);
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
@ -98,7 +98,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPopFPU(kCallerSavedFPU);
|
||||
bytes += NumRegs(kCallerSavedFPU) * kDoubleSize;
|
||||
}
|
||||
@ -3849,8 +3849,8 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
|
||||
bool builtin_exit_frame) {
|
||||
PrepareCEntryFunction(builtin);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET, al, zero_reg, Operand(zero_reg));
|
||||
}
|
||||
|
||||
|
@ -1065,18 +1065,18 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
|
||||
// Call a runtime routine.
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
RegList list = kJSCallerSaved & ~exclusions;
|
||||
bytes += NumRegs(list) * kSystemPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
bytes += NumRegs(kCallerSavedDoubles) * kDoubleSize;
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
MultiPush(list);
|
||||
bytes += NumRegs(list) * kSystemPointerSize;
|
||||
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPushDoubles(kCallerSavedDoubles);
|
||||
bytes += NumRegs(kCallerSavedDoubles) * kDoubleSize;
|
||||
}
|
||||
@ -319,7 +319,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPopDoubles(kCallerSavedDoubles);
|
||||
bytes += NumRegs(kCallerSavedDoubles) * kDoubleSize;
|
||||
}
|
||||
@ -1951,8 +1951,8 @@ void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
|
||||
void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
|
||||
bool builtin_exit_frame) {
|
||||
Move(r3, builtin);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
|
@ -1101,22 +1101,22 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
}
|
||||
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
void CallRuntimeSaveDoubles(Runtime::FunctionId fid) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, kSaveFPRegs);
|
||||
CallRuntime(function, function->nargs, SaveFPRegsMode::kSave);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -655,8 +655,8 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
|
||||
bool builtin_exit_frame) {
|
||||
// Set the entry point and jump to the C entry runtime stub.
|
||||
LoadAddress(rbx, ext);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs,
|
||||
kArgvOnStack, builtin_exit_frame);
|
||||
Handle<Code> code = CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, builtin_exit_frame);
|
||||
Jump(code, RelocInfo::CODE_TARGET);
|
||||
}
|
||||
|
||||
@ -678,7 +678,7 @@ int TurboAssembler::RequiredStackSizeForCallerSaved(SaveFPRegsMode fp_mode,
|
||||
}
|
||||
|
||||
// R12 to r15 are callee save on all platforms.
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
bytes += kDoubleSize * XMMRegister::kNumRegisters;
|
||||
}
|
||||
|
||||
@ -700,7 +700,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
}
|
||||
|
||||
// R12 to r15 are callee save on all platforms.
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
int delta = kDoubleSize * XMMRegister::kNumRegisters;
|
||||
AllocateStackSpace(delta);
|
||||
for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
|
||||
@ -716,7 +716,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
for (int i = 0; i < XMMRegister::kNumRegisters; i++) {
|
||||
XMMRegister reg = XMMRegister::from_code(i);
|
||||
Movsd(reg, Operand(rsp, i * kDoubleSize));
|
||||
|
@ -889,18 +889,18 @@ class V8_EXPORT_PRIVATE MacroAssembler : public TurboAssembler {
|
||||
|
||||
// Call a runtime routine.
|
||||
void CallRuntime(const Runtime::Function* f, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs);
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore);
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
const Runtime::Function* function = Runtime::FunctionForId(fid);
|
||||
CallRuntime(function, function->nargs, save_doubles);
|
||||
}
|
||||
|
||||
// Convenience function: Same as above, but takes the fid instead.
|
||||
void CallRuntime(Runtime::FunctionId fid, int num_arguments,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs) {
|
||||
SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore) {
|
||||
CallRuntime(Runtime::FunctionForId(fid), num_arguments, save_doubles);
|
||||
}
|
||||
|
||||
|
@ -466,11 +466,11 @@ inline LanguageMode stricter_language_mode(LanguageMode mode1,
|
||||
// a keyed store is of the form a[expression] = foo.
|
||||
enum class StoreOrigin { kMaybeKeyed, kNamed };
|
||||
|
||||
enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
|
||||
enum class TypeofMode { kInside, kNotInside };
|
||||
|
||||
// Enums used by CEntry.
|
||||
enum SaveFPRegsMode { kDontSaveFPRegs, kSaveFPRegs };
|
||||
enum ArgvMode { kArgvOnStack, kArgvInRegister };
|
||||
enum class SaveFPRegsMode { kIgnore, kSave };
|
||||
enum class ArgvMode { kStack, kRegister };
|
||||
|
||||
// This constant is used as an undefined value when passing source positions.
|
||||
constexpr int kNoSourcePosition = -1;
|
||||
|
@ -199,8 +199,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (must_save_lr_) {
|
||||
// We need to save and restore lr if the frame was elided.
|
||||
__ Push(lr);
|
||||
@ -825,7 +826,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -838,7 +840,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -290,8 +290,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (must_save_lr_) {
|
||||
// We need to save and restore lr if the frame was elided.
|
||||
__ Push<TurboAssembler::kSignLR>(lr, padreg);
|
||||
@ -856,7 +857,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -869,7 +871,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -327,8 +327,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (mode_ == RecordWriteMode::kValueIsEphemeronKey) {
|
||||
__ CallEphemeronKeyBarrier(object_, scratch1_, save_fp_mode);
|
||||
#if V8_ENABLE_WEBASSEMBLY
|
||||
@ -829,7 +830,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -842,7 +844,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -2935,8 +2935,8 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
|
||||
|
||||
if (call_descriptor->NeedsCallerSavedRegisters()) {
|
||||
SaveFPRegsMode mode = call_descriptor->NeedsCallerSavedFPRegisters()
|
||||
? kSaveFPRegs
|
||||
: kDontSaveFPRegs;
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
Emit(kArchSaveCallerRegisters | MiscField::encode(static_cast<int>(mode)),
|
||||
g.NoOutput());
|
||||
}
|
||||
@ -3015,8 +3015,8 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
|
||||
|
||||
if (call_descriptor->NeedsCallerSavedRegisters()) {
|
||||
SaveFPRegsMode mode = call_descriptor->NeedsCallerSavedFPRegisters()
|
||||
? kSaveFPRegs
|
||||
: kDontSaveFPRegs;
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
Emit(
|
||||
kArchRestoreCallerRegisters | MiscField::encode(static_cast<int>(mode)),
|
||||
g.NoOutput());
|
||||
|
@ -171,8 +171,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (must_save_lr_) {
|
||||
// We need to save and restore ra if the frame was elided.
|
||||
__ Push(ra);
|
||||
@ -373,10 +374,10 @@ void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen,
|
||||
} else { \
|
||||
FrameScope scope(tasm(), StackFrame::MANUAL); \
|
||||
__ Addu(a0, i.InputRegister(0), i.InputRegister(1)); \
|
||||
__ PushCallerSaved(kDontSaveFPRegs, v0, v1); \
|
||||
__ PushCallerSaved(SaveFPRegsMode::kIgnore, v0, v1); \
|
||||
__ PrepareCallCFunction(3, 0, kScratchReg); \
|
||||
__ CallCFunction(ExternalReference::external(), 3, 0); \
|
||||
__ PopCallerSaved(kDontSaveFPRegs, v0, v1); \
|
||||
__ PopCallerSaved(SaveFPRegsMode::kIgnore, v0, v1); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@ -403,10 +404,10 @@ void EmitWordLoadPoisoningIfNeeded(CodeGenerator* codegen,
|
||||
} else { \
|
||||
FrameScope scope(tasm(), StackFrame::MANUAL); \
|
||||
__ Addu(a0, i.InputRegister(0), i.InputRegister(1)); \
|
||||
__ PushCallerSaved(kDontSaveFPRegs, v0, v1); \
|
||||
__ PushCallerSaved(SaveFPRegsMode::kIgnore, v0, v1); \
|
||||
__ PrepareCallCFunction(3, 0, kScratchReg); \
|
||||
__ CallCFunction(ExternalReference::external(), 3, 0); \
|
||||
__ PopCallerSaved(kDontSaveFPRegs, v0, v1); \
|
||||
__ PopCallerSaved(SaveFPRegsMode::kIgnore, v0, v1); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@ -746,7 +747,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -759,7 +761,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
@ -1929,10 +1932,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
} else {
|
||||
FrameScope scope(tasm(), StackFrame::MANUAL);
|
||||
__ Addu(a0, i.InputRegister(0), i.InputRegister(1));
|
||||
__ PushCallerSaved(kDontSaveFPRegs, v0, v1);
|
||||
__ PushCallerSaved(SaveFPRegsMode::kIgnore, v0, v1);
|
||||
__ PrepareCallCFunction(1, 0, kScratchReg);
|
||||
__ CallCFunction(ExternalReference::atomic_pair_load_function(), 1, 0);
|
||||
__ PopCallerSaved(kDontSaveFPRegs, v0, v1);
|
||||
__ PopCallerSaved(SaveFPRegsMode::kIgnore, v0, v1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1952,10 +1955,10 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
} else {
|
||||
FrameScope scope(tasm(), StackFrame::MANUAL);
|
||||
__ Addu(a0, i.InputRegister(0), i.InputRegister(1));
|
||||
__ PushCallerSaved(kDontSaveFPRegs);
|
||||
__ PushCallerSaved(SaveFPRegsMode::kIgnore);
|
||||
__ PrepareCallCFunction(3, 0, kScratchReg);
|
||||
__ CallCFunction(ExternalReference::atomic_pair_store_function(), 3, 0);
|
||||
__ PopCallerSaved(kDontSaveFPRegs);
|
||||
__ PopCallerSaved(SaveFPRegsMode::kIgnore);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1993,12 +1996,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
__ sync();
|
||||
} else {
|
||||
FrameScope scope(tasm(), StackFrame::MANUAL);
|
||||
__ PushCallerSaved(kDontSaveFPRegs, v0, v1);
|
||||
__ PushCallerSaved(SaveFPRegsMode::kIgnore, v0, v1);
|
||||
__ PrepareCallCFunction(3, 0, kScratchReg);
|
||||
__ Addu(a0, i.InputRegister(0), i.InputRegister(1));
|
||||
__ CallCFunction(ExternalReference::atomic_pair_exchange_function(), 3,
|
||||
0);
|
||||
__ PopCallerSaved(kDontSaveFPRegs, v0, v1);
|
||||
__ PopCallerSaved(SaveFPRegsMode::kIgnore, v0, v1);
|
||||
}
|
||||
break;
|
||||
case kMipsWord32AtomicPairCompareExchange: {
|
||||
@ -2023,13 +2026,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
__ sync();
|
||||
} else {
|
||||
FrameScope scope(tasm(), StackFrame::MANUAL);
|
||||
__ PushCallerSaved(kDontSaveFPRegs, v0, v1);
|
||||
__ PushCallerSaved(SaveFPRegsMode::kIgnore, v0, v1);
|
||||
__ PrepareCallCFunction(5, 0, kScratchReg);
|
||||
__ addu(a0, i.InputRegister(0), i.InputRegister(1));
|
||||
__ sw(i.InputRegister(5), MemOperand(sp, 16));
|
||||
__ CallCFunction(
|
||||
ExternalReference::atomic_pair_compare_exchange_function(), 5, 0);
|
||||
__ PopCallerSaved(kDontSaveFPRegs, v0, v1);
|
||||
__ PopCallerSaved(SaveFPRegsMode::kIgnore, v0, v1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1302,7 +1302,7 @@ int MultiPushFPULatency() {
|
||||
|
||||
int PushCallerSavedLatency(SaveFPRegsMode fp_mode) {
|
||||
int latency = MultiPushLatency();
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
latency += MultiPushFPULatency();
|
||||
}
|
||||
return latency;
|
||||
@ -1326,7 +1326,7 @@ int MultiPopLatency() {
|
||||
|
||||
int PopCallerSavedLatency(SaveFPRegsMode fp_mode) {
|
||||
int latency = 0;
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
latency += MultiPopFPULatency();
|
||||
}
|
||||
return latency + MultiPopLatency();
|
||||
|
@ -173,8 +173,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (must_save_lr_) {
|
||||
// We need to save and restore ra if the frame was elided.
|
||||
__ Push(ra);
|
||||
@ -711,7 +712,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -724,7 +726,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -932,7 +932,7 @@ int MultiPushFPULatency() {
|
||||
|
||||
int PushCallerSavedLatency(SaveFPRegsMode fp_mode) {
|
||||
int latency = MultiPushLatency();
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
latency += MultiPushFPULatency();
|
||||
}
|
||||
return latency;
|
||||
@ -956,7 +956,7 @@ int MultiPopFPULatency() {
|
||||
|
||||
int PopCallerSavedLatency(SaveFPRegsMode fp_mode) {
|
||||
int latency = MultiPopLatency();
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
latency += MultiPopFPULatency();
|
||||
}
|
||||
return latency;
|
||||
|
@ -186,8 +186,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (must_save_lr_) {
|
||||
// We need to save and restore lr if the frame was elided.
|
||||
__ mflr(scratch0_);
|
||||
@ -978,7 +979,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -991,7 +993,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -167,8 +167,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (must_save_lr_) {
|
||||
// We need to save and restore ra if the frame was elided.
|
||||
__ Push(ra);
|
||||
@ -681,7 +682,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -694,7 +696,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -813,7 +813,7 @@ int MultiPushFPULatency() {
|
||||
|
||||
int PushCallerSavedLatency(SaveFPRegsMode fp_mode) {
|
||||
int latency = MultiPushLatency();
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
latency += MultiPushFPULatency();
|
||||
}
|
||||
return latency;
|
||||
@ -837,7 +837,7 @@ int MultiPopFPULatency() {
|
||||
|
||||
int PopCallerSavedLatency(SaveFPRegsMode fp_mode) {
|
||||
int latency = MultiPopLatency();
|
||||
if (fp_mode == kSaveFPRegs) {
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
latency += MultiPopFPULatency();
|
||||
}
|
||||
return latency;
|
||||
|
@ -221,8 +221,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
if (must_save_lr_) {
|
||||
// We need to save and restore r14 if the frame was elided.
|
||||
__ Push(r14);
|
||||
@ -1204,7 +1205,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -1217,7 +1219,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -287,8 +287,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
|
||||
RememberedSetAction const remembered_set_action =
|
||||
mode_ > RecordWriteMode::kValueIsMap ? RememberedSetAction::kEmit
|
||||
: RememberedSetAction::kOmit;
|
||||
SaveFPRegsMode const save_fp_mode =
|
||||
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
|
||||
SaveFPRegsMode const save_fp_mode = frame()->DidAllocateDoubleRegisters()
|
||||
? SaveFPRegsMode::kSave
|
||||
: SaveFPRegsMode::kIgnore;
|
||||
|
||||
if (mode_ == RecordWriteMode::kValueIsEphemeronKey) {
|
||||
__ CallEphemeronKeyBarrier(object_, scratch1_, save_fp_mode);
|
||||
@ -1013,7 +1014,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchSaveCallerRegisters: {
|
||||
fp_mode_ =
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode()));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// kReturnRegister0 should have been saved before entering the stub.
|
||||
int bytes = __ PushCallerSaved(fp_mode_, kReturnRegister0);
|
||||
DCHECK(IsAligned(bytes, kSystemPointerSize));
|
||||
@ -1026,7 +1028,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
||||
case kArchRestoreCallerRegisters: {
|
||||
DCHECK(fp_mode_ ==
|
||||
static_cast<SaveFPRegsMode>(MiscField::decode(instr->opcode())));
|
||||
DCHECK(fp_mode_ == kDontSaveFPRegs || fp_mode_ == kSaveFPRegs);
|
||||
DCHECK(fp_mode_ == SaveFPRegsMode::kIgnore ||
|
||||
fp_mode_ == SaveFPRegsMode::kSave);
|
||||
// Don't overwrite the returned value.
|
||||
int bytes = __ PopCallerSaved(fp_mode_, kReturnRegister0);
|
||||
frame_access_state()->IncreaseSPDelta(-(bytes / kSystemPointerSize));
|
||||
|
@ -1669,7 +1669,7 @@ void BytecodeGraphBuilder::VisitLdaGlobal() {
|
||||
MakeRef(broker(), Handle<Name>::cast(GetConstantForIndexOperand(0)));
|
||||
uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1);
|
||||
Node* node =
|
||||
BuildLoadGlobal(name, feedback_slot_index, TypeofMode::NOT_INSIDE_TYPEOF);
|
||||
BuildLoadGlobal(name, feedback_slot_index, TypeofMode::kNotInside);
|
||||
environment()->BindAccumulator(node, Environment::kAttachFrameState);
|
||||
}
|
||||
|
||||
@ -1678,8 +1678,7 @@ void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() {
|
||||
NameRef name =
|
||||
MakeRef(broker(), Handle<Name>::cast(GetConstantForIndexOperand(0)));
|
||||
uint32_t feedback_slot_index = bytecode_iterator().GetIndexOperand(1);
|
||||
Node* node =
|
||||
BuildLoadGlobal(name, feedback_slot_index, TypeofMode::INSIDE_TYPEOF);
|
||||
Node* node = BuildLoadGlobal(name, feedback_slot_index, TypeofMode::kInside);
|
||||
environment()->BindAccumulator(node, Environment::kAttachFrameState);
|
||||
}
|
||||
|
||||
@ -1830,7 +1829,7 @@ void BytecodeGraphBuilder::BuildLdaLookupSlot(TypeofMode typeof_mode) {
|
||||
Node* name =
|
||||
jsgraph()->Constant(ObjectRef(broker(), GetConstantForIndexOperand(0)));
|
||||
const Operator* op =
|
||||
javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF
|
||||
javascript()->CallRuntime(typeof_mode == TypeofMode::kNotInside
|
||||
? Runtime::kLoadLookupSlot
|
||||
: Runtime::kLoadLookupSlotInsideTypeof);
|
||||
Node* value = NewNode(op, name);
|
||||
@ -1838,11 +1837,11 @@ void BytecodeGraphBuilder::BuildLdaLookupSlot(TypeofMode typeof_mode) {
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitLdaLookupSlot() {
|
||||
BuildLdaLookupSlot(TypeofMode::NOT_INSIDE_TYPEOF);
|
||||
BuildLdaLookupSlot(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitLdaLookupSlotInsideTypeof() {
|
||||
BuildLdaLookupSlot(TypeofMode::INSIDE_TYPEOF);
|
||||
BuildLdaLookupSlot(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
BytecodeGraphBuilder::Environment*
|
||||
@ -1984,7 +1983,7 @@ void BytecodeGraphBuilder::BuildLdaLookupContextSlot(TypeofMode typeof_mode) {
|
||||
ObjectRef(broker(), GetConstantForIndexOperand(0)));
|
||||
|
||||
const Operator* op =
|
||||
javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF
|
||||
javascript()->CallRuntime(typeof_mode == TypeofMode::kNotInside
|
||||
? Runtime::kLoadLookupSlot
|
||||
: Runtime::kLoadLookupSlotInsideTypeof);
|
||||
Node* value = NewNode(op, name);
|
||||
@ -2000,11 +1999,11 @@ void BytecodeGraphBuilder::BuildLdaLookupContextSlot(TypeofMode typeof_mode) {
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitLdaLookupContextSlot() {
|
||||
BuildLdaLookupContextSlot(TypeofMode::NOT_INSIDE_TYPEOF);
|
||||
BuildLdaLookupContextSlot(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitLdaLookupContextSlotInsideTypeof() {
|
||||
BuildLdaLookupContextSlot(TypeofMode::INSIDE_TYPEOF);
|
||||
BuildLdaLookupContextSlot(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::BuildLdaLookupGlobalSlot(TypeofMode typeof_mode) {
|
||||
@ -2036,7 +2035,7 @@ void BytecodeGraphBuilder::BuildLdaLookupGlobalSlot(TypeofMode typeof_mode) {
|
||||
MakeRef(broker(), Handle<Name>::cast(GetConstantForIndexOperand(0))));
|
||||
|
||||
const Operator* op =
|
||||
javascript()->CallRuntime(typeof_mode == TypeofMode::NOT_INSIDE_TYPEOF
|
||||
javascript()->CallRuntime(typeof_mode == TypeofMode::kNotInside
|
||||
? Runtime::kLoadLookupSlot
|
||||
: Runtime::kLoadLookupSlotInsideTypeof);
|
||||
Node* value = NewNode(op, name);
|
||||
@ -2052,11 +2051,11 @@ void BytecodeGraphBuilder::BuildLdaLookupGlobalSlot(TypeofMode typeof_mode) {
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitLdaLookupGlobalSlot() {
|
||||
BuildLdaLookupGlobalSlot(TypeofMode::NOT_INSIDE_TYPEOF);
|
||||
BuildLdaLookupGlobalSlot(TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitLdaLookupGlobalSlotInsideTypeof() {
|
||||
BuildLdaLookupGlobalSlot(TypeofMode::INSIDE_TYPEOF);
|
||||
BuildLdaLookupGlobalSlot(TypeofMode::kInside);
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::VisitStaLookupSlot() {
|
||||
|
@ -2669,8 +2669,8 @@ void JSHeapBroker::InitializeAndStartSerializing(
|
||||
if (!data->should_access_heap()) data->AsPropertyCell()->Serialize(this);
|
||||
}
|
||||
GetOrCreateData(f->many_closures_cell());
|
||||
GetOrCreateData(
|
||||
CodeFactory::CEntry(isolate(), 1, kDontSaveFPRegs, kArgvOnStack, true));
|
||||
GetOrCreateData(CodeFactory::CEntry(isolate(), 1, SaveFPRegsMode::kIgnore,
|
||||
ArgvMode::kStack, true));
|
||||
|
||||
TRACE(this, "Finished serializing standard objects");
|
||||
}
|
||||
|
@ -5631,8 +5631,8 @@ Reduction JSCallReducer::ReduceArrayPrototypeShift(Node* node) {
|
||||
graph()->zone(), 1, BuiltinArguments::kNumExtraArgsWithReceiver,
|
||||
Builtins::name(builtin_index), node->op()->properties(),
|
||||
CallDescriptor::kNeedsFrameState);
|
||||
Node* stub_code = jsgraph()->CEntryStubConstant(1, kDontSaveFPRegs,
|
||||
kArgvOnStack, true);
|
||||
Node* stub_code = jsgraph()->CEntryStubConstant(
|
||||
1, SaveFPRegsMode::kIgnore, ArgvMode::kStack, true);
|
||||
Address builtin_entry = Builtins::CppEntryOf(builtin_index);
|
||||
Node* entry = jsgraph()->ExternalConstant(
|
||||
ExternalReference::Create(builtin_entry));
|
||||
|
@ -20,7 +20,8 @@ namespace compiler {
|
||||
|
||||
Node* JSGraph::CEntryStubConstant(int result_size, SaveFPRegsMode save_doubles,
|
||||
ArgvMode argv_mode, bool builtin_exit_frame) {
|
||||
if (save_doubles == kDontSaveFPRegs && argv_mode == kArgvOnStack) {
|
||||
if (save_doubles == SaveFPRegsMode::kIgnore &&
|
||||
argv_mode == ArgvMode::kStack) {
|
||||
DCHECK(result_size >= 1 && result_size <= 3);
|
||||
if (!builtin_exit_frame) {
|
||||
Node** ptr = nullptr;
|
||||
|
@ -38,10 +38,9 @@ class V8_EXPORT_PRIVATE JSGraph : public MachineGraph {
|
||||
JSGraph& operator=(const JSGraph&) = delete;
|
||||
|
||||
// CEntryStubs are cached depending on the result size and other flags.
|
||||
Node* CEntryStubConstant(int result_size,
|
||||
SaveFPRegsMode save_doubles = kDontSaveFPRegs,
|
||||
ArgvMode argv_mode = kArgvOnStack,
|
||||
bool builtin_exit_frame = false);
|
||||
Node* CEntryStubConstant(
|
||||
int result_size, SaveFPRegsMode save_doubles = SaveFPRegsMode::kIgnore,
|
||||
ArgvMode argv_mode = ArgvMode::kStack, bool builtin_exit_frame = false);
|
||||
|
||||
// Used for padding frames. (alias: the hole)
|
||||
Node* PaddingConstant() { return TheHoleConstant(); }
|
||||
|
@ -339,12 +339,13 @@ bool operator!=(LoadGlobalParameters const& lhs,
|
||||
|
||||
|
||||
size_t hash_value(LoadGlobalParameters const& p) {
|
||||
return base::hash_combine(p.name().location(), p.typeof_mode());
|
||||
return base::hash_combine(p.name().location(),
|
||||
static_cast<int>(p.typeof_mode()));
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, LoadGlobalParameters const& p) {
|
||||
return os << Brief(*p.name()) << ", " << p.typeof_mode();
|
||||
return os << Brief(*p.name()) << ", " << static_cast<int>(p.typeof_mode());
|
||||
}
|
||||
|
||||
|
||||
|
@ -1002,7 +1002,7 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
|
||||
|
||||
const Operator* LoadGlobal(const Handle<Name>& name,
|
||||
const FeedbackSource& feedback,
|
||||
TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
|
||||
TypeofMode typeof_mode = TypeofMode::kNotInside);
|
||||
const Operator* StoreGlobal(LanguageMode language_mode,
|
||||
const Handle<Name>& name,
|
||||
const FeedbackSource& feedback);
|
||||
|
@ -1542,8 +1542,8 @@ void ReduceBuiltin(JSGraph* jsgraph, Node* node, int builtin_index, int arity,
|
||||
DCHECK(Builtins::IsCpp(builtin_index));
|
||||
const bool has_builtin_exit_frame = true;
|
||||
|
||||
Node* stub = jsgraph->CEntryStubConstant(1, kDontSaveFPRegs, kArgvOnStack,
|
||||
has_builtin_exit_frame);
|
||||
Node* stub = jsgraph->CEntryStubConstant(
|
||||
1, SaveFPRegsMode::kIgnore, ArgvMode::kStack, has_builtin_exit_frame);
|
||||
node->ReplaceInput(0, stub);
|
||||
|
||||
const int argc = arity + BuiltinArguments::kNumExtraArgsWithReceiver;
|
||||
|
@ -747,7 +747,8 @@ Node* CallCFunctionImpl(
|
||||
}
|
||||
for (const auto& arg : args) builder.AddParam(arg.first);
|
||||
|
||||
bool caller_saved_fp_regs = caller_saved_regs && (mode == kSaveFPRegs);
|
||||
bool caller_saved_fp_regs =
|
||||
caller_saved_regs && (mode == SaveFPRegsMode::kSave);
|
||||
CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
|
||||
if (caller_saved_regs) flags |= CallDescriptor::kCallerSavedRegisters;
|
||||
if (caller_saved_fp_regs) flags |= CallDescriptor::kCallerSavedFPRegisters;
|
||||
@ -772,14 +773,14 @@ Node* RawMachineAssembler::CallCFunction(
|
||||
Node* function, base::Optional<MachineType> return_type,
|
||||
std::initializer_list<RawMachineAssembler::CFunctionArg> args) {
|
||||
return CallCFunctionImpl(this, function, return_type, args, false,
|
||||
kDontSaveFPRegs, kHasFunctionDescriptor);
|
||||
SaveFPRegsMode::kIgnore, kHasFunctionDescriptor);
|
||||
}
|
||||
|
||||
Node* RawMachineAssembler::CallCFunctionWithoutFunctionDescriptor(
|
||||
Node* function, MachineType return_type,
|
||||
std::initializer_list<RawMachineAssembler::CFunctionArg> args) {
|
||||
return CallCFunctionImpl(this, function, return_type, args, false,
|
||||
kDontSaveFPRegs, kNoFunctionDescriptor);
|
||||
SaveFPRegsMode::kIgnore, kNoFunctionDescriptor);
|
||||
}
|
||||
|
||||
Node* RawMachineAssembler::CallCFunctionWithCallerSavedRegisters(
|
||||
|
@ -3077,7 +3077,7 @@ void AccessorAssembler::LoadGlobalIC(TNode<HeapObject> maybe_feedback_vector,
|
||||
BIND(&no_feedback);
|
||||
{
|
||||
int ic_kind =
|
||||
static_cast<int>((typeof_mode == INSIDE_TYPEOF)
|
||||
static_cast<int>((typeof_mode == TypeofMode::kInside)
|
||||
? FeedbackSlotKind::kLoadGlobalInsideTypeof
|
||||
: FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
|
||||
exit_point->ReturnCallStub(
|
||||
@ -3136,7 +3136,7 @@ void AccessorAssembler::LoadGlobalIC_TryHandlerCase(
|
||||
TNode<Object> handler = CAST(feedback_element);
|
||||
GotoIf(TaggedEqual(handler, UninitializedSymbolConstant()), miss);
|
||||
|
||||
OnNonExistent on_nonexistent = typeof_mode == NOT_INSIDE_TYPEOF
|
||||
OnNonExistent on_nonexistent = typeof_mode == TypeofMode::kNotInside
|
||||
? OnNonExistent::kThrowReferenceError
|
||||
: OnNonExistent::kReturnUndefined;
|
||||
|
||||
@ -4071,7 +4071,7 @@ void AccessorAssembler::GenerateLookupContextBaseline(TypeofMode typeof_mode) {
|
||||
BIND(&slowpath);
|
||||
{
|
||||
auto name = Parameter<Object>(Descriptor::kName);
|
||||
Runtime::FunctionId function_id = typeof_mode == INSIDE_TYPEOF
|
||||
Runtime::FunctionId function_id = typeof_mode == TypeofMode::kInside
|
||||
? Runtime::kLoadLookupSlotInsideTypeof
|
||||
: Runtime::kLoadLookupSlot;
|
||||
TailCallRuntime(function_id, context, name);
|
||||
@ -4103,7 +4103,7 @@ void AccessorAssembler::GenerateLookupGlobalICBaseline(TypeofMode typeof_mode) {
|
||||
|
||||
// Slow path when we have to call out to the runtime
|
||||
BIND(&slowpath);
|
||||
Runtime::FunctionId function_id = typeof_mode == INSIDE_TYPEOF
|
||||
Runtime::FunctionId function_id = typeof_mode == TypeofMode::kInside
|
||||
? Runtime::kLoadLookupSlotInsideTypeof
|
||||
: Runtime::kLoadLookupSlot;
|
||||
TailCallRuntime(function_id, context, name);
|
||||
|
@ -2474,7 +2474,7 @@ RUNTIME_FUNCTION(Runtime_LoadGlobalIC_Miss) {
|
||||
vector = Handle<FeedbackVector>::cast(maybe_vector);
|
||||
}
|
||||
|
||||
FeedbackSlotKind kind = (typeof_mode == TypeofMode::INSIDE_TYPEOF)
|
||||
FeedbackSlotKind kind = (typeof_mode == TypeofMode::kInside)
|
||||
? FeedbackSlotKind::kLoadGlobalInsideTypeof
|
||||
: FeedbackSlotKind::kLoadGlobalNotInsideTypeof;
|
||||
LoadGlobalIC ic(isolate, vector, vector_slot, kind);
|
||||
|
@ -725,11 +725,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(const AstRawString* name,
|
||||
DCHECK_EQ(GetTypeofModeFromSlotKind(feedback_vector_spec()->GetKind(
|
||||
FeedbackVector::ToSlot(feedback_slot))),
|
||||
typeof_mode);
|
||||
if (typeof_mode == INSIDE_TYPEOF) {
|
||||
OutputLdaGlobalInsideTypeof(name_index, feedback_slot);
|
||||
} else {
|
||||
DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF);
|
||||
OutputLdaGlobal(name_index, feedback_slot);
|
||||
switch (typeof_mode) {
|
||||
case TypeofMode::kInside:
|
||||
OutputLdaGlobalInsideTypeof(name_index, feedback_slot);
|
||||
break;
|
||||
case TypeofMode::kNotInside:
|
||||
OutputLdaGlobal(name_index, feedback_slot);
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@ -774,11 +776,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreContextSlot(Register context,
|
||||
BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot(
|
||||
const AstRawString* name, TypeofMode typeof_mode) {
|
||||
size_t name_index = GetConstantPoolEntry(name);
|
||||
if (typeof_mode == INSIDE_TYPEOF) {
|
||||
OutputLdaLookupSlotInsideTypeof(name_index);
|
||||
} else {
|
||||
DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF);
|
||||
OutputLdaLookupSlot(name_index);
|
||||
switch (typeof_mode) {
|
||||
case TypeofMode::kInside:
|
||||
OutputLdaLookupSlotInsideTypeof(name_index);
|
||||
break;
|
||||
case TypeofMode::kNotInside:
|
||||
OutputLdaLookupSlot(name_index);
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@ -787,11 +791,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupContextSlot(
|
||||
const AstRawString* name, TypeofMode typeof_mode, int slot_index,
|
||||
int depth) {
|
||||
size_t name_index = GetConstantPoolEntry(name);
|
||||
if (typeof_mode == INSIDE_TYPEOF) {
|
||||
OutputLdaLookupContextSlotInsideTypeof(name_index, slot_index, depth);
|
||||
} else {
|
||||
DCHECK(typeof_mode == NOT_INSIDE_TYPEOF);
|
||||
OutputLdaLookupContextSlot(name_index, slot_index, depth);
|
||||
switch (typeof_mode) {
|
||||
case TypeofMode::kInside:
|
||||
OutputLdaLookupContextSlotInsideTypeof(name_index, slot_index, depth);
|
||||
break;
|
||||
case TypeofMode::kNotInside:
|
||||
OutputLdaLookupContextSlot(name_index, slot_index, depth);
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@ -800,11 +806,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupGlobalSlot(
|
||||
const AstRawString* name, TypeofMode typeof_mode, int feedback_slot,
|
||||
int depth) {
|
||||
size_t name_index = GetConstantPoolEntry(name);
|
||||
if (typeof_mode == INSIDE_TYPEOF) {
|
||||
OutputLdaLookupGlobalSlotInsideTypeof(name_index, feedback_slot, depth);
|
||||
} else {
|
||||
DCHECK(typeof_mode == NOT_INSIDE_TYPEOF);
|
||||
OutputLdaLookupGlobalSlot(name_index, feedback_slot, depth);
|
||||
switch (typeof_mode) {
|
||||
case TypeofMode::kInside:
|
||||
OutputLdaLookupGlobalSlotInsideTypeof(name_index, feedback_slot, depth);
|
||||
break;
|
||||
case TypeofMode::kNotInside:
|
||||
OutputLdaLookupGlobalSlot(name_index, feedback_slot, depth);
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
@ -5420,7 +5420,7 @@ void BytecodeGenerator::VisitForTypeOfValue(Expression* expr) {
|
||||
// perform a non-contextual load in case the operand is a variable proxy.
|
||||
VariableProxy* proxy = expr->AsVariableProxy();
|
||||
BuildVariableLoadForAccumulatorValue(proxy->var(), proxy->hole_check_mode(),
|
||||
INSIDE_TYPEOF);
|
||||
TypeofMode::kInside);
|
||||
} else {
|
||||
VisitForAccumulatorValue(expr);
|
||||
}
|
||||
@ -6850,7 +6850,7 @@ int BytecodeGenerator::feedback_index(FeedbackSlot slot) const {
|
||||
FeedbackSlot BytecodeGenerator::GetCachedLoadGlobalICSlot(
|
||||
TypeofMode typeof_mode, Variable* variable) {
|
||||
FeedbackSlotCache::SlotKind slot_kind =
|
||||
typeof_mode == INSIDE_TYPEOF
|
||||
typeof_mode == TypeofMode::kInside
|
||||
? FeedbackSlotCache::SlotKind::kLoadGlobalInsideTypeof
|
||||
: FeedbackSlotCache::SlotKind::kLoadGlobalNotInsideTypeof;
|
||||
FeedbackSlot slot(feedback_slot_cache()->Get(slot_kind, variable));
|
||||
|
@ -243,10 +243,10 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> {
|
||||
const AstRawString* name);
|
||||
|
||||
void BuildVariableLoad(Variable* variable, HoleCheckMode hole_check_mode,
|
||||
TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
|
||||
TypeofMode typeof_mode = TypeofMode::kNotInside);
|
||||
void BuildVariableLoadForAccumulatorValue(
|
||||
Variable* variable, HoleCheckMode hole_check_mode,
|
||||
TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
|
||||
TypeofMode typeof_mode = TypeofMode::kNotInside);
|
||||
void BuildVariableAssignment(
|
||||
Variable* variable, Token::Value op, HoleCheckMode hole_check_mode,
|
||||
LookupHoistingMode lookup_hoisting_mode = LookupHoistingMode::kNormal);
|
||||
|
@ -209,7 +209,7 @@ IGNITION_HANDLER(LdaGlobal, InterpreterLoadGlobalAssembler) {
|
||||
static const int kNameOperandIndex = 0;
|
||||
static const int kSlotOperandIndex = 1;
|
||||
|
||||
LdaGlobal(kSlotOperandIndex, kNameOperandIndex, NOT_INSIDE_TYPEOF);
|
||||
LdaGlobal(kSlotOperandIndex, kNameOperandIndex, TypeofMode::kNotInside);
|
||||
}
|
||||
|
||||
// LdaGlobalInsideTypeof <name_index> <slot>
|
||||
@ -220,7 +220,7 @@ IGNITION_HANDLER(LdaGlobalInsideTypeof, InterpreterLoadGlobalAssembler) {
|
||||
static const int kNameOperandIndex = 0;
|
||||
static const int kSlotOperandIndex = 1;
|
||||
|
||||
LdaGlobal(kSlotOperandIndex, kNameOperandIndex, INSIDE_TYPEOF);
|
||||
LdaGlobal(kSlotOperandIndex, kNameOperandIndex, TypeofMode::kInside);
|
||||
}
|
||||
|
||||
// StaGlobal <name_index> <slot>
|
||||
@ -418,8 +418,8 @@ class InterpreterLookupGlobalAssembler : public InterpreterLoadGlobalAssembler {
|
||||
|
||||
TypeofMode typeof_mode =
|
||||
function_id == Runtime::kLoadLookupSlotInsideTypeof
|
||||
? INSIDE_TYPEOF
|
||||
: NOT_INSIDE_TYPEOF;
|
||||
? TypeofMode::kInside
|
||||
: TypeofMode::kNotInside;
|
||||
|
||||
LdaGlobal(kSlotOperandIndex, kNameOperandIndex, typeof_mode);
|
||||
}
|
||||
|
@ -130,8 +130,8 @@ inline bool IsCloneObjectKind(FeedbackSlotKind kind) {
|
||||
inline TypeofMode GetTypeofModeFromSlotKind(FeedbackSlotKind kind) {
|
||||
DCHECK(IsLoadGlobalICKind(kind));
|
||||
return (kind == FeedbackSlotKind::kLoadGlobalInsideTypeof)
|
||||
? INSIDE_TYPEOF
|
||||
: NOT_INSIDE_TYPEOF;
|
||||
? TypeofMode::kInside
|
||||
: TypeofMode::kNotInside;
|
||||
}
|
||||
|
||||
inline LanguageMode GetLanguageModeFromSlotKind(FeedbackSlotKind kind) {
|
||||
@ -392,7 +392,7 @@ class V8_EXPORT_PRIVATE FeedbackVectorSpec {
|
||||
}
|
||||
|
||||
FeedbackSlot AddLoadGlobalICSlot(TypeofMode typeof_mode) {
|
||||
return AddSlot(typeof_mode == INSIDE_TYPEOF
|
||||
return AddSlot(typeof_mode == TypeofMode::kInside
|
||||
? FeedbackSlotKind::kLoadGlobalInsideTypeof
|
||||
: FeedbackSlotKind::kLoadGlobalNotInsideTypeof);
|
||||
}
|
||||
|
@ -760,7 +760,7 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
CallRecordWriteStub(dst_addr,
|
||||
actual_offset_reg == no_reg ? Operand(offset_imm)
|
||||
: Operand(actual_offset_reg),
|
||||
RememberedSetAction::kEmit, kSaveFPRegs,
|
||||
RememberedSetAction::kEmit, SaveFPRegsMode::kSave,
|
||||
wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
@ -481,11 +481,12 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
}
|
||||
CheckPageFlag(src.gp(), MemoryChunk::kPointersToHereAreInterestingMask, ne,
|
||||
&exit);
|
||||
CallRecordWriteStub(
|
||||
dst_addr,
|
||||
dst_op.IsRegisterOffset() ? Operand(dst_op.regoffset().X())
|
||||
: Operand(dst_op.offset()),
|
||||
RememberedSetAction::kEmit, kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
CallRecordWriteStub(dst_addr,
|
||||
dst_op.IsRegisterOffset()
|
||||
? Operand(dst_op.regoffset().X())
|
||||
: Operand(dst_op.offset()),
|
||||
RememberedSetAction::kEmit, SaveFPRegsMode::kSave,
|
||||
wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
|
@ -383,7 +383,7 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
Label::kNear);
|
||||
lea(scratch, dst_op);
|
||||
CallRecordWriteStub(dst_addr, scratch, RememberedSetAction::kEmit,
|
||||
kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
SaveFPRegsMode::kSave, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
|
@ -486,7 +486,7 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
MemoryChunk::kPointersToHereAreInterestingMask, eq, &exit);
|
||||
Addu(scratch, dst_op.rm(), dst_op.offset());
|
||||
CallRecordWriteStub(dst_addr, scratch, RememberedSetAction::kEmit,
|
||||
kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
SaveFPRegsMode::kSave, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
&exit);
|
||||
Daddu(scratch, dst_op.rm(), dst_op.offset());
|
||||
CallRecordWriteStub(dst_addr, scratch, RememberedSetAction::kEmit,
|
||||
kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
SaveFPRegsMode::kSave, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
MemoryChunk::kPointersToHereAreInterestingMask, eq, &exit);
|
||||
Add64(scratch, dst_op.rm(), dst_op.offset());
|
||||
CallRecordWriteStub(dst_addr, scratch, RememberedSetAction::kEmit,
|
||||
kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
SaveFPRegsMode::kSave, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
|
@ -271,8 +271,8 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
CheckPageFlag(src.gp(), r1, MemoryChunk::kPointersToHereAreInterestingMask,
|
||||
eq, &exit);
|
||||
lay(r1, dst_op);
|
||||
CallRecordWriteStub(dst_addr, r1, RememberedSetAction::kEmit, kSaveFPRegs,
|
||||
wasm::WasmCode::kRecordWrite);
|
||||
CallRecordWriteStub(dst_addr, r1, RememberedSetAction::kEmit,
|
||||
SaveFPRegsMode::kSave, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
|
@ -382,7 +382,7 @@ void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
|
||||
Label::kNear);
|
||||
leaq(scratch, dst_op);
|
||||
CallRecordWriteStub(dst_addr, scratch, RememberedSetAction::kEmit,
|
||||
kSaveFPRegs, wasm::WasmCode::kRecordWrite);
|
||||
SaveFPRegsMode::kSave, wasm::WasmCode::kRecordWrite);
|
||||
bind(&exit);
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ TEST(CallCFunctionWithCallerSavedRegisters) {
|
||||
|
||||
TNode<IntPtrT> const result =
|
||||
m.UncheckedCast<IntPtrT>(m.CallCFunctionWithCallerSavedRegisters(
|
||||
fun_constant, type_intptr, kSaveFPRegs,
|
||||
fun_constant, type_intptr, SaveFPRegsMode::kSave,
|
||||
std::make_pair(type_intptr, m.IntPtrConstant(0)),
|
||||
std::make_pair(type_intptr, m.IntPtrConstant(1)),
|
||||
std::make_pair(type_intptr, m.IntPtrConstant(2))));
|
||||
@ -3958,7 +3958,7 @@ TEST(InstructionSchedulingCallerSavedRegisters) {
|
||||
m.CallCFunctionWithCallerSavedRegisters(
|
||||
m.ExternalConstant(
|
||||
ExternalReference::smi_lexicographic_compare_function()),
|
||||
MachineType::Int32(), kSaveFPRegs,
|
||||
MachineType::Int32(), SaveFPRegsMode::kSave,
|
||||
std::make_pair(MachineType::Pointer(), isolate_ptr),
|
||||
std::make_pair(MachineType::TaggedSigned(), m.SmiConstant(0)),
|
||||
std::make_pair(MachineType::TaggedSigned(), m.SmiConstant(0)));
|
||||
|
@ -21,7 +21,7 @@ template <typename T>
|
||||
class Handle;
|
||||
class HeapObject;
|
||||
class Type;
|
||||
enum TypeofMode : int;
|
||||
enum class TypeofMode;
|
||||
|
||||
namespace compiler {
|
||||
|
||||
|
@ -95,9 +95,9 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
|
||||
builder.MoveRegister(reg, wide);
|
||||
|
||||
FeedbackSlot load_global_slot =
|
||||
feedback_spec.AddLoadGlobalICSlot(NOT_INSIDE_TYPEOF);
|
||||
feedback_spec.AddLoadGlobalICSlot(TypeofMode::kNotInside);
|
||||
FeedbackSlot load_global_typeof_slot =
|
||||
feedback_spec.AddLoadGlobalICSlot(INSIDE_TYPEOF);
|
||||
feedback_spec.AddLoadGlobalICSlot(TypeofMode::kInside);
|
||||
FeedbackSlot sloppy_store_global_slot =
|
||||
feedback_spec.AddStoreGlobalICSlot(LanguageMode::kSloppy);
|
||||
FeedbackSlot load_slot = feedback_spec.AddLoadICSlot();
|
||||
@ -117,10 +117,8 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
|
||||
|
||||
// Emit global load / store operations.
|
||||
const AstRawString* name = ast_factory.GetOneByteString("var_name");
|
||||
builder
|
||||
.LoadGlobal(name, load_global_slot.ToInt(), TypeofMode::NOT_INSIDE_TYPEOF)
|
||||
.LoadGlobal(name, load_global_typeof_slot.ToInt(),
|
||||
TypeofMode::INSIDE_TYPEOF)
|
||||
builder.LoadGlobal(name, load_global_slot.ToInt(), TypeofMode::kNotInside)
|
||||
.LoadGlobal(name, load_global_typeof_slot.ToInt(), TypeofMode::kInside)
|
||||
.StoreGlobal(name, sloppy_store_global_slot.ToInt());
|
||||
|
||||
// Emit context operations.
|
||||
@ -162,8 +160,8 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
|
||||
builder.GetIterator(reg, load_slot.ToInt(), call_slot.ToInt());
|
||||
|
||||
// Emit load / store lookup slots.
|
||||
builder.LoadLookupSlot(name, TypeofMode::NOT_INSIDE_TYPEOF)
|
||||
.LoadLookupSlot(name, TypeofMode::INSIDE_TYPEOF)
|
||||
builder.LoadLookupSlot(name, TypeofMode::kNotInside)
|
||||
.LoadLookupSlot(name, TypeofMode::kInside)
|
||||
.StoreLookupSlot(name, LanguageMode::kSloppy, LookupHoistingMode::kNormal)
|
||||
.StoreLookupSlot(name, LanguageMode::kSloppy,
|
||||
LookupHoistingMode::kLegacySloppy)
|
||||
@ -171,12 +169,12 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
|
||||
LookupHoistingMode::kNormal);
|
||||
|
||||
// Emit load / store lookup slots with context fast paths.
|
||||
builder.LoadLookupContextSlot(name, TypeofMode::NOT_INSIDE_TYPEOF, 1, 0)
|
||||
.LoadLookupContextSlot(name, TypeofMode::INSIDE_TYPEOF, 1, 0);
|
||||
builder.LoadLookupContextSlot(name, TypeofMode::kNotInside, 1, 0)
|
||||
.LoadLookupContextSlot(name, TypeofMode::kInside, 1, 0);
|
||||
|
||||
// Emit load / store lookup slots with global fast paths.
|
||||
builder.LoadLookupGlobalSlot(name, TypeofMode::NOT_INSIDE_TYPEOF, 1, 0)
|
||||
.LoadLookupGlobalSlot(name, TypeofMode::INSIDE_TYPEOF, 1, 0);
|
||||
builder.LoadLookupGlobalSlot(name, TypeofMode::kNotInside, 1, 0)
|
||||
.LoadLookupGlobalSlot(name, TypeofMode::kInside, 1, 0);
|
||||
|
||||
// Emit closure operations.
|
||||
builder.CreateClosure(0, 1, static_cast<int>(AllocationType::kYoung));
|
||||
@ -380,8 +378,8 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
|
||||
.StoreContextSlot(reg, 1024, 0);
|
||||
|
||||
// Emit wide load / store lookup slots.
|
||||
builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF)
|
||||
.LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF)
|
||||
builder.LoadLookupSlot(wide_name, TypeofMode::kNotInside)
|
||||
.LoadLookupSlot(wide_name, TypeofMode::kInside)
|
||||
.StoreLookupSlot(wide_name, LanguageMode::kSloppy,
|
||||
LookupHoistingMode::kNormal)
|
||||
.StoreLookupSlot(wide_name, LanguageMode::kSloppy,
|
||||
|
@ -44,7 +44,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
|
||||
uint32_t load_feedback_slot = feedback_spec.AddLoadICSlot().ToInt();
|
||||
uint32_t forin_feedback_slot = feedback_spec.AddForInSlot().ToInt();
|
||||
uint32_t load_global_feedback_slot =
|
||||
feedback_spec.AddLoadGlobalICSlot(TypeofMode::NOT_INSIDE_TYPEOF).ToInt();
|
||||
feedback_spec.AddLoadGlobalICSlot(TypeofMode::kNotInside).ToInt();
|
||||
|
||||
builder.LoadLiteral(heap_num_0)
|
||||
.StoreAccumulatorInRegister(reg_0)
|
||||
@ -66,8 +66,7 @@ TEST_F(BytecodeArrayIteratorTest, IteratesBytecodeArray) {
|
||||
.ForInPrepare(triple, forin_feedback_slot)
|
||||
.CallRuntime(Runtime::kLoadIC_Miss, reg_0)
|
||||
.Debugger()
|
||||
.LoadGlobal(name, load_global_feedback_slot,
|
||||
TypeofMode::NOT_INSIDE_TYPEOF)
|
||||
.LoadGlobal(name, load_global_feedback_slot, TypeofMode::kNotInside)
|
||||
.Return();
|
||||
|
||||
// Test iterator sees the expected output from the builder.
|
||||
|
Loading…
Reference in New Issue
Block a user