| Index: src/x64/macro-assembler-x64.cc
|
| ===================================================================
|
| --- src/x64/macro-assembler-x64.cc (revision 2959)
|
| +++ src/x64/macro-assembler-x64.cc (working copy)
|
| @@ -519,6 +519,18 @@
|
| }
|
|
|
|
|
| +void MacroAssembler::JumpIfSmiGreaterEqualsConstant(Register src,
|
| + int constant,
|
| + Label* on_greater_equals) {
|
| + if (Smi::IsValid(constant)) {
|
| + Condition are_greater_equal = CheckSmiGreaterEqualsConstant(src, constant);
|
| + j(are_greater_equal, on_greater_equals);
|
| + } else if (constant < Smi::kMinValue){
|
| + jmp(on_greater_equals);
|
| + }
|
| +}
|
| +
|
| +
|
| void MacroAssembler::JumpIfNotValidSmiValue(Register src, Label* on_invalid) {
|
| Condition is_valid = CheckInteger32ValidSmiValue(src);
|
| j(ReverseCondition(is_valid), on_invalid);
|
| @@ -602,6 +614,22 @@
|
| }
|
|
|
|
|
| +Condition MacroAssembler::CheckSmiGreaterEqualsConstant(Register src,
|
| + int constant) {
|
| + if (constant == 0) {
|
| + testl(src, Immediate(static_cast<uint32_t>(0x80000000u)));
|
| + return positive;
|
| + }
|
| + if (Smi::IsValid(constant)) {
|
| + cmpl(src, Immediate(Smi::FromInt(constant)));
|
| + return greater_equal;
|
| + }
|
| + // Can't be equal.
|
| + UNREACHABLE();
|
| + return no_condition;
|
| +}
|
| +
|
| +
|
| Condition MacroAssembler::CheckInteger32ValidSmiValue(Register src) {
|
| // A 32-bit integer value can be converted to a smi if it is in the
|
| // range [-2^30 .. 2^30-1]. That is equivalent to having its 32-bit
|
|
|