From 1bdc421adfa1939e7ae6028ed55831cbb7959a99 Mon Sep 17 00:00:00 2001 From: "Jacob.Bramley@arm.com" Date: Thu, 24 Apr 2014 14:55:28 +0000 Subject: [PATCH] ARM64: Slightly improve MacroAssembler::Allocate. BUG= R=ulan@chromium.org Review URL: https://codereview.chromium.org/247533005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20946 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm64/constants-arm64.h | 4 ++-- src/arm64/lithium-codegen-arm64.cc | 8 ++++---- src/arm64/lithium-codegen-arm64.h | 2 +- src/arm64/macro-assembler-arm64.cc | 10 ++++------ src/arm64/macro-assembler-arm64.h | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/arm64/constants-arm64.h b/src/arm64/constants-arm64.h index 8866e23cf..f856a1b43 100644 --- a/src/arm64/constants-arm64.h +++ b/src/arm64/constants-arm64.h @@ -262,8 +262,8 @@ const int ImmPCRel_mask = ImmPCRelLo_mask | ImmPCRelHi_mask; enum Condition { eq = 0, ne = 1, - hs = 2, - lo = 3, + hs = 2, cs = hs, + lo = 3, cc = lo, mi = 4, pl = 5, vs = 6, diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc index 3f0e814d3..8f5b81182 100644 --- a/src/arm64/lithium-codegen-arm64.cc +++ b/src/arm64/lithium-codegen-arm64.cc @@ -1778,23 +1778,23 @@ void LCodeGen::DoBitS(LBitS* instr) { void LCodeGen::DoBoundsCheck(LBoundsCheck *instr) { - Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; + Condition cond = instr->hydrogen()->allow_equality() ? hi : hs; ASSERT(instr->hydrogen()->index()->representation().IsInteger32()); ASSERT(instr->hydrogen()->length()->representation().IsInteger32()); if (instr->index()->IsConstantOperand()) { Operand index = ToOperand32I(instr->index()); Register length = ToRegister32(instr->length()); __ Cmp(length, index); - cc = ReverseConditionForCmp(cc); + cond = ReverseConditionForCmp(cond); } else { Register index = ToRegister32(instr->index()); Operand length = ToOperand32I(instr->length()); __ Cmp(index, length); } if (FLAG_debug_code && instr->hydrogen()->skip_check()) { - __ Assert(InvertCondition(cc), kEliminatedBoundsCheckFailed); + __ Assert(InvertCondition(cond), kEliminatedBoundsCheckFailed); } else { - DeoptimizeIf(cc, instr->environment()); + DeoptimizeIf(cond, instr->environment()); } } diff --git a/src/arm64/lithium-codegen-arm64.h b/src/arm64/lithium-codegen-arm64.h index 79d6b503d..d6fe74f17 100644 --- a/src/arm64/lithium-codegen-arm64.h +++ b/src/arm64/lithium-codegen-arm64.h @@ -228,7 +228,7 @@ class LCodeGen: public LCodeGenBase { Deoptimizer::BailoutType* override_bailout_type = NULL); void Deoptimize(LEnvironment* environment, Deoptimizer::BailoutType* override_bailout_type = NULL); - void DeoptimizeIf(Condition cc, LEnvironment* environment); + void DeoptimizeIf(Condition cond, LEnvironment* environment); void DeoptimizeIfZero(Register rt, LEnvironment* environment); void DeoptimizeIfNotZero(Register rt, LEnvironment* environment); void DeoptimizeIfNegative(Register rt, LEnvironment* environment); diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc index c0efe9f7a..303a37896 100644 --- a/src/arm64/macro-assembler-arm64.cc +++ b/src/arm64/macro-assembler-arm64.cc @@ -1537,9 +1537,9 @@ void MacroAssembler::Throw(BailoutReason reason) { } -void MacroAssembler::ThrowIf(Condition cc, BailoutReason reason) { +void MacroAssembler::ThrowIf(Condition cond, BailoutReason reason) { Label ok; - B(InvertCondition(cc), &ok); + B(InvertCondition(cond), &ok); Throw(reason); Bind(&ok); } @@ -3311,8 +3311,7 @@ void MacroAssembler::Allocate(int object_size, // Calculate new top and bail out if new space is exhausted. Adds(scratch3, result, object_size); - B(vs, gc_required); - Cmp(scratch3, allocation_limit); + Ccmp(scratch3, allocation_limit, CFlag, cc); B(hi, gc_required); Str(scratch3, MemOperand(top_address)); @@ -3393,8 +3392,7 @@ void MacroAssembler::Allocate(Register object_size, Check(eq, kUnalignedAllocationInNewSpace); } - B(vs, gc_required); - Cmp(scratch3, allocation_limit); + Ccmp(scratch3, allocation_limit, CFlag, cc); B(hi, gc_required); Str(scratch3, MemOperand(top_address)); diff --git a/src/arm64/macro-assembler-arm64.h b/src/arm64/macro-assembler-arm64.h index 904cf50f1..c1f82a722 100644 --- a/src/arm64/macro-assembler-arm64.h +++ b/src/arm64/macro-assembler-arm64.h @@ -1068,7 +1068,7 @@ class MacroAssembler : public Assembler { void Throw(BailoutReason reason); // Throw a message string as an exception if a condition is not true. - void ThrowIf(Condition cc, BailoutReason reason); + void ThrowIf(Condition cond, BailoutReason reason); // Throw a message string as an exception if the value is a smi. void ThrowIfSmi(const Register& value, BailoutReason reason); -- 2.34.1