Fix argument passing to generated regexp code in Win64.
R=erik.corry@gmail.com BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10417049 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11631 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
7412d9adbe
commit
30e7c23afd
@ -803,7 +803,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
|
||||
#endif
|
||||
|
||||
__ push(Immediate(0)); // Number of successful matches in a global regexp.
|
||||
__ push(Immediate(0)); // Make room for "at start" constant.
|
||||
__ push(Immediate(0)); // Make room for "input start - 1" constant.
|
||||
|
||||
// Check if we have space on the stack for registers.
|
||||
Label stack_limit_hit;
|
||||
@ -872,7 +872,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
|
||||
|
||||
Label load_char_start_regexp, start_regexp;
|
||||
// Load newline if index is at start, previous character otherwise.
|
||||
__ cmpb(Operand(rbp, kStartIndex), Immediate(0));
|
||||
__ cmpl(Operand(rbp, kStartIndex), Immediate(0));
|
||||
__ j(not_equal, &load_char_start_regexp, Label::kNear);
|
||||
__ Set(current_character(), '\n');
|
||||
__ jmp(&start_regexp, Label::kNear);
|
||||
@ -944,7 +944,7 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
|
||||
__ incq(Operand(rbp, kSuccessfulCaptures));
|
||||
// Capture results have been stored, so the number of remaining global
|
||||
// output registers is reduced by the number of stored captures.
|
||||
__ movq(rcx, Operand(rbp, kNumOutputRegisters));
|
||||
__ movsxlq(rcx, Operand(rbp, kNumOutputRegisters));
|
||||
__ subq(rcx, Immediate(num_saved_registers_));
|
||||
// Check whether we have enough room for another set of capture results.
|
||||
__ cmpq(rcx, Immediate(num_saved_registers_));
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user