Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: src/regexp/mips/regexp-macro-assembler-mips.cc

Issue 1599303002: [regexp] implement case-insensitive unicode regexps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@unicodeclass
Patch Set: fixes Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/regexp/mips/regexp-macro-assembler-mips.h" 7 #include "src/regexp/mips/regexp-macro-assembler-mips.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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 __ Branch(&backtrack_non_equal, ne, current_input_offset(), Operand(a0)); 208 __ Branch(&backtrack_non_equal, ne, current_input_offset(), Operand(a0));
209 __ Addu(backtrack_stackpointer(), 209 __ Addu(backtrack_stackpointer(),
210 backtrack_stackpointer(), 210 backtrack_stackpointer(),
211 Operand(kPointerSize)); 211 Operand(kPointerSize));
212 __ bind(&backtrack_non_equal); 212 __ bind(&backtrack_non_equal);
213 BranchOrBacktrack(on_equal, eq, current_input_offset(), Operand(a0)); 213 BranchOrBacktrack(on_equal, eq, current_input_offset(), Operand(a0));
214 } 214 }
215 215
216 216
217 void RegExpMacroAssemblerMIPS::CheckNotBackReferenceIgnoreCase( 217 void RegExpMacroAssemblerMIPS::CheckNotBackReferenceIgnoreCase(
218 int start_reg, bool read_backward, Label* on_no_match) { 218 int start_reg, bool read_backward, bool unicode, Label* on_no_match) {
219 Label fallthrough; 219 Label fallthrough;
220 __ lw(a0, register_location(start_reg)); // Index of start of capture. 220 __ lw(a0, register_location(start_reg)); // Index of start of capture.
221 __ lw(a1, register_location(start_reg + 1)); // Index of end of capture. 221 __ lw(a1, register_location(start_reg + 1)); // Index of end of capture.
222 __ Subu(a1, a1, a0); // Length of capture. 222 __ Subu(a1, a1, a0); // Length of capture.
223 223
224 // At this point, the capture registers are either both set or both cleared. 224 // At this point, the capture registers are either both set or both cleared.
225 // If the capture length is zero, then the capture is either empty or cleared. 225 // If the capture length is zero, then the capture is either empty or cleared.
226 // Fall through in both cases. 226 // Fall through in both cases.
227 __ Branch(&fallthrough, eq, a1, Operand(zero_reg)); 227 __ Branch(&fallthrough, eq, a1, Operand(zero_reg));
228 228
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 __ PrepareCallCFunction(argument_count, a2); 303 __ PrepareCallCFunction(argument_count, a2);
304 304
305 // a0 - offset of start of capture. 305 // a0 - offset of start of capture.
306 // a1 - length of capture. 306 // a1 - length of capture.
307 307
308 // Put arguments into arguments registers. 308 // Put arguments into arguments registers.
309 // Parameters are 309 // Parameters are
310 // a0: Address byte_offset1 - Address captured substring's start. 310 // a0: Address byte_offset1 - Address captured substring's start.
311 // a1: Address byte_offset2 - Address of current character position. 311 // a1: Address byte_offset2 - Address of current character position.
312 // a2: size_t byte_length - length of capture in bytes(!). 312 // a2: size_t byte_length - length of capture in bytes(!).
313 // a3: Isolate* isolate. 313 // a3: Isolate* isolate or 0 if unicode flag.
314 314
315 // Address of start of capture. 315 // Address of start of capture.
316 __ Addu(a0, a0, Operand(end_of_input_address())); 316 __ Addu(a0, a0, Operand(end_of_input_address()));
317 // Length of capture. 317 // Length of capture.
318 __ mov(a2, a1); 318 __ mov(a2, a1);
319 // Save length in callee-save register for use on return. 319 // Save length in callee-save register for use on return.
320 __ mov(s3, a1); 320 __ mov(s3, a1);
321 // Address of current input position. 321 // Address of current input position.
322 __ Addu(a1, current_input_offset(), Operand(end_of_input_address())); 322 __ Addu(a1, current_input_offset(), Operand(end_of_input_address()));
323 if (read_backward) { 323 if (read_backward) {
324 __ Subu(a1, a1, Operand(s3)); 324 __ Subu(a1, a1, Operand(s3));
325 } 325 }
326 // Isolate. 326 // Isolate.
327 __ li(a3, Operand(ExternalReference::isolate_address(masm_->isolate()))); 327 #ifdef V8_I18N_SUPPORT
328 if (unicode) {
329 __ li(a3, Operand(zero_reg));
330 } else // NOLINT
331 #endif // V8_I18N_SUPPORT
332 {
333 __ li(a3, Operand(ExternalReference::isolate_address(masm_->isolate())));
334 }
328 335
329 { 336 {
330 AllowExternalCallThatCantCauseGC scope(masm_); 337 AllowExternalCallThatCantCauseGC scope(masm_);
331 ExternalReference function = 338 ExternalReference function =
332 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); 339 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate());
333 __ CallCFunction(function, argument_count); 340 __ CallCFunction(function, argument_count);
334 } 341 }
335 342
336 // Restore regexp engine registers. 343 // Restore regexp engine registers.
337 __ MultiPop(regexp_registers_to_retain); 344 __ MultiPop(regexp_registers_to_retain);
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 1288
1282 1289
1283 #undef __ 1290 #undef __
1284 1291
1285 #endif // V8_INTERPRETED_REGEXP 1292 #endif // V8_INTERPRETED_REGEXP
1286 1293
1287 } // namespace internal 1294 } // namespace internal
1288 } // namespace v8 1295 } // namespace v8
1289 1296
1290 #endif // V8_TARGET_ARCH_MIPS 1297 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698