OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 virtual void PopCurrentPosition(); | 108 virtual void PopCurrentPosition(); |
109 virtual void PopRegister(int register_index); | 109 virtual void PopRegister(int register_index); |
110 virtual void PushBacktrack(Label* label); | 110 virtual void PushBacktrack(Label* label); |
111 virtual void PushCurrentPosition(); | 111 virtual void PushCurrentPosition(); |
112 virtual void PushRegister(int register_index, | 112 virtual void PushRegister(int register_index, |
113 StackCheckFlag check_stack_limit); | 113 StackCheckFlag check_stack_limit); |
114 virtual void ReadCurrentPositionFromRegister(int reg); | 114 virtual void ReadCurrentPositionFromRegister(int reg); |
115 virtual void ReadStackPointerFromRegister(int reg); | 115 virtual void ReadStackPointerFromRegister(int reg); |
116 virtual void SetCurrentPositionFromEnd(int by); | 116 virtual void SetCurrentPositionFromEnd(int by); |
117 virtual void SetRegister(int register_index, int to); | 117 virtual void SetRegister(int register_index, int to); |
118 virtual void Succeed(); | 118 virtual bool Succeed(); |
119 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); | 119 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); |
120 virtual void ClearRegisters(int reg_from, int reg_to); | 120 virtual void ClearRegisters(int reg_from, int reg_to); |
121 virtual void WriteStackPointerToRegister(int reg); | 121 virtual void WriteStackPointerToRegister(int reg); |
122 | 122 |
123 // Called from RegExp if the stack-guard is triggered. | 123 // Called from RegExp if the stack-guard is triggered. |
124 // If the code object is relocated, the return address is fixed before | 124 // If the code object is relocated, the return address is fixed before |
125 // returning. | 125 // returning. |
126 static int CheckStackGuardState(Address* return_address, | 126 static int CheckStackGuardState(Address* return_address, |
127 Code* re_code, | 127 Code* re_code, |
128 Address re_frame); | 128 Address re_frame); |
129 | 129 |
130 private: | 130 private: |
131 // Offsets from frame_pointer() of function parameters and stored registers. | 131 // Offsets from frame_pointer() of function parameters and stored registers. |
132 static const int kFramePointer = 0; | 132 static const int kFramePointer = 0; |
133 | 133 |
134 // Above the frame pointer - Stored registers and stack passed parameters. | 134 // Above the frame pointer - Stored registers and stack passed parameters. |
135 // Registers s0 to s7, fp, and ra. | 135 // Registers s0 to s7, fp, and ra. |
136 static const int kStoredRegisters = kFramePointer; | 136 static const int kStoredRegisters = kFramePointer; |
137 // Return address (stored from link register, read into pc on return). | 137 // Return address (stored from link register, read into pc on return). |
138 static const int kReturnAddress = kStoredRegisters + 9 * kPointerSize; | 138 static const int kReturnAddress = kStoredRegisters + 9 * kPointerSize; |
139 static const int kSecondaryReturnAddress = kReturnAddress + kPointerSize; | 139 static const int kSecondaryReturnAddress = kReturnAddress + kPointerSize; |
140 // Stack frame header. | 140 // Stack frame header. |
141 static const int kStackFrameHeader = kReturnAddress + kPointerSize; | 141 static const int kStackFrameHeader = kReturnAddress + kPointerSize; |
142 // Stack parameters placed by caller. | 142 // Stack parameters placed by caller. |
143 static const int kRegisterOutput = kStackFrameHeader + 20; | 143 static const int kRegisterOutput = kStackFrameHeader + 20; |
144 static const int kStackHighEnd = kRegisterOutput + kPointerSize; | 144 static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; |
| 145 static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; |
145 static const int kDirectCall = kStackHighEnd + kPointerSize; | 146 static const int kDirectCall = kStackHighEnd + kPointerSize; |
146 static const int kIsolate = kDirectCall + kPointerSize; | 147 static const int kIsolate = kDirectCall + kPointerSize; |
147 | 148 |
148 // Below the frame pointer. | 149 // Below the frame pointer. |
149 // Register parameters stored by setup code. | 150 // Register parameters stored by setup code. |
150 static const int kInputEnd = kFramePointer - kPointerSize; | 151 static const int kInputEnd = kFramePointer - kPointerSize; |
151 static const int kInputStart = kInputEnd - kPointerSize; | 152 static const int kInputStart = kInputEnd - kPointerSize; |
152 static const int kStartIndex = kInputStart - kPointerSize; | 153 static const int kStartIndex = kInputStart - kPointerSize; |
153 static const int kInputString = kStartIndex - kPointerSize; | 154 static const int kInputString = kStartIndex - kPointerSize; |
154 // When adding local variables remember to push space for them in | 155 // When adding local variables remember to push space for them in |
155 // the frame in GetCode. | 156 // the frame in GetCode. |
156 static const int kInputStartMinusOne = kInputString - kPointerSize; | 157 static const int kSuccessfulCaptures = kInputString - kPointerSize; |
157 static const int kAtStart = kInputStartMinusOne - kPointerSize; | 158 static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; |
158 // First register address. Following registers are below it on the stack. | 159 // First register address. Following registers are below it on the stack. |
159 static const int kRegisterZero = kAtStart - kPointerSize; | 160 static const int kRegisterZero = kInputStartMinusOne - kPointerSize; |
160 | 161 |
161 // Initial size of code buffer. | 162 // Initial size of code buffer. |
162 static const size_t kRegExpCodeSize = 1024; | 163 static const size_t kRegExpCodeSize = 1024; |
163 | 164 |
164 // Load a number of characters at the given offset from the | 165 // Load a number of characters at the given offset from the |
165 // current position, into the current-character register. | 166 // current position, into the current-character register. |
166 void LoadCurrentCharacterUnchecked(int cp_offset, int character_count); | 167 void LoadCurrentCharacterUnchecked(int cp_offset, int character_count); |
167 | 168 |
168 // Check whether preemption has been requested. | 169 // Check whether preemption has been requested. |
169 void CheckPreemption(); | 170 void CheckPreemption(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 Label stack_overflow_label_; | 258 Label stack_overflow_label_; |
258 Label internal_failure_label_; | 259 Label internal_failure_label_; |
259 }; | 260 }; |
260 | 261 |
261 #endif // V8_INTERPRETED_REGEXP | 262 #endif // V8_INTERPRETED_REGEXP |
262 | 263 |
263 | 264 |
264 }} // namespace v8::internal | 265 }} // namespace v8::internal |
265 | 266 |
266 #endif // V8_MIPS_REGEXP_MACRO_ASSEMBLER_MIPS_H_ | 267 #endif // V8_MIPS_REGEXP_MACRO_ASSEMBLER_MIPS_H_ |
OLD | NEW |