diff options
Diffstat (limited to 'deps/v8/src/builtins/ia32/builtins-ia32.cc')
-rw-r--r-- | deps/v8/src/builtins/ia32/builtins-ia32.cc | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/deps/v8/src/builtins/ia32/builtins-ia32.cc b/deps/v8/src/builtins/ia32/builtins-ia32.cc index d1c0a5d5fb..4707667bbf 100644 --- a/deps/v8/src/builtins/ia32/builtins-ia32.cc +++ b/deps/v8/src/builtins/ia32/builtins-ia32.cc @@ -11,7 +11,9 @@ #include "src/frame-constants.h" #include "src/frames.h" #include "src/objects-inl.h" +#include "src/objects/js-generator.h" #include "src/wasm/wasm-linkage.h" +#include "src/wasm/wasm-objects.h" namespace v8 { namespace internal { @@ -327,7 +329,7 @@ static void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args, // limit" is checked. ExternalReference real_stack_limit = ExternalReference::address_of_real_stack_limit(masm->isolate()); - __ mov(scratch1, Operand::StaticVariable(real_stack_limit)); + __ mov(scratch1, __ StaticVariable(real_stack_limit)); // Make scratch2 the space we have left. The stack might already be overflowed // here which will cause scratch2 to become negative. __ mov(scratch2, esp); @@ -354,7 +356,7 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, // Setup the context (we need to use the caller context from the isolate). ExternalReference context_address = ExternalReference::Create( IsolateAddressId::kContextAddress, masm->isolate()); - __ mov(esi, Operand::StaticVariable(context_address)); + __ mov(esi, __ StaticVariable(context_address)); // Load the previous frame pointer (ebx) to access C arguments __ mov(ebx, Operand(ebp, 0)); @@ -456,13 +458,13 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { Label stepping_prepared; ExternalReference debug_hook = ExternalReference::debug_hook_on_function_call_address(masm->isolate()); - __ cmpb(Operand::StaticVariable(debug_hook), Immediate(0)); + __ cmpb(__ StaticVariable(debug_hook), Immediate(0)); __ j(not_equal, &prepare_step_in_if_stepping); // Flood function if we need to continue stepping in the suspended generator. ExternalReference debug_suspended_generator = ExternalReference::debug_suspended_generator_address(masm->isolate()); - __ cmp(edx, Operand::StaticVariable(debug_suspended_generator)); + __ cmp(edx, __ StaticVariable(debug_suspended_generator)); __ j(equal, &prepare_step_in_suspended_generator); __ bind(&stepping_prepared); @@ -755,7 +757,7 @@ static void AdvanceBytecodeOffsetOrReturn(MacroAssembler* masm, #define JUMP_IF_EQUAL(NAME) \ __ cmpb(bytecode, \ Immediate(static_cast<int>(interpreter::Bytecode::k##NAME))); \ - __ j(equal, if_return, Label::kNear); + __ j(equal, if_return); RETURN_BYTECODE_LIST(JUMP_IF_EQUAL) #undef JUMP_IF_EQUAL @@ -843,7 +845,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { __ sub(ecx, ebx); ExternalReference stack_limit = ExternalReference::address_of_real_stack_limit(masm->isolate()); - __ cmp(ecx, Operand::StaticVariable(stack_limit)); + __ cmp(ecx, __ StaticVariable(stack_limit)); __ j(above_equal, &ok); __ CallRuntime(Runtime::kThrowStackOverflow); __ bind(&ok); @@ -1113,6 +1115,9 @@ void Builtins::Generate_InterpreterPushArgsThenConstructImpl( // Tail call to the array construct stub (still in the caller // context at this point). __ AssertFunction(edi); + // TODO(v8:6666): When rewriting ia32 ASM builtins to not clobber the + // kRootRegister ebx, this useless move can be removed. + __ Move(kJavaScriptCallExtraArg1Register, ebx); Handle<Code> code = BUILTIN_CODE(masm->isolate(), ArrayConstructorImpl); __ Jump(code, RelocInfo::CODE_TARGET); } else if (mode == InterpreterPushArgsMode::kWithFinalSpread) { @@ -1688,7 +1693,7 @@ void Builtins::Generate_CallOrConstructVarargs(MacroAssembler* masm, Label done; ExternalReference real_stack_limit = ExternalReference::address_of_real_stack_limit(masm->isolate()); - __ mov(edx, Operand::StaticVariable(real_stack_limit)); + __ mov(edx, __ StaticVariable(real_stack_limit)); // Make edx the space we have left. The stack might already be overflowed // here which will cause edx to become negative. __ neg(edx); @@ -2383,7 +2388,7 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { // Convert to Smi for the runtime call. __ SmiTag(edi); { - TrapOnAbortScope trap_on_abort_scope(masm); // Avoid calls to Abort. + HardAbortScope hard_abort(masm); // Avoid calls to Abort. FrameScope scope(masm, StackFrame::WASM_COMPILE_LAZY); // Save all parameter registers (see wasm-linkage.cc). They might be @@ -2438,7 +2443,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, SaveFPRegsMode save_doubles, ArgvMode argv_mode, bool builtin_exit_frame) { // eax: number of arguments including receiver - // ebx: pointer to C function (C callee-saved) + // edx: pointer to C function // ebp: frame pointer (restored after C call) // esp: stack pointer (restored after C call) // esi: current context (C callee-saved) @@ -2447,6 +2452,16 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, // If argv_mode == kArgvInRegister: // ecx: pointer to the first argument + STATIC_ASSERT(eax == kRuntimeCallArgCountRegister); + STATIC_ASSERT(ecx == kRuntimeCallArgvRegister); + STATIC_ASSERT(edx == kRuntimeCallFunctionRegister); + STATIC_ASSERT(esi == kContextRegister); + STATIC_ASSERT(edi == kJSFunctionRegister); + + DCHECK(!AreAliased(kRuntimeCallArgCountRegister, kRuntimeCallArgvRegister, + kRuntimeCallFunctionRegister, kContextRegister, + kJSFunctionRegister, kRootRegister)); + ProfileEntryHookStub::MaybeCallEntryHook(masm); // Reserve space on the stack for the three arguments passed to the call. If @@ -2470,7 +2485,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, builtin_exit_frame ? StackFrame::BUILTIN_EXIT : StackFrame::EXIT); } - // ebx: pointer to C function (C callee-saved) + // edx: pointer to C function // ebp: frame pointer (restored after C call) // esp: stack pointer (restored after C call) // edi: number of arguments including receiver (C callee-saved) @@ -2487,7 +2502,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. __ mov(Operand(esp, 2 * kPointerSize), Immediate(ExternalReference::isolate_address(masm->isolate()))); - __ call(ebx); + __ call(kRuntimeCallFunctionRegister); // Result is in eax or edx:eax - do not destroy these registers! @@ -2504,7 +2519,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, Label okay; ExternalReference pending_exception_address = ExternalReference::Create( IsolateAddressId::kPendingExceptionAddress, masm->isolate()); - __ cmp(edx, Operand::StaticVariable(pending_exception_address)); + __ cmp(edx, __ StaticVariable(pending_exception_address)); // Cannot use check here as it attempts to generate call into runtime. __ j(equal, &okay, Label::kNear); __ int3(); @@ -2544,9 +2559,9 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, } // Retrieve the handler context, SP and FP. - __ mov(esi, Operand::StaticVariable(pending_handler_context_address)); - __ mov(esp, Operand::StaticVariable(pending_handler_sp_address)); - __ mov(ebp, Operand::StaticVariable(pending_handler_fp_address)); + __ mov(esi, __ StaticVariable(pending_handler_context_address)); + __ mov(esp, __ StaticVariable(pending_handler_sp_address)); + __ mov(ebp, __ StaticVariable(pending_handler_fp_address)); // If the handler is a JS frame, restore the context to the frame. Note that // the context will be set to (esi == 0) for non-JS frames. @@ -2563,7 +2578,7 @@ void Builtins::Generate_CEntry(MacroAssembler* masm, int result_size, __ ResetSpeculationPoisonRegister(); // Compute the handler entry address and jump to it. - __ mov(edi, Operand::StaticVariable(pending_handler_entrypoint_address)); + __ mov(edi, __ StaticVariable(pending_handler_entrypoint_address)); __ jmp(edi); } @@ -2828,6 +2843,9 @@ void GenerateInternalArrayConstructorCase(MacroAssembler* masm, RelocInfo::CODE_TARGET); __ bind(¬_one_case); + // TODO(v8:6666): When rewriting ia32 ASM builtins to not clobber the + // kRootRegister ebx, this useless move can be removed. + __ Move(kJavaScriptCallExtraArg1Register, ebx); Handle<Code> code = BUILTIN_CODE(masm->isolate(), ArrayNArgumentsConstructor); __ Jump(code, RelocInfo::CODE_TARGET); } |