Index: src/mips64/regexp-macro-assembler-mips64.h |
diff --git a/src/mips/regexp-macro-assembler-mips.h b/src/mips64/regexp-macro-assembler-mips64.h |
similarity index 79% |
copy from src/mips/regexp-macro-assembler-mips.h |
copy to src/mips64/regexp-macro-assembler-mips64.h |
index ddf484cbbe896156a0f43ff5e8bd2bf596d6d9a7..647e4150cb1484c7db4d3b0cd8968a76de733958 100644 |
--- a/src/mips/regexp-macro-assembler-mips.h |
+++ b/src/mips64/regexp-macro-assembler-mips64.h |
@@ -7,9 +7,9 @@ |
#define V8_MIPS_REGEXP_MACRO_ASSEMBLER_MIPS_H_ |
#include "src/macro-assembler.h" |
-#include "src/mips/assembler-mips-inl.h" |
-#include "src/mips/assembler-mips.h" |
-#include "src/mips/macro-assembler-mips.h" |
+#include "src/mips64/assembler-mips64-inl.h" |
+#include "src/mips64/assembler-mips64.h" |
+#include "src/mips64/macro-assembler-mips64.h" |
namespace v8 { |
namespace internal { |
@@ -93,7 +93,45 @@ class RegExpMacroAssemblerMIPS: public NativeRegExpMacroAssembler { |
Code* re_code, |
Address re_frame); |
+ void print_regexp_frame_constants(); |
+ |
private: |
+#if defined(MIPS_ABI_N64) |
+ // Offsets from frame_pointer() of function parameters and stored registers. |
+ static const int kFramePointer = 0; |
+ |
+ // Above the frame pointer - Stored registers and stack passed parameters. |
+ // Registers s0 to s7, fp, and ra. |
+ static const int kStoredRegisters = kFramePointer; |
+ // Return address (stored from link register, read into pc on return). |
+ |
+// TODO(plind): This 9 - is 8 s-regs (s0..s7) plus fp. |
+ |
+ static const int kReturnAddress = kStoredRegisters + 9 * kPointerSize; |
+ static const int kSecondaryReturnAddress = kReturnAddress + kPointerSize; |
+ // Stack frame header. |
+ static const int kStackFrameHeader = kSecondaryReturnAddress; |
+ // Stack parameters placed by caller. |
+ static const int kIsolate = kStackFrameHeader + kPointerSize; |
+ |
+ // Below the frame pointer. |
+ // Register parameters stored by setup code. |
+ static const int kDirectCall = kFramePointer - kPointerSize; |
+ static const int kStackHighEnd = kDirectCall - kPointerSize; |
+ static const int kNumOutputRegisters = kStackHighEnd - kPointerSize; |
+ static const int kRegisterOutput = kNumOutputRegisters - kPointerSize; |
+ static const int kInputEnd = kRegisterOutput - kPointerSize; |
+ static const int kInputStart = kInputEnd - kPointerSize; |
+ static const int kStartIndex = kInputStart - kPointerSize; |
+ static const int kInputString = kStartIndex - kPointerSize; |
+ // When adding local variables remember to push space for them in |
+ // the frame in GetCode. |
+ static const int kSuccessfulCaptures = kInputString - kPointerSize; |
+ static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; |
+ // First register address. Following registers are below it on the stack. |
+ static const int kRegisterZero = kInputStartMinusOne - kPointerSize; |
+ |
+#elif defined(MIPS_ABI_O32) |
// Offsets from frame_pointer() of function parameters and stored registers. |
static const int kFramePointer = 0; |
@@ -106,7 +144,8 @@ class RegExpMacroAssemblerMIPS: public NativeRegExpMacroAssembler { |
// Stack frame header. |
static const int kStackFrameHeader = kReturnAddress + kPointerSize; |
// Stack parameters placed by caller. |
- static const int kRegisterOutput = kStackFrameHeader + 20; |
+ static const int kRegisterOutput = |
+ kStackFrameHeader + 4 * kPointerSize + kPointerSize; |
static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; |
static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; |
static const int kDirectCall = kStackHighEnd + kPointerSize; |
@@ -125,6 +164,10 @@ class RegExpMacroAssemblerMIPS: public NativeRegExpMacroAssembler { |
// First register address. Following registers are below it on the stack. |
static const int kRegisterZero = kInputStartMinusOne - kPointerSize; |
+#else |
+# error "undefined MIPS ABI" |
+#endif |
+ |
// Initial size of code buffer. |
static const size_t kRegExpCodeSize = 1024; |
@@ -147,13 +190,13 @@ class RegExpMacroAssemblerMIPS: public NativeRegExpMacroAssembler { |
// Register holding the current input position as negative offset from |
// the end of the string. |
- inline Register current_input_offset() { return t2; } |
+ inline Register current_input_offset() { return a6; } |
// The register containing the current character after LoadCurrentCharacter. |
- inline Register current_character() { return t3; } |
+ inline Register current_character() { return a7; } |
// Register holding address of the end of the input string. |
- inline Register end_of_input_address() { return t6; } |
+ inline Register end_of_input_address() { return t2; } |
// Register holding the frame address. Local variables, parameters and |
// regexp registers are addressed relative to this. |
@@ -161,10 +204,10 @@ class RegExpMacroAssemblerMIPS: public NativeRegExpMacroAssembler { |
// The register containing the backtrack stack top. Provides a meaningful |
// name to the register. |
- inline Register backtrack_stackpointer() { return t4; } |
+ inline Register backtrack_stackpointer() { return t0; } |
// Register holding pointer to the current code object. |
- inline Register code_pointer() { return t1; } |
+ inline Register code_pointer() { return a5; } |
// Byte size of chars in the string to match (decided by the Mode argument). |
inline int char_size() { return static_cast<int>(mode_); } |