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

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

Issue 45010: Remove all uses of StringShape variables, since that has proven... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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
« no previous file with comments | « src/heap.cc ('k') | src/jsregexp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 break; 562 break;
563 } 563 }
564 } 564 }
565 } 565 }
566 566
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(StringShape(*subject))); 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 StringShape subject_shape(*subject);
577 uc16 previous_char = '\n'; 576 uc16 previous_char = '\n';
578 if (subject_shape.IsAsciiRepresentation()) { 577 if (StringShape(*subject).IsAsciiRepresentation()) {
579 Vector<const char> subject_vector = subject->ToAsciiVector(); 578 Vector<const char> subject_vector = subject->ToAsciiVector();
580 if (start_position != 0) previous_char = subject_vector[start_position - 1]; 579 if (start_position != 0) previous_char = subject_vector[start_position - 1];
581 return RawMatch(code_base, 580 return RawMatch(code_base,
582 subject_vector, 581 subject_vector,
583 registers, 582 registers,
584 start_position, 583 start_position,
585 previous_char); 584 previous_char);
586 } else { 585 } else {
587 Vector<const uc16> subject_vector = subject->ToUC16Vector(); 586 Vector<const uc16> subject_vector = subject->ToUC16Vector();
588 if (start_position != 0) previous_char = subject_vector[start_position - 1]; 587 if (start_position != 0) previous_char = subject_vector[start_position - 1];
589 return RawMatch(code_base, 588 return RawMatch(code_base,
590 subject_vector, 589 subject_vector,
591 registers, 590 registers,
592 start_position, 591 start_position,
593 previous_char); 592 previous_char);
594 } 593 }
595 } 594 }
596 595
597 } } // namespace v8::internal 596 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/jsregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698