Reviewers: Vyacheslav Egorov, Description: Fixing a performance bug introduced in r4581.
Please review this at http://codereview.chromium.org/1910005/show SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/arm/codegen-arm.cc M src/ia32/codegen-ia32.cc M src/x64/codegen-x64.cc Index: src/ia32/codegen-ia32.cc =================================================================== --- src/ia32/codegen-ia32.cc (revision 4596) +++ src/ia32/codegen-ia32.cc (working copy) @@ -10952,13 +10952,14 @@ // ebx: Length of subject string as a smi // ecx: RegExp data (FixedArray) // edx: Number of capture registers - // Check that the third argument is a positive smi less than the subject - // string length. A negative value will be greater (unsigned comparison). + // Check that the third argument is a positive smi not greater than the + // subject string length. A negative value will be greater (unsigned + // comparison). __ mov(eax, Operand(esp, kPreviousIndexOffset)); __ test(eax, Immediate(kSmiTagMask)); - __ j(zero, &runtime); + __ j(not_zero, &runtime); __ cmp(eax, Operand(ebx)); - __ j(above_equal, &runtime); + __ j(above, &runtime); // ecx: RegExp data (FixedArray) // edx: Number of capture registers Index: src/x64/codegen-x64.cc =================================================================== --- src/x64/codegen-x64.cc (revision 4596) +++ src/x64/codegen-x64.cc (working copy) @@ -8133,12 +8133,13 @@ // rbx: Length of subject string as smi // rcx: RegExp data (FixedArray) // rdx: Number of capture registers - // Check that the third argument is a positive smi less than the string - // length. A negative value will be greater (unsigned comparison). + // Check that the third argument is a positive smi not greater than the + // subject string length. A negative value will be greater (unsigned + // comparison). __ movq(rax, Operand(rsp, kPreviousIndexOffset)); __ JumpIfNotSmi(rax, &runtime); __ SmiCompare(rax, rbx); - __ j(above_equal, &runtime); + __ j(above, &runtime); // rcx: RegExp data (FixedArray) // rdx: Number of capture registers Index: src/arm/codegen-arm.cc =================================================================== --- src/arm/codegen-arm.cc (revision 4596) +++ src/arm/codegen-arm.cc (working copy) @@ -8497,13 +8497,14 @@ // r3: Length of subject string as a smi // subject: Subject string // regexp_data: RegExp data (FixedArray) - // Check that the third argument is a positive smi less than the subject - // string length. A negative value will be greater (unsigned comparison). + // Check that the third argument is a positive smi not greater than the + // subject string length. A negative value will be greater (unsigned + // comparison). __ ldr(r0, MemOperand(sp, kPreviousIndexOffset)); __ tst(r0, Operand(kSmiTagMask)); - __ b(eq, &runtime); + __ b(ne, &runtime); __ cmp(r3, Operand(r0)); - __ b(le, &runtime); + __ b(ls, &runtime); // r2: Number of capture registers // subject: Subject string -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
