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

Side by Side Diff: src/interpreter-irregexp.cc

Issue 100249: When strings can change from an ASCII representation to a... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 bool IrregexpInterpreter::Match(Handle<ByteArray> code_array, 568 bool IrregexpInterpreter::Match(Handle<ByteArray> code_array,
569 Handle<String> subject, 569 Handle<String> subject,
570 int* registers, 570 int* registers,
571 int start_position) { 571 int start_position) {
572 ASSERT(subject->IsFlat()); 572 ASSERT(subject->IsFlat());
573 573
574 AssertNoAllocation a; 574 AssertNoAllocation a;
575 const byte* code_base = code_array->GetDataStartAddress(); 575 const byte* code_base = code_array->GetDataStartAddress();
576 uc16 previous_char = '\n'; 576 uc16 previous_char = '\n';
577 if (StringShape(*subject).IsAsciiRepresentation()) { 577 if (subject->IsAsciiRepresentation()) {
578 Vector<const char> subject_vector = subject->ToAsciiVector(); 578 Vector<const char> subject_vector = subject->ToAsciiVector();
579 if (start_position != 0) previous_char = subject_vector[start_position - 1]; 579 if (start_position != 0) previous_char = subject_vector[start_position - 1];
580 return RawMatch(code_base, 580 return RawMatch(code_base,
581 subject_vector, 581 subject_vector,
582 registers, 582 registers,
583 start_position, 583 start_position,
584 previous_char); 584 previous_char);
585 } else { 585 } else {
586 Vector<const uc16> subject_vector = subject->ToUC16Vector(); 586 Vector<const uc16> subject_vector = subject->ToUC16Vector();
587 if (start_position != 0) previous_char = subject_vector[start_position - 1]; 587 if (start_position != 0) previous_char = subject_vector[start_position - 1];
588 return RawMatch(code_base, 588 return RawMatch(code_base,
589 subject_vector, 589 subject_vector,
590 registers, 590 registers,
591 start_position, 591 start_position,
592 previous_char); 592 previous_char);
593 } 593 }
594 } 594 }
595 595
596 } } // namespace v8::internal 596 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | src/jsregexp.cc » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698