OLD | NEW |
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-2009 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 void RegExpMacroAssemblerIrregexp::CheckNotBackReferenceIgnoreCase( | 403 void RegExpMacroAssemblerIrregexp::CheckNotBackReferenceIgnoreCase( |
404 int start_reg, | 404 int start_reg, |
405 Label* on_not_equal) { | 405 Label* on_not_equal) { |
406 ASSERT(start_reg >= 0); | 406 ASSERT(start_reg >= 0); |
407 ASSERT(start_reg <= kMaxRegister); | 407 ASSERT(start_reg <= kMaxRegister); |
408 Emit(BC_CHECK_NOT_BACK_REF_NO_CASE, start_reg); | 408 Emit(BC_CHECK_NOT_BACK_REF_NO_CASE, start_reg); |
409 EmitOrLink(on_not_equal); | 409 EmitOrLink(on_not_equal); |
410 } | 410 } |
411 | 411 |
412 | 412 |
413 void RegExpMacroAssemblerIrregexp::CheckCharacters( | |
414 Vector<const uc16> str, | |
415 int cp_offset, | |
416 Label* on_failure, | |
417 bool check_end_of_string) { | |
418 ASSERT(cp_offset >= kMinCPOffset); | |
419 ASSERT(cp_offset + str.length() - 1 <= kMaxCPOffset); | |
420 // It is vital that this loop is backwards due to the unchecked character | |
421 // load below. | |
422 for (int i = str.length() - 1; i >= 0; i--) { | |
423 if (check_end_of_string && i == str.length() - 1) { | |
424 Emit(BC_LOAD_CURRENT_CHAR, cp_offset + i); | |
425 EmitOrLink(on_failure); | |
426 } else { | |
427 Emit(BC_LOAD_CURRENT_CHAR_UNCHECKED, cp_offset + i); | |
428 } | |
429 Emit(BC_CHECK_NOT_CHAR, str[i]); | |
430 EmitOrLink(on_failure); | |
431 } | |
432 } | |
433 | |
434 | |
435 void RegExpMacroAssemblerIrregexp::IfRegisterLT(int register_index, | 413 void RegExpMacroAssemblerIrregexp::IfRegisterLT(int register_index, |
436 int comparand, | 414 int comparand, |
437 Label* on_less_than) { | 415 Label* on_less_than) { |
438 ASSERT(register_index >= 0); | 416 ASSERT(register_index >= 0); |
439 ASSERT(register_index <= kMaxRegister); | 417 ASSERT(register_index <= kMaxRegister); |
440 Emit(BC_CHECK_REGISTER_LT, register_index); | 418 Emit(BC_CHECK_REGISTER_LT, register_index); |
441 Emit32(comparand); | 419 Emit32(comparand); |
442 EmitOrLink(on_less_than); | 420 EmitOrLink(on_less_than); |
443 } | 421 } |
444 | 422 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 own_buffer_ = true; | 468 own_buffer_ = true; |
491 OS::MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length()); | 469 OS::MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length()); |
492 if (old_buffer_was_our_own) { | 470 if (old_buffer_was_our_own) { |
493 old_buffer.Dispose(); | 471 old_buffer.Dispose(); |
494 } | 472 } |
495 } | 473 } |
496 | 474 |
497 #endif // V8_INTERPRETED_REGEXP | 475 #endif // V8_INTERPRETED_REGEXP |
498 | 476 |
499 } } // namespace v8::internal | 477 } } // namespace v8::internal |
OLD | NEW |