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

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

Issue 11759008: Introduce ENABLE_LATIN_1 compile flag (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix FilterASCII 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
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/cctest/test-api.cc » ('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 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 228
229 void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str, 229 void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str,
230 int cp_offset, 230 int cp_offset,
231 Label* on_failure, 231 Label* on_failure,
232 bool check_end_of_string) { 232 bool check_end_of_string) {
233 #ifdef DEBUG 233 #ifdef DEBUG
234 // If input is ASCII, don't even bother calling here if the string to 234 // If input is ASCII, don't even bother calling here if the string to
235 // match contains a non-ASCII character. 235 // match contains a non-ASCII character.
236 if (mode_ == ASCII) { 236 if (mode_ == ASCII) {
237 ASSERT(String::IsAscii(str.start(), str.length())); 237 ASSERT(String::IsOneByte(str.start(), str.length()));
238 } 238 }
239 #endif 239 #endif
240 int byte_length = str.length() * char_size(); 240 int byte_length = str.length() * char_size();
241 int byte_offset = cp_offset * char_size(); 241 int byte_offset = cp_offset * char_size();
242 if (check_end_of_string) { 242 if (check_end_of_string) {
243 // Check that there are at least str.length() characters left in the input. 243 // Check that there are at least str.length() characters left in the input.
244 __ cmpl(rdi, Immediate(-(byte_offset + byte_length))); 244 __ cmpl(rdi, Immediate(-(byte_offset + byte_length)));
245 BranchOrBacktrack(greater, on_failure); 245 BranchOrBacktrack(greater, on_failure);
246 } 246 }
247 247
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 __ cmpl(rax, Immediate(to - from)); 603 __ cmpl(rax, Immediate(to - from));
604 BranchOrBacktrack(above, on_not_in_range); 604 BranchOrBacktrack(above, on_not_in_range);
605 } 605 }
606 606
607 607
608 void RegExpMacroAssemblerX64::CheckBitInTable( 608 void RegExpMacroAssemblerX64::CheckBitInTable(
609 Handle<ByteArray> table, 609 Handle<ByteArray> table,
610 Label* on_bit_set) { 610 Label* on_bit_set) {
611 __ Move(rax, table); 611 __ Move(rax, table);
612 Register index = current_character(); 612 Register index = current_character();
613 if (mode_ != ASCII || kTableMask != String::kMaxAsciiCharCode) { 613 if (mode_ != ASCII || kTableMask != String::kMaxOneByteCharCode) {
614 __ movq(rbx, current_character()); 614 __ movq(rbx, current_character());
615 __ and_(rbx, Immediate(kTableMask)); 615 __ and_(rbx, Immediate(kTableMask));
616 index = rbx; 616 index = rbx;
617 } 617 }
618 __ cmpb(FieldOperand(rax, index, times_1, ByteArray::kHeaderSize), 618 __ cmpb(FieldOperand(rax, index, times_1, ByteArray::kHeaderSize),
619 Immediate(0)); 619 Immediate(0));
620 BranchOrBacktrack(not_equal, on_bit_set); 620 BranchOrBacktrack(not_equal, on_bit_set);
621 } 621 }
622 622
623 623
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 } 1535 }
1536 } 1536 }
1537 1537
1538 #undef __ 1538 #undef __
1539 1539
1540 #endif // V8_INTERPRETED_REGEXP 1540 #endif // V8_INTERPRETED_REGEXP
1541 1541
1542 }} // namespace v8::internal 1542 }} // namespace v8::internal
1543 1543
1544 #endif // V8_TARGET_ARCH_X64 1544 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698