From 7c0c72eb2c50d9acebeb3b9f51141fc8d0f872d1 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Thu, 6 Jan 2011 10:56:23 +0000 Subject: [PATCH] ARM: Fix a bug in the lithium arguments support Got the comparison wrong and fortot to actually set the flags. Review URL: http://codereview.chromium.org/6085010 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/code-stubs-arm.cc | 2 +- src/arm/lithium-codegen-arm.cc | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 9e5cc37..b6f2ab0 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -3016,7 +3016,7 @@ void ArgumentsAccessStub::GenerateReadElement(MacroAssembler* masm) { // through register r0. Use unsigned comparison to get negative // check for free. __ cmp(r1, r0); - __ b(cs, &slow); + __ b(hs, &slow); // Read the argument from the stack and return it. __ sub(r3, r0, r1); diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index c71e350..6371ecf 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -1593,8 +1593,10 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { Operand index = ToOperand(instr->index()); Register result = ToRegister(instr->result()); - __ sub(length, length, index); - DeoptimizeIf(hi, instr->environment()); + // Bailout index is not a valid argument index. Use unsigned check to get + // negative check for free. + __ sub(length, length, index, SetCC); + DeoptimizeIf(ls, instr->environment()); // There are two words between the frame pointer and the last argument. // Subtracting from length accounts for one of them add one more. -- 2.7.4