--- a/src/3rdparty/chromium/v8/src/codegen/mips/assembler-mips.h +++ b/src/3rdparty/chromium/v8/src/codegen/mips/assembler-mips.h @@ -71,7 +71,6 @@ : rm_(no_reg), rmode_(RelocInfo::EXTERNAL_REFERENCE) { value_.immediate = static_cast(f.address()); } - V8_INLINE explicit Operand(const char* s); explicit Operand(Handle handle); V8_INLINE explicit Operand(Smi value) : rm_(no_reg), rmode_(RelocInfo::NONE) { value_.immediate = static_cast(value.ptr()); --- a/src/3rdparty/chromium/v8/src/regexp/mips/regexp-macro-assembler-mips.cc +++ b/src/3rdparty/chromium/v8/src/regexp/mips/regexp-macro-assembler-mips.cc @@ -663,6 +663,8 @@ ExternalReference stack_limit = ExternalReference::address_of_jslimit(masm_->isolate()); + Operand extra_space_for_variables(num_registers_ * kPointerSize); + __ li(a0, Operand(stack_limit)); __ lw(a0, MemOperand(a0)); __ Subu(a0, sp, a0); @@ -670,14 +672,14 @@ __ Branch(&stack_limit_hit, le, a0, Operand(zero_reg)); // Check if there is room for the variable number of registers above // the stack limit. - __ Branch(&stack_ok, hs, a0, Operand(num_registers_ * kPointerSize)); + __ Branch(&stack_ok, hs, a0, extra_space_for_variables); // Exit with OutOfMemory exception. There is not enough space on the stack // for our working registers. __ li(v0, Operand(EXCEPTION)); __ jmp(&return_v0); __ bind(&stack_limit_hit); - CallCheckStackGuardState(a0); + CallCheckStackGuardState(a0, extra_space_for_variables); // If returned value is non-zero, we exit with the returned value as result. __ Branch(&return_v0, ne, v0, Operand(zero_reg)); @@ -1086,7 +1088,8 @@ // Private methods: -void RegExpMacroAssemblerMIPS::CallCheckStackGuardState(Register scratch) { +void RegExpMacroAssemblerMIPS::CallCheckStackGuardState(Register scratch, + Operand extra_space) { DCHECK(!isolate()->IsGeneratingEmbeddedBuiltins()); DCHECK(!masm_->options().isolate_independent_code); @@ -1099,6 +1102,9 @@ __ And(sp, sp, Operand(-stack_alignment)); __ sw(scratch, MemOperand(sp)); + // Extra space for variables to consider in stack check. + __ li(a3, extra_space); + // RegExp code frame pointer. __ mov(a2, frame_pointer()); // Code of self. __ li(a1, Operand(masm_->CodeObject()), CONSTANT_SIZE); @@ -1107,16 +1113,6 @@ DCHECK(IsAligned(stack_alignment, kPointerSize)); __ Subu(sp, sp, Operand(stack_alignment)); - // The stack pointer now points to cell where the return address will be - // written. Arguments are in registers, meaning we treat the return address as - // argument 5. Since DirectCEntry will handle allocating space for the C - // argument slots, we don't need to care about that here. This is how the - // stack will look (sp meaning the value of sp at this moment): - // [sp + 3] - empty slot if needed for alignment. - // [sp + 2] - saved sp. - // [sp + 1] - second word reserved for return value. - // [sp + 0] - first word reserved for return value. - // a0 will point to the return address, placed by DirectCEntry. __ mov(a0, sp); @@ -1130,17 +1126,6 @@ __ li(kScratchReg, Operand(entry, RelocInfo::OFF_HEAP_TARGET)); __ Call(kScratchReg); - // DirectCEntry allocated space for the C argument slots so we have to - // drop them with the return address from the stack with loading saved sp. - // At this point stack must look: - // [sp + 7] - empty slot if needed for alignment. - // [sp + 6] - saved sp. - // [sp + 5] - second word reserved for return value. - // [sp + 4] - first word reserved for return value. - // [sp + 3] - C argument slot. - // [sp + 2] - C argument slot. - // [sp + 1] - C argument slot. - // [sp + 0] - C argument slot. __ lw(sp, MemOperand(sp, stack_alignment + kCArgsSlotsSize)); __ li(code_pointer(), Operand(masm_->CodeObject())); @@ -1161,7 +1146,8 @@ int RegExpMacroAssemblerMIPS::CheckStackGuardState(Address* return_address, Address raw_code, - Address re_frame) { + Address re_frame, + uintptr_t extra_space) { Code re_code = Code::cast(Object(raw_code)); return NativeRegExpMacroAssembler::CheckStackGuardState( frame_entry(re_frame, kIsolate), @@ -1170,7 +1156,8 @@ return_address, re_code, frame_entry_address
(re_frame, kInputString), frame_entry_address(re_frame, kInputStart), - frame_entry_address(re_frame, kInputEnd)); + frame_entry_address(re_frame, kInputEnd), + extra_space); } --- a/src/3rdparty/chromium/v8/src/regexp/mips/regexp-macro-assembler-mips.h +++ b/src/3rdparty/chromium/v8/src/regexp/mips/regexp-macro-assembler-mips.h @@ -90,7 +90,7 @@ // returning. // {raw_code} is an Address because this is called via ExternalReference. static int CheckStackGuardState(Address* return_address, Address raw_code, - Address re_frame); + Address re_frame, uintptr_t extra_space); private: // Offsets from frame_pointer() of function parameters and stored registers. @@ -135,7 +135,8 @@ // Generate a call to CheckStackGuardState. - void CallCheckStackGuardState(Register scratch); + void CallCheckStackGuardState(Register scratch, + Operand extra_space = Operand(0)); // The ebp-relative location of a regexp register. MemOperand register_location(int register_index);