| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 #include "src/regexp/mips64/regexp-macro-assembler-mips64.h" | 7 #include "src/regexp/mips64/regexp-macro-assembler-mips64.h" |
| 8 | 8 |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/log.h" | 10 #include "src/log.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 | 213 |
| 214 void RegExpMacroAssemblerMIPS::CheckCharacterGT(uc16 limit, Label* on_greater) { | 214 void RegExpMacroAssemblerMIPS::CheckCharacterGT(uc16 limit, Label* on_greater) { |
| 215 BranchOrBacktrack(on_greater, gt, current_character(), Operand(limit)); | 215 BranchOrBacktrack(on_greater, gt, current_character(), Operand(limit)); |
| 216 } | 216 } |
| 217 | 217 |
| 218 | 218 |
| 219 void RegExpMacroAssemblerMIPS::CheckAtStart(Label* on_at_start) { | 219 void RegExpMacroAssemblerMIPS::CheckAtStart(Label* on_at_start) { |
| 220 Label not_at_start; | 220 Label not_at_start; |
| 221 // Did we start the match at the start of the string at all? | 221 // Did we start the match at the start of the string at all? |
| 222 __ lw(a0, MemOperand(frame_pointer(), kStartIndex)); | 222 __ ld(a0, MemOperand(frame_pointer(), kStartIndex)); |
| 223 BranchOrBacktrack(¬_at_start, ne, a0, Operand(zero_reg)); | 223 BranchOrBacktrack(¬_at_start, ne, a0, Operand(zero_reg)); |
| 224 | 224 |
| 225 // If we did, are we still at the start of the input? | 225 // If we did, are we still at the start of the input? |
| 226 __ ld(a1, MemOperand(frame_pointer(), kInputStart)); | 226 __ ld(a1, MemOperand(frame_pointer(), kInputStart)); |
| 227 __ Daddu(a0, end_of_input_address(), Operand(current_input_offset())); | 227 __ Daddu(a0, end_of_input_address(), Operand(current_input_offset())); |
| 228 BranchOrBacktrack(on_at_start, eq, a0, Operand(a1)); | 228 BranchOrBacktrack(on_at_start, eq, a0, Operand(a1)); |
| 229 __ bind(¬_at_start); | 229 __ bind(¬_at_start); |
| 230 } | 230 } |
| 231 | 231 |
| 232 | 232 |
| 233 void RegExpMacroAssemblerMIPS::CheckNotAtStart(Label* on_not_at_start) { | 233 void RegExpMacroAssemblerMIPS::CheckNotAtStart(Label* on_not_at_start) { |
| 234 // Did we start the match at the start of the string at all? | 234 // Did we start the match at the start of the string at all? |
| 235 __ lw(a0, MemOperand(frame_pointer(), kStartIndex)); | 235 __ ld(a0, MemOperand(frame_pointer(), kStartIndex)); |
| 236 BranchOrBacktrack(on_not_at_start, ne, a0, Operand(zero_reg)); | 236 BranchOrBacktrack(on_not_at_start, ne, a0, Operand(zero_reg)); |
| 237 // If we did, are we still at the start of the input? | 237 // If we did, are we still at the start of the input? |
| 238 __ ld(a1, MemOperand(frame_pointer(), kInputStart)); | 238 __ ld(a1, MemOperand(frame_pointer(), kInputStart)); |
| 239 __ Daddu(a0, end_of_input_address(), Operand(current_input_offset())); | 239 __ Daddu(a0, end_of_input_address(), Operand(current_input_offset())); |
| 240 BranchOrBacktrack(on_not_at_start, ne, a0, Operand(a1)); | 240 BranchOrBacktrack(on_not_at_start, ne, a0, Operand(a1)); |
| 241 } | 241 } |
| 242 | 242 |
| 243 | 243 |
| 244 void RegExpMacroAssemblerMIPS::CheckCharacterLT(uc16 limit, Label* on_less) { | 244 void RegExpMacroAssemblerMIPS::CheckCharacterLT(uc16 limit, Label* on_less) { |
| 245 BranchOrBacktrack(on_less, lt, current_character(), Operand(limit)); | 245 BranchOrBacktrack(on_less, lt, current_character(), Operand(limit)); |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 __ sw(a2, MemOperand(a0)); | 772 __ sw(a2, MemOperand(a0)); |
| 773 __ Daddu(a0, a0, kIntSize); | 773 __ Daddu(a0, a0, kIntSize); |
| 774 __ sw(a3, MemOperand(a0)); | 774 __ sw(a3, MemOperand(a0)); |
| 775 __ Daddu(a0, a0, kIntSize); | 775 __ Daddu(a0, a0, kIntSize); |
| 776 } | 776 } |
| 777 } | 777 } |
| 778 | 778 |
| 779 if (global()) { | 779 if (global()) { |
| 780 // Restart matching if the regular expression is flagged as global. | 780 // Restart matching if the regular expression is flagged as global. |
| 781 __ ld(a0, MemOperand(frame_pointer(), kSuccessfulCaptures)); | 781 __ ld(a0, MemOperand(frame_pointer(), kSuccessfulCaptures)); |
| 782 __ lw(a1, MemOperand(frame_pointer(), kNumOutputRegisters)); | 782 __ ld(a1, MemOperand(frame_pointer(), kNumOutputRegisters)); |
| 783 __ ld(a2, MemOperand(frame_pointer(), kRegisterOutput)); | 783 __ ld(a2, MemOperand(frame_pointer(), kRegisterOutput)); |
| 784 // Increment success counter. | 784 // Increment success counter. |
| 785 __ Daddu(a0, a0, 1); | 785 __ Daddu(a0, a0, 1); |
| 786 __ sd(a0, MemOperand(frame_pointer(), kSuccessfulCaptures)); | 786 __ sd(a0, MemOperand(frame_pointer(), kSuccessfulCaptures)); |
| 787 // Capture results have been stored, so the number of remaining global | 787 // Capture results have been stored, so the number of remaining global |
| 788 // output registers is reduced by the number of stored captures. | 788 // output registers is reduced by the number of stored captures. |
| 789 __ Dsubu(a1, a1, num_saved_registers_); | 789 __ Dsubu(a1, a1, num_saved_registers_); |
| 790 // Check whether we have enough room for another set of capture results. | 790 // Check whether we have enough room for another set of capture results. |
| 791 __ mov(v0, a0); | 791 __ mov(v0, a0); |
| 792 __ Branch(&return_v0, lt, a1, Operand(num_saved_registers_)); | 792 __ Branch(&return_v0, lt, a1, Operand(num_saved_registers_)); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 static T* frame_entry_address(Address re_frame, int frame_offset) { | 1148 static T* frame_entry_address(Address re_frame, int frame_offset) { |
| 1149 return reinterpret_cast<T*>(re_frame + frame_offset); | 1149 return reinterpret_cast<T*>(re_frame + frame_offset); |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 | 1152 |
| 1153 int64_t RegExpMacroAssemblerMIPS::CheckStackGuardState(Address* return_address, | 1153 int64_t RegExpMacroAssemblerMIPS::CheckStackGuardState(Address* return_address, |
| 1154 Code* re_code, | 1154 Code* re_code, |
| 1155 Address re_frame) { | 1155 Address re_frame) { |
| 1156 return NativeRegExpMacroAssembler::CheckStackGuardState( | 1156 return NativeRegExpMacroAssembler::CheckStackGuardState( |
| 1157 frame_entry<Isolate*>(re_frame, kIsolate), | 1157 frame_entry<Isolate*>(re_frame, kIsolate), |
| 1158 frame_entry<int>(re_frame, kStartIndex), | 1158 static_cast<int>(frame_entry<int64_t>(re_frame, kStartIndex)), |
| 1159 frame_entry<int>(re_frame, kDirectCall) == 1, return_address, re_code, | 1159 frame_entry<int64_t>(re_frame, kDirectCall) == 1, return_address, re_code, |
| 1160 frame_entry_address<String*>(re_frame, kInputString), | 1160 frame_entry_address<String*>(re_frame, kInputString), |
| 1161 frame_entry_address<const byte*>(re_frame, kInputStart), | 1161 frame_entry_address<const byte*>(re_frame, kInputStart), |
| 1162 frame_entry_address<const byte*>(re_frame, kInputEnd)); | 1162 frame_entry_address<const byte*>(re_frame, kInputEnd)); |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 | 1165 |
| 1166 MemOperand RegExpMacroAssemblerMIPS::register_location(int register_index) { | 1166 MemOperand RegExpMacroAssemblerMIPS::register_location(int register_index) { |
| 1167 DCHECK(register_index < (1<<30)); | 1167 DCHECK(register_index < (1<<30)); |
| 1168 if (num_registers_ <= register_index) { | 1168 if (num_registers_ <= register_index) { |
| 1169 num_registers_ = register_index + 1; | 1169 num_registers_ = register_index + 1; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 #undef __ | 1283 #undef __ |
| 1284 | 1284 |
| 1285 #endif // V8_INTERPRETED_REGEXP | 1285 #endif // V8_INTERPRETED_REGEXP |
| 1286 | 1286 |
| 1287 } // namespace internal | 1287 } // namespace internal |
| 1288 } // namespace v8 | 1288 } // namespace v8 |
| 1289 | 1289 |
| 1290 #endif // V8_TARGET_ARCH_MIPS64 | 1290 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |