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

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

Issue 1114001: Refactoring of RegExp interface to better support calling several times in a row. (Closed)
Patch Set: Fix type that snuck into the commit. 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
« src/string.js ('K') | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/regexp-macro-assembler-x64.cc
diff --git a/src/x64/regexp-macro-assembler-x64.cc b/src/x64/regexp-macro-assembler-x64.cc
index 6e7d9c9e074fda0b487f6df5b1ef950f2e6bc3ea..3fe6be2b76a731d5500a65d3d35c3d88fb400121 100644
--- a/src/x64/regexp-macro-assembler-x64.cc
+++ b/src/x64/regexp-macro-assembler-x64.cc
@@ -711,9 +711,15 @@ Handle<Object> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
__ 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 @@ Handle<Object> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
__ 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.
« src/string.js ('K') | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698