Index: src/x64/regexp-macro-assembler-x64.h |
diff --git a/src/x64/regexp-macro-assembler-x64.h b/src/x64/regexp-macro-assembler-x64.h |
index 5dfd288353b3eadfefbdf18366df27378d834e24..31fc8efd93629e1aad3d560d53482aa91b129569 100644 |
--- a/src/x64/regexp-macro-assembler-x64.h |
+++ b/src/x64/regexp-macro-assembler-x64.h |
@@ -156,7 +156,8 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler { |
static const int kRegisterOutput = kInputEnd + kPointerSize; |
// For the case of global regular expression, we have room to store at least |
// one set of capture results. For the case of non-global regexp, we ignore |
- // this value. |
+ // this value. NumOutputRegisters is passed as 32-bit value. The upper |
+ // 32 bit of this 64-bit stack slot may contain garbage. |
static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; |
static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; |
// DirectCall is passed as 32 bit int (values 0 or 1). |
@@ -195,7 +196,7 @@ class RegExpMacroAssemblerX64: public NativeRegExpMacroAssembler { |
static const int kLastCalleeSaveRegister = kBackup_rbx; |
#endif |
- static const int kSuccessfulCaptures = kBackup_rbx - kPointerSize; |
+ static const int kSuccessfulCaptures = kLastCalleeSaveRegister - kPointerSize; |
// When adding local variables remember to push space for them in |
// the frame in GetCode. |
static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; |