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

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

Issue 11818025: Continues Latin-1 support. All tests pass with ENABLE_LATIN_1 flag. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM fix Created 7 years, 11 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 const byte* NativeRegExpMacroAssembler::StringCharacterPosition( 73 const byte* NativeRegExpMacroAssembler::StringCharacterPosition(
74 String* subject, 74 String* subject,
75 int start_index) { 75 int start_index) {
76 // Not just flat, but ultra flat. 76 // Not just flat, but ultra flat.
77 ASSERT(subject->IsExternalString() || subject->IsSeqString()); 77 ASSERT(subject->IsExternalString() || subject->IsSeqString());
78 ASSERT(start_index >= 0); 78 ASSERT(start_index >= 0);
79 ASSERT(start_index <= subject->length()); 79 ASSERT(start_index <= subject->length());
80 if (subject->IsOneByteRepresentation()) { 80 if (subject->IsOneByteRepresentation()) {
81 const byte* address; 81 const byte* address;
82 if (StringShape(subject).IsExternal()) { 82 if (StringShape(subject).IsExternal()) {
83 const char* data = ExternalAsciiString::cast(subject)->GetChars(); 83 const uint8_t* data = ExternalAsciiString::cast(subject)->GetChars();
84 address = reinterpret_cast<const byte*>(data); 84 address = reinterpret_cast<const byte*>(data);
85 } else { 85 } else {
86 ASSERT(subject->IsSeqOneByteString()); 86 ASSERT(subject->IsSeqOneByteString());
87 char* data = SeqOneByteString::cast(subject)->GetChars(); 87 const uint8_t* data = SeqOneByteString::cast(subject)->GetChars();
88 address = reinterpret_cast<const byte*>(data); 88 address = reinterpret_cast<const byte*>(data);
89 } 89 }
90 return address + start_index; 90 return address + start_index;
91 } 91 }
92 const uc16* data; 92 const uc16* data;
93 if (StringShape(subject).IsExternal()) { 93 if (StringShape(subject).IsExternal()) {
94 data = ExternalTwoByteString::cast(subject)->GetChars(); 94 data = ExternalTwoByteString::cast(subject)->GetChars();
95 } else { 95 } else {
96 ASSERT(subject->IsSeqTwoByteString()); 96 ASSERT(subject->IsSeqTwoByteString());
97 data = SeqTwoByteString::cast(subject)->GetChars(); 97 data = SeqTwoByteString::cast(subject)->GetChars();
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 return NULL; 263 return NULL;
264 } 264 }
265 *stack_base = new_stack_base; 265 *stack_base = new_stack_base;
266 intptr_t stack_content_size = old_stack_base - stack_pointer; 266 intptr_t stack_content_size = old_stack_base - stack_pointer;
267 return new_stack_base - stack_content_size; 267 return new_stack_base - stack_content_size;
268 } 268 }
269 269
270 #endif // V8_INTERPRETED_REGEXP 270 #endif // V8_INTERPRETED_REGEXP
271 271
272 } } // namespace v8::internal 272 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698