Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: src/arm64/lithium-codegen-arm64.cc

Issue 207453008: ARM64: Minor improvement in LCodeGen::DoCheckInstanceType. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm64/lithium-codegen-arm64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc
index 7fdd94fee11f1beda5688c146720f55b19b23a83..334377897329415e06fdc9cde084c49a1f2fe347 100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -1078,18 +1078,18 @@ void LCodeGen::DeoptimizeIfNotZero(Register rt, LEnvironment* environment) {
void LCodeGen::DeoptimizeIfNegative(Register rt, LEnvironment* environment) {
int sign_bit = rt.Is64Bits() ? kXSignBit : kWSignBit;
- DeoptimizeBranch(environment, reg_bit_set, rt, sign_bit);
+ DeoptimizeIfBitSet(rt, sign_bit, environment);
}
void LCodeGen::DeoptimizeIfSmi(Register rt,
LEnvironment* environment) {
- DeoptimizeBranch(environment, reg_bit_clear, rt, MaskToBit(kSmiTagMask));
+ DeoptimizeIfBitClear(rt, MaskToBit(kSmiTagMask), environment);
}
void LCodeGen::DeoptimizeIfNotSmi(Register rt, LEnvironment* environment) {
- DeoptimizeBranch(environment, reg_bit_set, rt, MaskToBit(kSmiTagMask));
+ DeoptimizeIfBitSet(rt, MaskToBit(kSmiTagMask), environment);
}
@@ -1116,6 +1116,20 @@ void LCodeGen::DeoptimizeIfMinusZero(DoubleRegister input,
}
+void LCodeGen::DeoptimizeIfBitSet(Register rt,
+ int bit,
+ LEnvironment* environment) {
+ DeoptimizeBranch(environment, reg_bit_set, rt, bit);
+}
+
+
+void LCodeGen::DeoptimizeIfBitClear(Register rt,
+ int bit,
+ LEnvironment* environment) {
+ DeoptimizeBranch(environment, reg_bit_clear, rt, bit);
+}
+
+
void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) {
if (!info()->IsStub()) {
// Ensure that we have enough space after the previous lazy-bailout
@@ -2184,10 +2198,11 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
if (IsPowerOf2(mask)) {
ASSERT((tag == 0) || (tag == mask));
- // TODO(all): We might be able to use tbz/tbnz if we can guarantee that
- // the deopt handler is reachable by a tbz instruction.
- __ Tst(scratch, mask);
- DeoptimizeIf(tag == 0 ? ne : eq, instr->environment());
+ if (tag == 0) {
+ DeoptimizeIfBitSet(scratch, MaskToBit(mask), instr->environment());
+ } else {
+ DeoptimizeIfBitClear(scratch, MaskToBit(mask), instr->environment());
+ }
} else {
if (tag == 0) {
__ Tst(scratch, mask);
« no previous file with comments | « src/arm64/lithium-codegen-arm64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698