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

Side by Side Diff: src/regexp/arm/regexp-macro-assembler-arm.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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/regexp/arm/regexp-macro-assembler-arm.h" 7 #include "src/regexp/arm/regexp-macro-assembler-arm.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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 void RegExpMacroAssemblerARM::CheckGreedyLoop(Label* on_equal) { 203 void RegExpMacroAssemblerARM::CheckGreedyLoop(Label* on_equal) {
204 __ ldr(r0, MemOperand(backtrack_stackpointer(), 0)); 204 __ ldr(r0, MemOperand(backtrack_stackpointer(), 0));
205 __ cmp(current_input_offset(), r0); 205 __ cmp(current_input_offset(), r0);
206 __ add(backtrack_stackpointer(), 206 __ add(backtrack_stackpointer(),
207 backtrack_stackpointer(), Operand(kPointerSize), LeaveCC, eq); 207 backtrack_stackpointer(), Operand(kPointerSize), LeaveCC, eq);
208 BranchOrBacktrack(eq, on_equal); 208 BranchOrBacktrack(eq, on_equal);
209 } 209 }
210 210
211 211
212 void RegExpMacroAssemblerARM::CheckNotBackReferenceIgnoreCase( 212 void RegExpMacroAssemblerARM::CheckNotBackReferenceIgnoreCase(
213 int start_reg, bool read_backward, Label* on_no_match) { 213 int start_reg, bool read_backward, bool unicode, Label* on_no_match) {
214 Label fallthrough; 214 Label fallthrough;
215 __ ldr(r0, register_location(start_reg)); // Index of start of capture 215 __ ldr(r0, register_location(start_reg)); // Index of start of capture
216 __ ldr(r1, register_location(start_reg + 1)); // Index of end of capture 216 __ ldr(r1, register_location(start_reg + 1)); // Index of end of capture
217 __ sub(r1, r1, r0, SetCC); // Length of capture. 217 __ sub(r1, r1, r0, SetCC); // Length of capture.
218 218
219 // At this point, the capture registers are either both set or both cleared. 219 // At this point, the capture registers are either both set or both cleared.
220 // If the capture length is zero, then the capture is either empty or cleared. 220 // If the capture length is zero, then the capture is either empty or cleared.
221 // Fall through in both cases. 221 // Fall through in both cases.
222 __ b(eq, &fallthrough); 222 __ b(eq, &fallthrough);
223 223
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 __ PrepareCallCFunction(argument_count, r2); 295 __ PrepareCallCFunction(argument_count, r2);
296 296
297 // r0 - offset of start of capture 297 // r0 - offset of start of capture
298 // r1 - length of capture 298 // r1 - length of capture
299 299
300 // Put arguments into arguments registers. 300 // Put arguments into arguments registers.
301 // Parameters are 301 // Parameters are
302 // r0: Address byte_offset1 - Address captured substring's start. 302 // r0: Address byte_offset1 - Address captured substring's start.
303 // r1: Address byte_offset2 - Address of current character position. 303 // r1: Address byte_offset2 - Address of current character position.
304 // r2: size_t byte_length - length of capture in bytes(!) 304 // r2: size_t byte_length - length of capture in bytes(!)
305 // r3: Isolate* isolate 305 // r3: Isolate* isolate or 0 if unicode flag.
306 306
307 // Address of start of capture. 307 // Address of start of capture.
308 __ add(r0, r0, Operand(end_of_input_address())); 308 __ add(r0, r0, Operand(end_of_input_address()));
309 // Length of capture. 309 // Length of capture.
310 __ mov(r2, Operand(r1)); 310 __ mov(r2, Operand(r1));
311 // Save length in callee-save register for use on return. 311 // Save length in callee-save register for use on return.
312 __ mov(r4, Operand(r1)); 312 __ mov(r4, Operand(r1));
313 // Address of current input position. 313 // Address of current input position.
314 __ add(r1, current_input_offset(), end_of_input_address()); 314 __ add(r1, current_input_offset(), end_of_input_address());
315 if (read_backward) { 315 if (read_backward) {
316 __ sub(r1, r1, r4); 316 __ sub(r1, r1, r4);
317 } 317 }
318 // Isolate. 318 // Isolate.
319 __ mov(r3, Operand(ExternalReference::isolate_address(isolate()))); 319 #ifdef V8_I18N_SUPPORT
320 if (unicode) {
321 __ mov(r3, Operand(0));
322 } else // NOLINT
323 #endif // V8_I18N_SUPPORT
324 {
325 __ mov(r3, Operand(ExternalReference::isolate_address(isolate())));
326 }
320 327
321 { 328 {
322 AllowExternalCallThatCantCauseGC scope(masm_); 329 AllowExternalCallThatCantCauseGC scope(masm_);
323 ExternalReference function = 330 ExternalReference function =
324 ExternalReference::re_case_insensitive_compare_uc16(isolate()); 331 ExternalReference::re_case_insensitive_compare_uc16(isolate());
325 __ CallCFunction(function, argument_count); 332 __ CallCFunction(function, argument_count);
326 } 333 }
327 334
328 // Check if function returned non-zero for success or zero for failure. 335 // Check if function returned non-zero for success or zero for failure.
329 __ cmp(r0, Operand::Zero()); 336 __ cmp(r0, Operand::Zero());
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 1240
1234 1241
1235 #undef __ 1242 #undef __
1236 1243
1237 #endif // V8_INTERPRETED_REGEXP 1244 #endif // V8_INTERPRETED_REGEXP
1238 1245
1239 } // namespace internal 1246 } // namespace internal
1240 } // namespace v8 1247 } // namespace v8
1241 1248
1242 #endif // V8_TARGET_ARCH_ARM 1249 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698