Index: src/x64/macro-assembler-x64.cc |
=================================================================== |
--- src/x64/macro-assembler-x64.cc (revision 3095) |
+++ src/x64/macro-assembler-x64.cc (working copy) |
@@ -580,6 +580,14 @@ |
} |
+Condition MacroAssembler::CheckUInteger32ValidSmiValue(Register src) { |
+ // An unsigned 32-bit integer value is valid as long as the high bit |
+ // is not set. |
+ testq(src, Immediate(0x80000000)); |
+ return zero; |
+} |
+ |
+ |
void MacroAssembler::SmiNeg(Register dst, Register src, Label* on_smi_result) { |
if (dst.is(src)) { |
ASSERT(!dst.is(kScratchRegister)); |
@@ -1243,6 +1251,13 @@ |
} |
+void MacroAssembler::JumpIfUIntNotValidSmiValue(Register src, |
+ Label* on_invalid) { |
+ Condition is_valid = CheckUInteger32ValidSmiValue(src); |
+ j(NegateCondition(is_valid), on_invalid); |
+} |
+ |
+ |
void MacroAssembler::JumpIfNotBothSmi(Register src1, Register src2, |
Label* on_not_both_smi) { |
Condition both_smi = CheckBothSmi(src1, src2); |
@@ -2213,6 +2228,23 @@ |
} |
+void MacroAssembler::AllocateHeapNumber(Register result, |
+ Register scratch, |
+ Label* gc_required) { |
+ // Allocate heap number in new space. |
+ AllocateInNewSpace(HeapNumber::kSize, |
+ result, |
+ scratch, |
+ no_reg, |
+ gc_required, |
+ TAG_OBJECT); |
+ |
+ // Set the map. |
+ LoadRoot(kScratchRegister, Heap::kHeapNumberMapRootIndex); |
+ movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
+} |
+ |
+ |
CodePatcher::CodePatcher(byte* address, int size) |
: address_(address), size_(size), masm_(address, size + Assembler::kGap) { |
// Create a new macro assembler pointing to the address of the code to patch. |