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

Unified Diff: src/x64/regexp-macro-assembler-x64.cc

Issue 1148007: Merge bleeding_edge from version 2.1.3 up to revision 4205... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: src/x64/regexp-macro-assembler-x64.cc
===================================================================
--- src/x64/regexp-macro-assembler-x64.cc (revision 4205)
+++ src/x64/regexp-macro-assembler-x64.cc (working copy)
@@ -711,9 +711,15 @@
__ movq(rdi, Operand(rbp, kInputStart));
// Set up rdi to be negative offset from string end.
__ subq(rdi, rsi);
- // Set rax to address of char before start of input
+ // Set rax to address of char before start of the string
// (effectively string position -1).
- __ lea(rax, Operand(rdi, -char_size()));
+ __ movq(rbx, Operand(rbp, kStartIndex));
+ __ neg(rbx);
+ if (mode_ == UC16) {
+ __ lea(rax, Operand(rdi, rbx, times_2, -char_size()));
+ } else {
+ __ lea(rax, Operand(rdi, rbx, times_1, -char_size()));
+ }
// Store this value in a local variable, for use when clearing
// position registers.
__ movq(Operand(rbp, kInputStartMinusOne), rax);
@@ -770,9 +776,15 @@
__ bind(&success_label_);
if (num_saved_registers_ > 0) {
// copy captures to output
+ __ movq(rdx, Operand(rbp, kStartIndex));
__ movq(rbx, Operand(rbp, kRegisterOutput));
__ movq(rcx, Operand(rbp, kInputEnd));
__ subq(rcx, Operand(rbp, kInputStart));
+ if (mode_ == UC16) {
+ __ lea(rcx, Operand(rcx, rdx, times_2, 0));
+ } else {
+ __ addq(rcx, rdx);
+ }
for (int i = 0; i < num_saved_registers_; i++) {
__ movq(rax, register_location(i));
__ addq(rax, rcx); // Convert to index from start, not end.

Powered by Google App Engine
This is Rietveld 408576698