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

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

Issue 1451373003: Revert of Experimental support for RegExp lookbehind. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 2008-2009 the V8 project authors. All rights reserved. 1 // Copyright 2008-2009 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 #include "src/regexp/regexp-macro-assembler-irregexp.h" 5 #include "src/regexp/regexp-macro-assembler-irregexp.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/regexp/bytecodes-irregexp.h" 8 #include "src/regexp/bytecodes-irregexp.h"
9 #include "src/regexp/regexp-macro-assembler.h" 9 #include "src/regexp/regexp-macro-assembler.h"
10 #include "src/regexp/regexp-macro-assembler-irregexp-inl.h" 10 #include "src/regexp/regexp-macro-assembler-irregexp-inl.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 EmitOrLink(on_equal); 266 EmitOrLink(on_equal);
267 } 267 }
268 268
269 269
270 void RegExpMacroAssemblerIrregexp::CheckAtStart(Label* on_at_start) { 270 void RegExpMacroAssemblerIrregexp::CheckAtStart(Label* on_at_start) {
271 Emit(BC_CHECK_AT_START, 0); 271 Emit(BC_CHECK_AT_START, 0);
272 EmitOrLink(on_at_start); 272 EmitOrLink(on_at_start);
273 } 273 }
274 274
275 275
276 void RegExpMacroAssemblerIrregexp::CheckNotAtStart(int cp_offset, 276 void RegExpMacroAssemblerIrregexp::CheckNotAtStart(Label* on_not_at_start) {
277 Label* on_not_at_start) { 277 Emit(BC_CHECK_NOT_AT_START, 0);
278 Emit(BC_CHECK_NOT_AT_START, cp_offset);
279 EmitOrLink(on_not_at_start); 278 EmitOrLink(on_not_at_start);
280 } 279 }
281 280
282 281
283 void RegExpMacroAssemblerIrregexp::CheckNotCharacter(uint32_t c, 282 void RegExpMacroAssemblerIrregexp::CheckNotCharacter(uint32_t c,
284 Label* on_not_equal) { 283 Label* on_not_equal) {
285 if (c > MAX_FIRST_ARG) { 284 if (c > MAX_FIRST_ARG) {
286 Emit(BC_CHECK_NOT_4_CHARS, 0); 285 Emit(BC_CHECK_NOT_4_CHARS, 0);
287 Emit32(c); 286 Emit32(c);
288 } else { 287 } else {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 int byte = 0; 363 int byte = 0;
365 for (int j = 0; j < kBitsPerByte; j++) { 364 for (int j = 0; j < kBitsPerByte; j++) {
366 if (table->get(i + j) != 0) byte |= 1 << j; 365 if (table->get(i + j) != 0) byte |= 1 << j;
367 } 366 }
368 Emit8(byte); 367 Emit8(byte);
369 } 368 }
370 } 369 }
371 370
372 371
373 void RegExpMacroAssemblerIrregexp::CheckNotBackReference(int start_reg, 372 void RegExpMacroAssemblerIrregexp::CheckNotBackReference(int start_reg,
374 bool read_backward,
375 Label* on_not_equal) { 373 Label* on_not_equal) {
376 DCHECK(start_reg >= 0); 374 DCHECK(start_reg >= 0);
377 DCHECK(start_reg <= kMaxRegister); 375 DCHECK(start_reg <= kMaxRegister);
378 Emit(read_backward ? BC_CHECK_NOT_BACK_REF_BACKWARD : BC_CHECK_NOT_BACK_REF, 376 Emit(BC_CHECK_NOT_BACK_REF, start_reg);
379 start_reg);
380 EmitOrLink(on_not_equal); 377 EmitOrLink(on_not_equal);
381 } 378 }
382 379
383 380
384 void RegExpMacroAssemblerIrregexp::CheckNotBackReferenceIgnoreCase( 381 void RegExpMacroAssemblerIrregexp::CheckNotBackReferenceIgnoreCase(
385 int start_reg, bool read_backward, Label* on_not_equal) { 382 int start_reg,
383 Label* on_not_equal) {
386 DCHECK(start_reg >= 0); 384 DCHECK(start_reg >= 0);
387 DCHECK(start_reg <= kMaxRegister); 385 DCHECK(start_reg <= kMaxRegister);
388 Emit(read_backward ? BC_CHECK_NOT_BACK_REF_NO_CASE_BACKWARD 386 Emit(BC_CHECK_NOT_BACK_REF_NO_CASE, start_reg);
389 : BC_CHECK_NOT_BACK_REF_NO_CASE,
390 start_reg);
391 EmitOrLink(on_not_equal); 387 EmitOrLink(on_not_equal);
392 } 388 }
393 389
394 390
395 void RegExpMacroAssemblerIrregexp::IfRegisterLT(int register_index, 391 void RegExpMacroAssemblerIrregexp::IfRegisterLT(int register_index,
396 int comparand, 392 int comparand,
397 Label* on_less_than) { 393 Label* on_less_than) {
398 DCHECK(register_index >= 0); 394 DCHECK(register_index >= 0);
399 DCHECK(register_index <= kMaxRegister); 395 DCHECK(register_index <= kMaxRegister);
400 Emit(BC_CHECK_REGISTER_LT, register_index); 396 Emit(BC_CHECK_REGISTER_LT, register_index);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length()); 447 MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length());
452 if (old_buffer_was_our_own) { 448 if (old_buffer_was_our_own) {
453 old_buffer.Dispose(); 449 old_buffer.Dispose();
454 } 450 }
455 } 451 }
456 452
457 #endif // V8_INTERPRETED_REGEXP 453 #endif // V8_INTERPRETED_REGEXP
458 454
459 } // namespace internal 455 } // namespace internal
460 } // namespace v8 456 } // namespace v8
OLDNEW
« no previous file with comments | « src/regexp/regexp-macro-assembler-irregexp.h ('k') | src/regexp/regexp-macro-assembler-tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698