j(NegateCondition(both_smi), on_not_both_smi);
}
-bool MacroAssembler::IsUnsafeSmi(Smi* value) {
- return false;
-}
-
-
-void MacroAssembler::LoadUnsafeSmi(Register dst, Smi* source) {
- UNIMPLEMENTED();
-}
-
-
-void MacroAssembler::Move(Register dst, Smi* source) {
- if (IsUnsafeSmi(source)) {
- LoadUnsafeSmi(dst, source);
- } else {
- Set(dst, reinterpret_cast<int64_t>(source));
- }
-}
-
-
-void MacroAssembler::Move(const Operand& dst, Smi* source) {
- if (IsUnsafeSmi(source)) {
- LoadUnsafeSmi(kScratchRegister, source);
- movq(dst, kScratchRegister);
- } else {
- Set(dst, reinterpret_cast<int64_t>(source));
- }
-}
-
void MacroAssembler::Move(Register dst, Handle<Object> source) {
ASSERT(!source->IsFailure());
void MacroAssembler::Push(Smi* source) {
- if (IsUnsafeSmi(source)) {
- LoadUnsafeSmi(kScratchRegister, source);
- push(kScratchRegister);
+ intptr_t smi = reinterpret_cast<intptr_t>(source);
+ if (is_int32(smi)) {
+ push(Immediate(static_cast<int32_t>(smi)));
} else {
- intptr_t smi = reinterpret_cast<intptr_t>(source);
- if (is_int32(smi)) {
- push(Immediate(static_cast<int32_t>(smi)));
- } else {
- Set(kScratchRegister, smi);
- push(kScratchRegister);
- }
+ Set(kScratchRegister, smi);
+ push(kScratchRegister);
}
}
void MacroAssembler::Test(const Operand& src, Smi* source) {
- if (IsUnsafeSmi(source)) {
- LoadUnsafeSmi(kScratchRegister, source);
- testq(src, kScratchRegister);
+ intptr_t smi = reinterpret_cast<intptr_t>(source);
+ if (is_int32(smi)) {
+ testl(src, Immediate(static_cast<int32_t>(smi)));
} else {
- intptr_t smi = reinterpret_cast<intptr_t>(source);
- if (is_int32(smi)) {
- testl(src, Immediate(static_cast<int32_t>(smi)));
- } else {
- Move(kScratchRegister, source);
- testq(src, kScratchRegister);
- }
+ Move(kScratchRegister, source);
+ testq(src, kScratchRegister);
}
}
// Converts a positive smi to a negative index.
SmiIndex SmiToNegativeIndex(Register dst, Register src, int shift);
- bool IsUnsafeSmi(Smi* value);
- void LoadUnsafeSmi(Register dst, Smi* source);
-
// Basic Smi operations.
- void Move(Register dst, Smi* source);
- void Move(const Operand& dst, Smi* source);
+ void Move(Register dst, Smi* source) {
+ Set(dst, reinterpret_cast<int64_t>(source));
+ }
+
+ void Move(const Operand& dst, Smi* source) {
+ Set(dst, reinterpret_cast<int64_t>(source));
+ }
+
void Push(Smi* smi);
void Test(const Operand& dst, Smi* source);
void Set(const Operand& dst, int64_t x);
// Handle support
- bool IsUnsafeSmi(Handle<Object> value) {
- return IsUnsafeSmi(Smi::cast(*value));
- }
-
- void LoadUnsafeSmi(Register dst, Handle<Object> source) {
- LoadUnsafeSmi(dst, Smi::cast(*source));
- }
-
void Move(Register dst, Handle<Object> source);
void Move(const Operand& dst, Handle<Object> source);
void Cmp(Register dst, Handle<Object> source);