diff options
Diffstat (limited to 'deps/v8/src/codegen/mips/macro-assembler-mips.cc')
-rw-r--r-- | deps/v8/src/codegen/mips/macro-assembler-mips.cc | 103 |
1 files changed, 49 insertions, 54 deletions
diff --git a/deps/v8/src/codegen/mips/macro-assembler-mips.cc b/deps/v8/src/codegen/mips/macro-assembler-mips.cc index 8bbdbca662..d48b441c7b 100644 --- a/deps/v8/src/codegen/mips/macro-assembler-mips.cc +++ b/deps/v8/src/codegen/mips/macro-assembler-mips.cc @@ -12,6 +12,7 @@ #include "src/codegen/callable.h" #include "src/codegen/code-factory.h" #include "src/codegen/external-reference-table.h" +#include "src/codegen/interface-descriptors-inl.h" #include "src/codegen/macro-assembler.h" #include "src/codegen/register-configuration.h" #include "src/debug/debug.h" @@ -64,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; } @@ -89,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; } @@ -100,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; } @@ -179,7 +180,7 @@ void MacroAssembler::RecordWriteField(Register object, int offset, Label done; // Skip barrier if writing a smi. - if (smi_check == INLINE_SMI_CHECK) { + if (smi_check == SmiCheck::kInline) { JumpIfSmi(value, &done); } @@ -188,7 +189,7 @@ void MacroAssembler::RecordWriteField(Register object, int offset, DCHECK(IsAligned(offset, kPointerSize)); Addu(dst, object, Operand(offset - kHeapObjectTag)); - if (emit_debug_code()) { + if (FLAG_debug_code) { BlockTrampolinePoolScope block_trampoline_pool(this); Label ok; And(t8, dst, Operand(kPointerSize - 1)); @@ -198,13 +199,13 @@ void MacroAssembler::RecordWriteField(Register object, int offset, } RecordWrite(object, dst, value, ra_status, save_fp, remembered_set_action, - OMIT_SMI_CHECK); + SmiCheck::kOmit); bind(&done); // Clobber clobbered input registers when running with the debug-code flag // turned on to provoke errors. - if (emit_debug_code()) { + if (FLAG_debug_code) { li(value, Operand(bit_cast<int32_t>(kZapValue + 4))); li(dst, Operand(bit_cast<int32_t>(kZapValue + 8))); } @@ -336,7 +337,7 @@ void MacroAssembler::RecordWrite(Register object, Register address, DCHECK(!AreAliased(object, address, value, t8)); DCHECK(!AreAliased(object, address, value, t9)); - if (emit_debug_code()) { + if (FLAG_debug_code) { UseScratchRegisterScope temps(this); Register scratch = temps.Acquire(); lw(scratch, MemOperand(address)); @@ -344,7 +345,7 @@ void MacroAssembler::RecordWrite(Register object, Register address, Operand(value)); } - if ((remembered_set_action == OMIT_REMEMBERED_SET && + if ((remembered_set_action == RememberedSetAction::kOmit && !FLAG_incremental_marking) || FLAG_disable_write_barriers) { return; @@ -354,7 +355,7 @@ void MacroAssembler::RecordWrite(Register object, Register address, // catch stores of smis and stores into the young generation. Label done; - if (smi_check == INLINE_SMI_CHECK) { + if (smi_check == SmiCheck::kInline) { DCHECK_EQ(0, kSmiTag); JumpIfSmi(value, &done); } @@ -379,7 +380,7 @@ void MacroAssembler::RecordWrite(Register object, Register address, // Clobber clobbered registers when running with the debug-code flag // turned on to provoke errors. - if (emit_debug_code()) { + if (FLAG_debug_code) { li(address, Operand(bit_cast<int32_t>(kZapValue + 12))); li(value, Operand(bit_cast<int32_t>(kZapValue + 16))); } @@ -4176,14 +4177,6 @@ void TurboAssembler::PushArray(Register array, Register size, Register scratch, } } -void MacroAssembler::MaybeDropFrames() { - // Check whether we need to drop frames to restart a function on the stack. - li(a1, ExternalReference::debug_restart_fp_address(isolate())); - lw(a1, MemOperand(a1)); - Jump(BUILTIN_CODE(isolate(), FrameDropperTrampoline), RelocInfo::CODE_TARGET, - ne, a1, Operand(zero_reg)); -} - // --------------------------------------------------------------------------- // Exception handling. @@ -4373,7 +4366,7 @@ void MacroAssembler::StackOverflowCheck(Register num_args, Register scratch1, void MacroAssembler::InvokePrologue(Register expected_parameter_count, Register actual_parameter_count, - Label* done, InvokeFlag flag) { + Label* done, InvokeType type) { Label regular_invoke; // a0: actual arguments count @@ -4484,9 +4477,9 @@ void MacroAssembler::CheckDebugHook(Register fun, Register new_target, void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, Register expected_parameter_count, Register actual_parameter_count, - InvokeFlag flag) { + InvokeType type) { // You can't call a function without a valid frame. - DCHECK_IMPLIES(flag == CALL_FUNCTION, has_frame()); + DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); DCHECK_EQ(function, a1); DCHECK_IMPLIES(new_target.is_valid(), new_target == a3); @@ -4500,19 +4493,21 @@ void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, } Label done; - InvokePrologue(expected_parameter_count, actual_parameter_count, &done, flag); + InvokePrologue(expected_parameter_count, actual_parameter_count, &done, type); // We call indirectly through the code field in the function to // allow recompilation to take effect without changing any of the // call sites. Register code = kJavaScriptCallCodeStartRegister; lw(code, FieldMemOperand(function, JSFunction::kCodeOffset)); - if (flag == CALL_FUNCTION) { - Addu(code, code, Code::kHeaderSize - kHeapObjectTag); - Call(code); - } else { - DCHECK(flag == JUMP_FUNCTION); - Addu(code, code, Code::kHeaderSize - kHeapObjectTag); - Jump(code); + switch (type) { + case InvokeType::kCall: + Addu(code, code, Code::kHeaderSize - kHeapObjectTag); + Call(code); + break; + case InvokeType::kJump: + Addu(code, code, Code::kHeaderSize - kHeapObjectTag); + Jump(code); + break; } // Continue here if InvokePrologue does handle the invocation due to @@ -4522,9 +4517,9 @@ void MacroAssembler::InvokeFunctionCode(Register function, Register new_target, void MacroAssembler::InvokeFunctionWithNewTarget( Register function, Register new_target, Register actual_parameter_count, - InvokeFlag flag) { + InvokeType type) { // You can't call a function without a valid frame. - DCHECK_IMPLIES(flag == CALL_FUNCTION, has_frame()); + DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); // Contract with called JS functions requires that function is passed in a1. DCHECK_EQ(function, a1); @@ -4538,15 +4533,15 @@ void MacroAssembler::InvokeFunctionWithNewTarget( SharedFunctionInfo::kFormalParameterCountOffset)); InvokeFunctionCode(function, new_target, expected_reg, actual_parameter_count, - flag); + type); } void MacroAssembler::InvokeFunction(Register function, Register expected_parameter_count, Register actual_parameter_count, - InvokeFlag flag) { + InvokeType type) { // You can't call a function without a valid frame. - DCHECK_IMPLIES(flag == CALL_FUNCTION, has_frame()); + DCHECK_IMPLIES(type == InvokeType::kCall, has_frame()); // Contract with called JS functions requires that function is passed in a1. DCHECK_EQ(function, a1); @@ -4555,7 +4550,7 @@ void MacroAssembler::InvokeFunction(Register function, lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); InvokeFunctionCode(a1, no_reg, expected_parameter_count, - actual_parameter_count, flag); + actual_parameter_count, type); } // --------------------------------------------------------------------------- @@ -4699,8 +4694,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); } @@ -4746,7 +4741,7 @@ void TurboAssembler::DebugBreak() { stop(); } void TurboAssembler::Assert(Condition cc, AbortReason reason, Register rs, Operand rt) { - if (emit_debug_code()) Check(cc, reason, rs, rt); + if (FLAG_debug_code) Check(cc, reason, rs, rt); } void TurboAssembler::Check(Condition cc, AbortReason reason, Register rs, @@ -4761,11 +4756,11 @@ void TurboAssembler::Check(Condition cc, AbortReason reason, Register rs, void TurboAssembler::Abort(AbortReason reason) { Label abort_start; bind(&abort_start); -#ifdef DEBUG - const char* msg = GetAbortReason(reason); - RecordComment("Abort message: "); - RecordComment(msg); -#endif + if (FLAG_code_comments) { + const char* msg = GetAbortReason(reason); + RecordComment("Abort message: "); + RecordComment(msg); + } // Avoid emitting call to builtin if requested. if (trap_on_abort()) { @@ -4885,7 +4880,7 @@ void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space, // Set up new frame pointer. addiu(fp, sp, ExitFrameConstants::kFixedFrameSizeFromFp); - if (emit_debug_code()) { + if (FLAG_debug_code) { sw(zero_reg, MemOperand(fp, ExitFrameConstants::kSPOffset)); } @@ -4999,7 +4994,7 @@ int TurboAssembler::ActivationFrameAlignment() { } void MacroAssembler::AssertStackIsAligned() { - if (emit_debug_code()) { + if (FLAG_debug_code) { const int frame_alignment = ActivationFrameAlignment(); const int frame_alignment_mask = frame_alignment - 1; @@ -5032,7 +5027,7 @@ void MacroAssembler::JumpIfNotSmi(Register value, Label* not_smi_label, } void MacroAssembler::AssertNotSmi(Register object) { - if (emit_debug_code()) { + if (FLAG_debug_code) { STATIC_ASSERT(kSmiTag == 0); UseScratchRegisterScope temps(this); Register scratch = temps.Acquire(); @@ -5042,7 +5037,7 @@ void MacroAssembler::AssertNotSmi(Register object) { } void MacroAssembler::AssertSmi(Register object) { - if (emit_debug_code()) { + if (FLAG_debug_code) { STATIC_ASSERT(kSmiTag == 0); UseScratchRegisterScope temps(this); Register scratch = temps.Acquire(); @@ -5052,7 +5047,7 @@ void MacroAssembler::AssertSmi(Register object) { } void MacroAssembler::AssertConstructor(Register object) { - if (emit_debug_code()) { + if (FLAG_debug_code) { BlockTrampolinePoolScope block_trampoline_pool(this); STATIC_ASSERT(kSmiTag == 0); SmiTst(object, t8); @@ -5067,7 +5062,7 @@ void MacroAssembler::AssertConstructor(Register object) { } void MacroAssembler::AssertFunction(Register object) { - if (emit_debug_code()) { + if (FLAG_debug_code) { BlockTrampolinePoolScope block_trampoline_pool(this); STATIC_ASSERT(kSmiTag == 0); SmiTst(object, t8); @@ -5083,7 +5078,7 @@ void MacroAssembler::AssertFunction(Register object) { } void MacroAssembler::AssertBoundFunction(Register object) { - if (emit_debug_code()) { + if (FLAG_debug_code) { BlockTrampolinePoolScope block_trampoline_pool(this); STATIC_ASSERT(kSmiTag == 0); SmiTst(object, t8); @@ -5096,7 +5091,7 @@ void MacroAssembler::AssertBoundFunction(Register object) { } void MacroAssembler::AssertGeneratorObject(Register object) { - if (!emit_debug_code()) return; + if (!FLAG_debug_code) return; BlockTrampolinePoolScope block_trampoline_pool(this); STATIC_ASSERT(kSmiTag == 0); SmiTst(object, t8); @@ -5123,7 +5118,7 @@ void MacroAssembler::AssertGeneratorObject(Register object) { void MacroAssembler::AssertUndefinedOrAllocationSite(Register object, Register scratch) { - if (emit_debug_code()) { + if (FLAG_debug_code) { Label done_checking; AssertNotSmi(object); LoadRoot(scratch, RootIndex::kUndefinedValue); @@ -5416,7 +5411,7 @@ void TurboAssembler::CallCFunctionHelper(Register function_base, // PrepareCallCFunction. The C function must be called via t9, for mips ABI. #if V8_HOST_ARCH_MIPS - if (emit_debug_code()) { + if (FLAG_debug_code) { int frame_alignment = base::OS::ActivationFrameAlignment(); int frame_alignment_mask = frame_alignment - 1; if (frame_alignment > kPointerSize) { |