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

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

Issue 6066010: Merge 6095:6198 from bleeding_edge to experimental/gc. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 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/macro-assembler-x64.cc ('k') | src/x64/stub-cache-x64.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 217
218 void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str, 218 void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str,
219 int cp_offset, 219 int cp_offset,
220 Label* on_failure, 220 Label* on_failure,
221 bool check_end_of_string) { 221 bool check_end_of_string) {
222 #ifdef DEBUG 222 #ifdef DEBUG
223 // If input is ASCII, don't even bother calling here if the string to 223 // If input is ASCII, don't even bother calling here if the string to
224 // match contains a non-ascii character. 224 // match contains a non-ascii character.
225 if (mode_ == ASCII) { 225 if (mode_ == ASCII) {
226 for (int i = 0; i < str.length(); i++) { 226 ASSERT(String::IsAscii(str.start(), str.length()));
227 ASSERT(str[i] <= String::kMaxAsciiCharCodeU);
228 }
229 } 227 }
230 #endif 228 #endif
231 int byte_length = str.length() * char_size(); 229 int byte_length = str.length() * char_size();
232 int byte_offset = cp_offset * char_size(); 230 int byte_offset = cp_offset * char_size();
233 if (check_end_of_string) { 231 if (check_end_of_string) {
234 // Check that there are at least str.length() characters left in the input. 232 // Check that there are at least str.length() characters left in the input.
235 __ cmpl(rdi, Immediate(-(byte_offset + byte_length))); 233 __ cmpl(rdi, Immediate(-(byte_offset + byte_length)));
236 BranchOrBacktrack(greater, on_failure); 234 BranchOrBacktrack(greater, on_failure);
237 } 235 }
238 236
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 return true; 681 return true;
684 // No custom implementation (yet): s(UC16), S(UC16). 682 // No custom implementation (yet): s(UC16), S(UC16).
685 default: 683 default:
686 return false; 684 return false;
687 } 685 }
688 } 686 }
689 687
690 688
691 void RegExpMacroAssemblerX64::Fail() { 689 void RegExpMacroAssemblerX64::Fail() {
692 ASSERT(FAILURE == 0); // Return value for failure is zero. 690 ASSERT(FAILURE == 0); // Return value for failure is zero.
693 __ xor_(rax, rax); // zero rax. 691 __ Set(rax, 0);
694 __ jmp(&exit_label_); 692 __ jmp(&exit_label_);
695 } 693 }
696 694
697 695
698 Handle<Object> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { 696 Handle<Object> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
699 // Finalize code - write the entry point code now we know how many 697 // Finalize code - write the entry point code now we know how many
700 // registers we need. 698 // registers we need.
701 // Entry code: 699 // Entry code:
702 __ bind(&entry_label_); 700 __ bind(&entry_label_);
703 // Start new stack frame. 701 // Start new stack frame.
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 } 1373 }
1376 } 1374 }
1377 1375
1378 #undef __ 1376 #undef __
1379 1377
1380 #endif // V8_INTERPRETED_REGEXP 1378 #endif // V8_INTERPRETED_REGEXP
1381 1379
1382 }} // namespace v8::internal 1380 }} // namespace v8::internal
1383 1381
1384 #endif // V8_TARGET_ARCH_X64 1382 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698