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

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

Issue 559913002: Rename ascii to one-byte where applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 // A simple interpreter for the Irregexp byte code. 5 // A simple interpreter for the Irregexp byte code.
6 6
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/ast.h" 10 #include "src/ast.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 Handle<ByteArray> code_array, 577 Handle<ByteArray> code_array,
578 Handle<String> subject, 578 Handle<String> subject,
579 int* registers, 579 int* registers,
580 int start_position) { 580 int start_position) {
581 DCHECK(subject->IsFlat()); 581 DCHECK(subject->IsFlat());
582 582
583 DisallowHeapAllocation no_gc; 583 DisallowHeapAllocation no_gc;
584 const byte* code_base = code_array->GetDataStartAddress(); 584 const byte* code_base = code_array->GetDataStartAddress();
585 uc16 previous_char = '\n'; 585 uc16 previous_char = '\n';
586 String::FlatContent subject_content = subject->GetFlatContent(); 586 String::FlatContent subject_content = subject->GetFlatContent();
587 if (subject_content.IsAscii()) { 587 if (subject_content.IsOneByte()) {
588 Vector<const uint8_t> subject_vector = subject_content.ToOneByteVector(); 588 Vector<const uint8_t> subject_vector = subject_content.ToOneByteVector();
589 if (start_position != 0) previous_char = subject_vector[start_position - 1]; 589 if (start_position != 0) previous_char = subject_vector[start_position - 1];
590 return RawMatch(isolate, 590 return RawMatch(isolate,
591 code_base, 591 code_base,
592 subject_vector, 592 subject_vector,
593 registers, 593 registers,
594 start_position, 594 start_position,
595 previous_char); 595 previous_char);
596 } else { 596 } else {
597 DCHECK(subject_content.IsTwoByte()); 597 DCHECK(subject_content.IsTwoByte());
598 Vector<const uc16> subject_vector = subject_content.ToUC16Vector(); 598 Vector<const uc16> subject_vector = subject_content.ToUC16Vector();
599 if (start_position != 0) previous_char = subject_vector[start_position - 1]; 599 if (start_position != 0) previous_char = subject_vector[start_position - 1];
600 return RawMatch(isolate, 600 return RawMatch(isolate,
601 code_base, 601 code_base,
602 subject_vector, 602 subject_vector,
603 registers, 603 registers,
604 start_position, 604 start_position,
605 previous_char); 605 previous_char);
606 } 606 }
607 } 607 }
608 608
609 } } // namespace v8::internal 609 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | src/isolate.cc » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698