diff options
Diffstat (limited to 'chromium/v8/src/regexp/arm/regexp-macro-assembler-arm.h')
-rw-r--r-- | chromium/v8/src/regexp/arm/regexp-macro-assembler-arm.h | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/chromium/v8/src/regexp/arm/regexp-macro-assembler-arm.h b/chromium/v8/src/regexp/arm/regexp-macro-assembler-arm.h index a02a4dc2af5..478ed292ae9 100644 --- a/chromium/v8/src/regexp/arm/regexp-macro-assembler-arm.h +++ b/chromium/v8/src/regexp/arm/regexp-macro-assembler-arm.h @@ -5,8 +5,6 @@ #ifndef V8_REGEXP_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_ #define V8_REGEXP_ARM_REGEXP_MACRO_ASSEMBLER_ARM_H_ -#include "src/base/strings.h" -#include "src/codegen/arm/assembler-arm.h" #include "src/codegen/macro-assembler.h" #include "src/regexp/regexp-macro-assembler.h" @@ -93,15 +91,13 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM static const int kFramePointer = 0; // Above the frame pointer - Stored registers and stack passed parameters. - // Register 4..11. static const int kStoredRegisters = kFramePointer; // Return address (stored from link register, read into pc on return). static const int kReturnAddress = kStoredRegisters + 8 * kPointerSize; // Stack parameters placed by caller. static const int kRegisterOutput = kReturnAddress + kPointerSize; static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; - static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; - static const int kDirectCall = kStackHighEnd + kPointerSize; + static const int kDirectCall = kNumOutputRegisters + kPointerSize; static const int kIsolate = kDirectCall + kPointerSize; // Below the frame pointer. @@ -115,8 +111,14 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM static const int kSuccessfulCaptures = kInputString - kPointerSize; static const int kStringStartMinusOne = kSuccessfulCaptures - kPointerSize; static const int kBacktrackCount = kStringStartMinusOne - kSystemPointerSize; + // Stores the initial value of the regexp stack pointer in a + // position-independent representation (in case the regexp stack grows and + // thus moves). + static const int kRegExpStackBasePointer = + kBacktrackCount - kSystemPointerSize; + // First register address. Following registers are below it on the stack. - static const int kRegisterZero = kBacktrackCount - kSystemPointerSize; + static const int kRegisterZero = kRegExpStackBasePointer - kSystemPointerSize; // Initial size of code buffer. static const int kRegExpCodeSize = 1024; @@ -129,7 +131,6 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM // Check whether we are exceeding the stack limit on the backtrack stack. void CheckStackLimit(); - // Generate a call to CheckStackGuardState. void CallCheckStackGuardState(); @@ -138,27 +139,27 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM // Register holding the current input position as negative offset from // the end of the string. - inline Register current_input_offset() { return r6; } + static constexpr Register current_input_offset() { return r6; } // The register containing the current character after LoadCurrentCharacter. - inline Register current_character() { return r7; } + static constexpr Register current_character() { return r7; } // Register holding address of the end of the input string. - inline Register end_of_input_address() { return r10; } + static constexpr Register end_of_input_address() { return r10; } // Register holding the frame address. Local variables, parameters and // regexp registers are addressed relative to this. - inline Register frame_pointer() { return fp; } + static constexpr Register frame_pointer() { return fp; } // The register containing the backtrack stack top. Provides a meaningful // name to the register. - inline Register backtrack_stackpointer() { return r8; } + static constexpr Register backtrack_stackpointer() { return r8; } // Register holding pointer to the current code object. - inline Register code_pointer() { return r5; } + static constexpr Register code_pointer() { return r5; } // Byte size of chars in the string to match (decided by the Mode argument) - inline int char_size() { return static_cast<int>(mode_); } + inline int char_size() const { return static_cast<int>(mode_); } // Equivalent to a conditional branch to the label, unless the label // is nullptr, in which case it is a conditional Backtrack. @@ -178,19 +179,25 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM // and increments it by a word size. inline void Pop(Register target); + void LoadRegExpStackPointerFromMemory(Register dst); + void StoreRegExpStackPointerToMemory(Register src, Register scratch); + void PushRegExpBasePointer(Register stack_pointer, Register scratch); + void PopRegExpBasePointer(Register stack_pointer_out, Register scratch); + Isolate* isolate() const { return masm_->isolate(); } - MacroAssembler* masm_; + const std::unique_ptr<MacroAssembler> masm_; + const NoRootArrayScope no_root_array_scope_; // Which mode to generate code for (Latin1 or UC16). - Mode mode_; + const Mode mode_; // One greater than maximal register index actually used. int num_registers_; // Number of registers to output at the end (the saved registers // are always 0..num_saved_registers_-1) - int num_saved_registers_; + const int num_saved_registers_; // Labels used internally. Label entry_label_; |