diff options
Diffstat (limited to 'deps/v8/src/builtins/s390/builtins-s390.cc')
-rw-r--r-- | deps/v8/src/builtins/s390/builtins-s390.cc | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/deps/v8/src/builtins/s390/builtins-s390.cc b/deps/v8/src/builtins/s390/builtins-s390.cc index 854f31cece..7dca12d17e 100644 --- a/deps/v8/src/builtins/s390/builtins-s390.cc +++ b/deps/v8/src/builtins/s390/builtins-s390.cc @@ -81,12 +81,24 @@ static void GenerateTailCallToReturnedCode(MacroAssembler* masm, namespace { +MemOperand RealStackLimitAsMemOperand(MacroAssembler* masm) { + DCHECK(masm->root_array_available()); + Isolate* isolate = masm->isolate(); + ExternalReference limit = ExternalReference::address_of_real_jslimit(isolate); + DCHECK(TurboAssembler::IsAddressableThroughRootRegister(isolate, limit)); + + intptr_t offset = + TurboAssembler::RootRegisterOffsetForExternalReference(isolate, limit); + CHECK(is_int32(offset)); + return MemOperand(kRootRegister, offset); +} + void Generate_StackOverflowCheck(MacroAssembler* masm, Register num_args, Register scratch, Label* stack_overflow) { // Check the stack for overflow. We are not trying to catch // interruptions (e.g. debug break and preemption) here, so the "real stack // limit" is checked. - __ LoadRoot(scratch, RootIndex::kRealStackLimit); + __ LoadP(scratch, RealStackLimitAsMemOperand(masm)); // Make scratch the space we have left. The stack might already be overflowed // here which will cause scratch to become negative. __ SubP(scratch, sp, scratch); @@ -429,7 +441,8 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { // Check the stack for overflow. We are not trying to catch interruptions // (i.e. debug break and preemption) here, so check the "real stack limit". Label stack_overflow; - __ CompareRoot(sp, RootIndex::kRealStackLimit); + __ LoadP(scratch, RealStackLimitAsMemOperand(masm)); + __ CmpLogicalP(sp, scratch); __ blt(&stack_overflow); // Push receiver. @@ -772,7 +785,7 @@ static void Generate_CheckStackOverflow(MacroAssembler* masm, Register argc, // interruptions (e.g. debug break and preemption) here, so the "real stack // limit" is checked. Label okay; - __ LoadRoot(scratch1, RootIndex::kRealStackLimit); + __ LoadP(scratch1, RealStackLimitAsMemOperand(masm)); // Make scratch1 the space we have left. The stack might already be overflowed // here which will cause scratch1 to become negative. __ SubP(scratch1, sp, scratch1); @@ -1197,8 +1210,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { // Do a stack check to ensure we don't go over the limit. Label ok; __ SubP(r8, sp, r4); - __ LoadRoot(r0, RootIndex::kRealStackLimit); - __ CmpLogicalP(r8, r0); + __ CmpLogicalP(r8, RealStackLimitAsMemOperand(masm)); __ bge(&ok); __ CallRuntime(Runtime::kThrowStackOverflow); __ bind(&ok); @@ -2219,7 +2231,7 @@ void Generate_PushBoundArguments(MacroAssembler* masm) { // Check the stack for overflow. We are not trying to catch interruptions // (i.e. debug break and preemption) here, so check the "real stack // limit". - __ CompareRoot(sp, RootIndex::kRealStackLimit); + __ CmpLogicalP(sp, RealStackLimitAsMemOperand(masm)); __ bgt(&done); // Signed comparison. // Restore the stack pointer. __ LoadRR(sp, scratch); @@ -2657,7 +2669,10 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { __ Push(kWasmInstanceRegister, r7); // Load the correct CEntry builtin from the instance object. __ LoadP(r4, FieldMemOperand(kWasmInstanceRegister, - WasmInstanceObject::kCEntryStubOffset)); + WasmInstanceObject::kIsolateRootOffset)); + auto centry_id = + Builtins::kCEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit; + __ LoadP(r4, MemOperand(r4, IsolateData::builtin_slot_offset(centry_id))); // Initialize the JavaScript context with 0. CEntry will use it to // set the current context on the isolate. __ LoadSmiLiteral(cp, Smi::zero()); |