[macro-assembler] Delete unused Jump/CheckBothSmi

Bug: 
Change-Id: I0c2dabebbfa709589c19b1c48ec8de4c7f7a3952
Reviewed-on: https://chromium-review.googlesource.com/707151
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48410}
This commit is contained in:
Toon Verwaest 2017-10-09 19:09:56 +02:00 committed by Commit Bot
parent c408123d75
commit de578fe3f8
10 changed files with 39 additions and 244 deletions

View File

@ -18,8 +18,6 @@ namespace internal {
V(kAllocationIsNotDoubleAligned, "Allocation is not double aligned") \
V(kAPICallReturnedInvalidObject, "API call returned invalid object") \
V(kBailedOutDueToDependencyChange, "Bailed out due to dependency change") \
V(kBothRegistersWereSmisInSelectNonSmi, \
"Both registers were smis in SelectNonSmi") \
V(kClassConstructorFunction, "Class constructor function") \
V(kClassLiteral, "Class literal") \
V(kCodeGenerationFailed, "Code generation failed") \

View File

@ -1066,41 +1066,6 @@ Condition TurboAssembler::CheckSmi(const Operand& src) {
return zero;
}
Condition MacroAssembler::CheckBothSmi(Register first, Register second) {
if (first == second) {
return CheckSmi(first);
}
STATIC_ASSERT(kSmiTag == 0 && kHeapObjectTag == 1 && kHeapObjectTagMask == 3);
if (SmiValuesAre32Bits()) {
leal(kScratchRegister, Operand(first, second, times_1, 0));
testb(kScratchRegister, Immediate(0x03));
} else {
DCHECK(SmiValuesAre31Bits());
movl(kScratchRegister, first);
orl(kScratchRegister, second);
testb(kScratchRegister, Immediate(kSmiTagMask));
}
return zero;
}
Condition MacroAssembler::CheckEitherSmi(Register first,
Register second,
Register scratch) {
if (first == second) {
return CheckSmi(first);
}
if (scratch == second) {
andl(scratch, first);
} else {
if (scratch != first) {
movl(scratch, first);
}
andl(scratch, second);
}
testb(scratch, Immediate(kSmiTagMask));
return zero;
}
void TurboAssembler::JumpIfSmi(Register src, Label* on_smi,
Label::Distance near_jump) {
Condition smi = CheckSmi(src);
@ -1121,14 +1086,6 @@ void MacroAssembler::JumpIfNotSmi(Operand src, Label* on_not_smi,
j(NegateCondition(smi), on_not_smi, near_jump);
}
void MacroAssembler::JumpIfNotBothSmi(Register src1,
Register src2,
Label* on_not_both_smi,
Label::Distance near_jump) {
Condition both_smi = CheckBothSmi(src1, src2);
j(NegateCondition(both_smi), on_not_both_smi, near_jump);
}
void MacroAssembler::SmiAddConstant(Register dst, Register src, Smi* constant) {
if (constant->value() == 0) {
if (dst != src) {
@ -1400,43 +1357,6 @@ void MacroAssembler::SmiSub(Register dst,
SmiSubNoOverflowHelper<Operand>(this, dst, src1, src2);
}
void MacroAssembler::SelectNonSmi(Register dst,
Register src1,
Register src2,
Label* on_not_smis,
Label::Distance near_jump) {
DCHECK(dst != kScratchRegister);
DCHECK(src1 != kScratchRegister);
DCHECK(src2 != kScratchRegister);
DCHECK(dst != src1);
DCHECK(dst != src2);
// Both operands must not be smis.
#ifdef DEBUG
Condition not_both_smis = NegateCondition(CheckBothSmi(src1, src2));
Check(not_both_smis, kBothRegistersWereSmisInSelectNonSmi);
#endif
STATIC_ASSERT(kSmiTag == 0);
DCHECK_EQ(static_cast<Smi*>(0), Smi::kZero);
movl(kScratchRegister, Immediate(kSmiTagMask));
andp(kScratchRegister, src1);
testl(kScratchRegister, src2);
// If non-zero then both are smis.
j(not_zero, on_not_smis, near_jump);
// Exactly one operand is a smi.
DCHECK_EQ(1, static_cast<int>(kSmiTagMask));
// kScratchRegister still holds src1 & kSmiTag, which is either zero or one.
subp(kScratchRegister, Immediate(1));
// If src1 is a smi, then scratch register all 1s, else it is all 0s.
movp(dst, src1);
xorp(dst, src2);
andp(dst, kScratchRegister);
// If src1 is a smi, dst holds src1 ^ src2, else it is zero.
xorp(dst, src1);
// If src1 is a smi, dst is src2, else it is src1, i.e., the non-smi.
}
SmiIndex MacroAssembler::SmiToIndex(Register dst,
Register src,
int shift) {

View File

@ -687,13 +687,6 @@ class MacroAssembler : public TurboAssembler {
// Functions performing a check on a known or potential smi. Returns
// a condition that is satisfied if the check is successful.
// Are both values tagged smis.
Condition CheckBothSmi(Register first, Register second);
// Are either value a tagged smi.
Condition CheckEitherSmi(Register first,
Register second,
Register scratch = kScratchRegister);
// Test-and-jump functions. Typically combines a check function
// above with a conditional jump.
@ -706,12 +699,6 @@ class MacroAssembler : public TurboAssembler {
void JumpIfNotSmi(Operand src, Label* on_not_smi,
Label::Distance near_jump = Label::kFar);
// Jump if either or both register are not smi values.
void JumpIfNotBothSmi(Register src1,
Register src2,
Label* on_not_both_smi,
Label::Distance near_jump = Label::kFar);
// Operations on tagged smi values.
// Smis represent a subset of integers. The subset is always equivalent to
@ -784,14 +771,6 @@ class MacroAssembler : public TurboAssembler {
// Specialized operations
// Select the non-smi register of two registers where exactly one is a
// smi. If neither are smis, jump to the failure label.
void SelectNonSmi(Register dst,
Register src1,
Register src2,
Label* on_not_smis,
Label::Distance near_jump = Label::kFar);
// Converts, if necessary, a smi to a combination of number and
// multiplier to be used as a scaled index.
// The src register contains a *positive* smi value. The shift is the

View File

@ -23,7 +23,7 @@ bytecodes: [
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
@ -150,7 +150,7 @@ bytecodes: [
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
@ -301,7 +301,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(10),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(10),
B(Mov), R(closure), R(11),
@ -344,7 +344,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 36 E> */ B(TestEqualStrictNoFeedback), R(10),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 31 S> */ B(LdaNamedProperty), R(4), U8(8), U8(7),
B(Star), R(19),
B(CallProperty0), R(19), R(4), U8(5),
@ -589,7 +589,7 @@ bytecodes: [
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(5), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
@ -641,7 +641,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(1),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
B(Ldar), R(7),
B(SwitchOnSmiNoFeedback), U8(13), U8(2), I8(1),
B(LdaNamedProperty), R(8), U8(15), U8(8),

View File

@ -25,7 +25,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(Mov), R(closure), R(12),
@ -61,7 +61,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 43 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(11),
B(Star), R(20),
B(CallProperty0), R(20), R(4), U8(9),
@ -313,7 +313,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(Mov), R(closure), R(12),
@ -349,7 +349,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 43 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(11),
B(Star), R(20),
B(CallProperty0), R(20), R(4), U8(9),
@ -617,7 +617,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(3), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(Mov), R(closure), R(12),
@ -653,7 +653,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 43 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 40 S> */ B(LdaNamedProperty), R(4), U8(7), U8(11),
B(Star), R(20),
B(CallProperty0), R(20), R(4), U8(9),

View File

@ -656,7 +656,7 @@ bytecodes: [
B(RestoreGeneratorState), R(3),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(CreateFunctionContext), U8(1),
@ -831,7 +831,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(10),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(10),
B(CreateFunctionContext), U8(1),
@ -873,7 +873,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 35 E> */ B(TestEqualStrictNoFeedback), R(10),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 30 S> */ B(LdaNamedProperty), R(4), U8(6), U8(6),
B(Star), R(16),
B(CallProperty0), R(16), R(4), U8(4),
@ -1243,7 +1243,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(11),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(11),
B(CreateFunctionContext), U8(1),
@ -1276,7 +1276,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 40 E> */ B(TestEqualStrictNoFeedback), R(11),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 35 S> */ B(LdaNamedProperty), R(4), U8(3), U8(6),
B(Star), R(21),
B(CallProperty0), R(21), R(4), U8(4),

View File

@ -22,7 +22,7 @@ bytecodes: [
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
@ -70,7 +70,7 @@ bytecodes: [
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
@ -139,7 +139,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(10),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(10),
B(Mov), R(closure), R(11),
@ -177,7 +177,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 30 E> */ B(TestEqualStrictNoFeedback), R(10),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 25 S> */ B(LdaNamedProperty), R(4), U8(7), U8(7),
B(Star), R(15),
B(CallProperty0), R(15), R(4), U8(5),
@ -342,7 +342,7 @@ bytecodes: [
B(RestoreGeneratorState), R(0),
B(Star), R(1),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(1),
B(Mov), R(closure), R(2),
@ -382,7 +382,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
B(TestEqualStrictNoFeedback), R(1),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
B(Ldar), R(3),
B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(1),
B(LdaNamedProperty), R(4), U8(9), U8(8),

View File

@ -22,7 +22,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -79,7 +79,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -138,7 +138,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -218,7 +218,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -296,7 +296,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -376,7 +376,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -454,7 +454,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -516,7 +516,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -590,7 +590,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -647,7 +647,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),
@ -705,7 +705,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(0),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(0),
B(LdaConstant), U8(1),

View File

@ -281,7 +281,7 @@ bytecodes: [
B(RestoreGeneratorState), R(2),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(Mov), R(closure), R(4),
@ -342,7 +342,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(2),
B(SwitchOnSmiNoFeedback), U8(0), U8(2), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(2),
B(Mov), R(closure), R(3),
@ -370,7 +370,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 31 E> */ B(TestEqualStrictNoFeedback), R(2),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 36 S> */ B(LdaSmi), I8(10),
/* 36 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(56),
@ -518,7 +518,7 @@ bytecodes: [
B(RestoreGeneratorState), R(1),
B(Star), R(3),
B(SwitchOnSmiNoFeedback), U8(0), U8(1), I8(0),
B(Abort), U8(44),
B(Abort), U8(43),
B(LdaSmi), I8(-2),
B(Star), R(3),
B(Mov), R(closure), R(4),
@ -537,7 +537,7 @@ bytecodes: [
B(LdaSmi), I8(-2),
/* 36 E> */ B(TestEqualStrictNoFeedback), R(3),
B(JumpIfTrue), U8(4),
B(Abort), U8(44),
B(Abort), U8(43),
/* 41 S> */ B(LdaSmi), I8(10),
/* 41 E> */ B(TestLessThan), R(0), U8(0),
B(JumpIfFalse), U8(59),

View File

@ -395,39 +395,6 @@ TEST(SmiCheck) {
cond = masm->CheckSmi(rcx);
__ j(cond, &exit);
// CheckBothSmi
__ incq(rax);
__ movq(rcx, Immediate(Smi::kMaxValue));
__ Integer32ToSmi(rcx, rcx);
__ movq(rdx, Immediate(Smi::kMinValue));
__ Integer32ToSmi(rdx, rdx);
cond = masm->CheckBothSmi(rcx, rdx);
__ j(NegateCondition(cond), &exit);
__ incq(rax);
__ xorq(rcx, Immediate(kSmiTagMask));
cond = masm->CheckBothSmi(rcx, rdx);
__ j(cond, &exit);
__ incq(rax);
__ xorq(rdx, Immediate(kSmiTagMask));
cond = masm->CheckBothSmi(rcx, rdx);
__ j(cond, &exit);
__ incq(rax);
__ xorq(rcx, Immediate(kSmiTagMask));
cond = masm->CheckBothSmi(rcx, rdx);
__ j(cond, &exit);
__ incq(rax);
cond = masm->CheckBothSmi(rcx, rcx);
__ j(NegateCondition(cond), &exit);
__ incq(rax);
cond = masm->CheckBothSmi(rdx, rdx);
__ j(cond, &exit);
// Success
__ xorq(rax, rax);
@ -935,75 +902,6 @@ TEST(SmiIndex) {
CHECK_EQ(0, result);
}
void TestSelectNonSmi(MacroAssembler* masm, Label* exit, int id, int x, int y) {
__ movl(rax, Immediate(id));
__ Move(rcx, Smi::FromInt(x));
__ Move(rdx, Smi::FromInt(y));
__ xorq(rdx, Immediate(kSmiTagMask));
__ SelectNonSmi(r9, rcx, rdx, exit);
__ incq(rax);
__ cmpq(r9, rdx);
__ j(not_equal, exit);
__ incq(rax);
__ Move(rcx, Smi::FromInt(x));
__ Move(rdx, Smi::FromInt(y));
__ xorq(rcx, Immediate(kSmiTagMask));
__ SelectNonSmi(r9, rcx, rdx, exit);
__ incq(rax);
__ cmpq(r9, rcx);
__ j(not_equal, exit);
__ incq(rax);
Label fail_ok;
__ Move(rcx, Smi::FromInt(x));
__ Move(rdx, Smi::FromInt(y));
__ xorq(rcx, Immediate(kSmiTagMask));
__ xorq(rdx, Immediate(kSmiTagMask));
__ SelectNonSmi(r9, rcx, rdx, &fail_ok);
__ jmp(exit);
__ bind(&fail_ok);
}
TEST(SmiSelectNonSmi) {
// Allocate an executable page of memory.
size_t actual_size;
byte* buffer = static_cast<byte*>(v8::base::OS::Allocate(
Assembler::kMinimalBufferSize * 2, &actual_size, true));
CHECK(buffer);
Isolate* isolate = CcTest::i_isolate();
HandleScope handles(isolate);
MacroAssembler assembler(isolate, buffer, static_cast<int>(actual_size),
v8::internal::CodeObjectRequired::kYes);
MacroAssembler* masm = &assembler;
EntryCode(masm);
Label exit;
TestSelectNonSmi(masm, &exit, 0x10, 0, 0);
TestSelectNonSmi(masm, &exit, 0x20, 0, 1);
TestSelectNonSmi(masm, &exit, 0x30, 1, 0);
TestSelectNonSmi(masm, &exit, 0x40, 0, -1);
TestSelectNonSmi(masm, &exit, 0x50, -1, 0);
TestSelectNonSmi(masm, &exit, 0x60, -1, -1);
TestSelectNonSmi(masm, &exit, 0x70, 1, 1);
TestSelectNonSmi(masm, &exit, 0x80, Smi::kMinValue, Smi::kMaxValue);
TestSelectNonSmi(masm, &exit, 0x90, Smi::kMinValue, Smi::kMinValue);
__ xorq(rax, rax); // Success.
__ bind(&exit);
ExitCode(masm);
__ ret(0);
CodeDesc desc;
masm->GetCode(isolate, &desc);
// Call the function from C++.
int result = FUNCTION_CAST<F0>(buffer)();
CHECK_EQ(0, result);
}
void TestPositiveSmiPowerUp(MacroAssembler* masm, Label* exit, int id, int x) {
CHECK(x >= 0);
int powers[] = { 0, 1, 2, 3, 8, 16, 24, 31 };