Commit 7df7efe1 authored by Mu Tao's avatar Mu Tao Committed by Commit Bot

[mips][regexp] Apply the backtrack limit in jitted code

This is the second porting of 0089006f

The first not fully porting is da0ef75f

Change-Id: Ia7e51a492df2fcab7da0cd8b2ff4d436c28563e4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1877794
Auto-Submit: Mu Tao <pamilty@gmail.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Mu Tao <pamilty@gmail.com>
Cr-Commit-Position: refs/heads/master@{#64532}
parent 32a56552
......@@ -651,9 +651,15 @@ Handle<HeapObject> RegExpMacroAssemblerMIPS::GetCode(Handle<String> source) {
// Set frame pointer in space for it if this is not a direct call
// from generated code.
__ Addu(frame_pointer(), sp, Operand(4 * kPointerSize));
STATIC_ASSERT(kSuccessfulCaptures == kInputString - kSystemPointerSize);
__ mov(a0, zero_reg);
__ push(a0); // Make room for success counter and initialize it to 0.
STATIC_ASSERT(kStringStartMinusOne ==
kSuccessfulCaptures - kSystemPointerSize);
__ push(a0); // Make room for "string start - 1" constant.
STATIC_ASSERT(kBacktrackCount == kStringStartMinusOne - kSystemPointerSize);
__ push(a0);
// Check if we have space on the stack for registers.
Label stack_limit_hit;
......
......@@ -687,9 +687,14 @@ Handle<HeapObject> RegExpMacroAssemblerMIPS::GetCode(Handle<String> source) {
// from generated code.
// TODO(plind): this 8 is the # of argument regs, should have definition.
__ Daddu(frame_pointer(), sp, Operand(8 * kPointerSize));
STATIC_ASSERT(kSuccessfulCaptures == kInputString - kSystemPointerSize);
__ mov(a0, zero_reg);
__ push(a0); // Make room for success counter and initialize it to 0.
STATIC_ASSERT(kStringStartMinusOne ==
kSuccessfulCaptures - kSystemPointerSize);
__ push(a0); // Make room for "string start - 1" constant.
STATIC_ASSERT(kBacktrackCount == kStringStartMinusOne - kSystemPointerSize);
__ push(a0); // The backtrack counter
// Check if we have space on the stack for registers.
Label stack_limit_hit;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment