Reviewers: ulan, jochen,
Description:
ARM64: Slightly improve MacroAssembler::Allocate.
BUG=
Please review this at https://codereview.chromium.org/247533005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+12, -14 lines):
M src/arm64/constants-arm64.h
M src/arm64/lithium-codegen-arm64.h
M src/arm64/lithium-codegen-arm64.cc
M src/arm64/macro-assembler-arm64.h
M src/arm64/macro-assembler-arm64.cc
Index: src/arm64/constants-arm64.h
diff --git a/src/arm64/constants-arm64.h b/src/arm64/constants-arm64.h
index
8866e23cf1bdafbefc743d9ac2fdc9a62c136396..f856a1b433dc7a95ac4275f06d346e5a90807ad7
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,
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc
b/src/arm64/lithium-codegen-arm64.cc
index
969af2b06da77b0645b32e5f3310a78d249b3d23..c299ae63e53ca0bcc1be945338e367033a56003a
100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -1776,23 +1776,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());
}
}
Index: src/arm64/lithium-codegen-arm64.h
diff --git a/src/arm64/lithium-codegen-arm64.h
b/src/arm64/lithium-codegen-arm64.h
index
4c9d35a4d380455035656a097c0bcf767445decb..4c8166fdc9c26189551b39f1ae948bbe7068aed9
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);
Index: src/arm64/macro-assembler-arm64.cc
diff --git a/src/arm64/macro-assembler-arm64.cc
b/src/arm64/macro-assembler-arm64.cc
index
70d601b2e6e0399fe4ceabb0ae11ef1e6a094be3..d7f008141e1dca7f1dd6810220a1327535e10e83
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);
}
@@ -3309,8 +3309,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));
@@ -3391,8 +3390,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));
Index: src/arm64/macro-assembler-arm64.h
diff --git a/src/arm64/macro-assembler-arm64.h
b/src/arm64/macro-assembler-arm64.h
index
904cf50f176543857d89e530df540aae486627ca..c1f82a722176e4ee4830f21fe20dc1040767632c
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);
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.