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

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

Issue 8116001: Fix bug in x64 RegExp detecting start of string. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/regexp-macro-assembler-tracer.cc ('k') | test/mjsunit/regress/regress-1748.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 void RegExpMacroAssemblerX64::CheckCharacterGT(uc16 limit, Label* on_greater) { 187 void RegExpMacroAssemblerX64::CheckCharacterGT(uc16 limit, Label* on_greater) {
188 __ cmpl(current_character(), Immediate(limit)); 188 __ cmpl(current_character(), Immediate(limit));
189 BranchOrBacktrack(greater, on_greater); 189 BranchOrBacktrack(greater, on_greater);
190 } 190 }
191 191
192 192
193 void RegExpMacroAssemblerX64::CheckAtStart(Label* on_at_start) { 193 void RegExpMacroAssemblerX64::CheckAtStart(Label* on_at_start) {
194 Label not_at_start; 194 Label not_at_start;
195 // Did we start the match at the start of the string at all? 195 // Did we start the match at the start of the string at all?
196 __ cmpb(Operand(rbp, kStartIndex), Immediate(0)); 196 __ cmpl(Operand(rbp, kStartIndex), Immediate(0));
197 BranchOrBacktrack(not_equal, &not_at_start); 197 BranchOrBacktrack(not_equal, &not_at_start);
198 // If we did, are we still at the start of the input? 198 // If we did, are we still at the start of the input?
199 __ lea(rax, Operand(rsi, rdi, times_1, 0)); 199 __ lea(rax, Operand(rsi, rdi, times_1, 0));
200 __ cmpq(rax, Operand(rbp, kInputStart)); 200 __ cmpq(rax, Operand(rbp, kInputStart));
201 BranchOrBacktrack(equal, on_at_start); 201 BranchOrBacktrack(equal, on_at_start);
202 __ bind(&not_at_start); 202 __ bind(&not_at_start);
203 } 203 }
204 204
205 205
206 void RegExpMacroAssemblerX64::CheckNotAtStart(Label* on_not_at_start) { 206 void RegExpMacroAssemblerX64::CheckNotAtStart(Label* on_not_at_start) {
207 // Did we start the match at the start of the string at all? 207 // Did we start the match at the start of the string at all?
208 __ cmpb(Operand(rbp, kStartIndex), Immediate(0)); 208 __ cmpl(Operand(rbp, kStartIndex), Immediate(0));
209 BranchOrBacktrack(not_equal, on_not_at_start); 209 BranchOrBacktrack(not_equal, on_not_at_start);
210 // If we did, are we still at the start of the input? 210 // If we did, are we still at the start of the input?
211 __ lea(rax, Operand(rsi, rdi, times_1, 0)); 211 __ lea(rax, Operand(rsi, rdi, times_1, 0));
212 __ cmpq(rax, Operand(rbp, kInputStart)); 212 __ cmpq(rax, Operand(rbp, kInputStart));
213 BranchOrBacktrack(not_equal, on_not_at_start); 213 BranchOrBacktrack(not_equal, on_not_at_start);
214 } 214 }
215 215
216 216
217 void RegExpMacroAssemblerX64::CheckCharacterLT(uc16 limit, Label* on_less) { 217 void RegExpMacroAssemblerX64::CheckCharacterLT(uc16 limit, Label* on_less) {
218 __ cmpl(current_character(), Immediate(limit)); 218 __ cmpl(current_character(), Immediate(limit));
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 } 1411 }
1412 } 1412 }
1413 1413
1414 #undef __ 1414 #undef __
1415 1415
1416 #endif // V8_INTERPRETED_REGEXP 1416 #endif // V8_INTERPRETED_REGEXP
1417 1417
1418 }} // namespace v8::internal 1418 }} // namespace v8::internal
1419 1419
1420 #endif // V8_TARGET_ARCH_X64 1420 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/regexp-macro-assembler-tracer.cc ('k') | test/mjsunit/regress/regress-1748.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698