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

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

Issue 3812012: Revert revision 5657. (Closed)
Patch Set: Created 10 years, 2 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
« no previous file with comments | « src/x64/regexp-macro-assembler-x64.h ('k') | test/mjsunit/regexp.js » ('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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 140
141 int RegExpMacroAssemblerX64::stack_limit_slack() { 141 int RegExpMacroAssemblerX64::stack_limit_slack() {
142 return RegExpStack::kStackLimitSlack; 142 return RegExpStack::kStackLimitSlack;
143 } 143 }
144 144
145 145
146 void RegExpMacroAssemblerX64::AdvanceCurrentPosition(int by) { 146 void RegExpMacroAssemblerX64::AdvanceCurrentPosition(int by) {
147 if (by != 0) { 147 if (by != 0) {
148 Label inside_string;
148 __ addq(rdi, Immediate(by * char_size())); 149 __ addq(rdi, Immediate(by * char_size()));
149 } 150 }
150 } 151 }
151 152
152 153
153 void RegExpMacroAssemblerX64::AdvanceRegister(int reg, int by) { 154 void RegExpMacroAssemblerX64::AdvanceRegister(int reg, int by) {
154 ASSERT(reg >= 0); 155 ASSERT(reg >= 0);
155 ASSERT(reg < num_registers_); 156 ASSERT(reg < num_registers_);
156 if (by != 0) { 157 if (by != 0) {
157 __ addq(register_location(reg), Immediate(by)); 158 __ addq(register_location(reg), Immediate(by));
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 __ movq(rdi, register_location(reg)); 1046 __ movq(rdi, register_location(reg));
1046 } 1047 }
1047 1048
1048 1049
1049 void RegExpMacroAssemblerX64::ReadStackPointerFromRegister(int reg) { 1050 void RegExpMacroAssemblerX64::ReadStackPointerFromRegister(int reg) {
1050 __ movq(backtrack_stackpointer(), register_location(reg)); 1051 __ movq(backtrack_stackpointer(), register_location(reg));
1051 __ addq(backtrack_stackpointer(), Operand(rbp, kStackHighEnd)); 1052 __ addq(backtrack_stackpointer(), Operand(rbp, kStackHighEnd));
1052 } 1053 }
1053 1054
1054 1055
1055 void RegExpMacroAssemblerX64::SetCurrentPositionFromEnd(int by) {
1056 NearLabel after_position;
1057 __ cmpq(rdi, Immediate(-by * char_size()));
1058 __ j(above_equal, &after_position);
1059 __ movq(rdi, Immediate(-by * char_size()));
1060 // On RegExp code entry (where this operation is used), the character before
1061 // the current position is expected to be already loaded.
1062 // We have advenced the position, so it's safe to read backwards.
1063 LoadCurrentCharacterUnchecked(-1, 1);
1064 __ bind(&after_position);
1065 }
1066
1067
1068 void RegExpMacroAssemblerX64::SetRegister(int register_index, int to) { 1056 void RegExpMacroAssemblerX64::SetRegister(int register_index, int to) {
1069 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! 1057 ASSERT(register_index >= num_saved_registers_); // Reserved for positions!
1070 __ movq(register_location(register_index), Immediate(to)); 1058 __ movq(register_location(register_index), Immediate(to));
1071 } 1059 }
1072 1060
1073 1061
1074 void RegExpMacroAssemblerX64::Succeed() { 1062 void RegExpMacroAssemblerX64::Succeed() {
1075 __ jmp(&success_label_); 1063 __ jmp(&success_label_);
1076 } 1064 }
1077 1065
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 } 1363 }
1376 } 1364 }
1377 1365
1378 #undef __ 1366 #undef __
1379 1367
1380 #endif // V8_INTERPRETED_REGEXP 1368 #endif // V8_INTERPRETED_REGEXP
1381 1369
1382 }} // namespace v8::internal 1370 }} // namespace v8::internal
1383 1371
1384 #endif // V8_TARGET_ARCH_X64 1372 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/regexp-macro-assembler-x64.h ('k') | test/mjsunit/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698