| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 3857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3868 Label ok; | 3868 Label ok; |
| 3869 Condition is_smi = CheckSmi(object); | 3869 Condition is_smi = CheckSmi(object); |
| 3870 j(is_smi, &ok, Label::kNear); | 3870 j(is_smi, &ok, Label::kNear); |
| 3871 Cmp(FieldOperand(object, HeapObject::kMapOffset), | 3871 Cmp(FieldOperand(object, HeapObject::kMapOffset), |
| 3872 isolate()->factory()->heap_number_map()); | 3872 isolate()->factory()->heap_number_map()); |
| 3873 Check(equal, kOperandIsNotANumber); | 3873 Check(equal, kOperandIsNotANumber); |
| 3874 bind(&ok); | 3874 bind(&ok); |
| 3875 } | 3875 } |
| 3876 } | 3876 } |
| 3877 | 3877 |
| 3878 void MacroAssembler::AssertNotNumber(Register object) { |
| 3879 if (emit_debug_code()) { |
| 3880 Condition is_smi = CheckSmi(object); |
| 3881 Check(NegateCondition(is_smi), kOperandIsANumber); |
| 3882 Cmp(FieldOperand(object, HeapObject::kMapOffset), |
| 3883 isolate()->factory()->heap_number_map()); |
| 3884 Check(equal, kOperandIsANumber); |
| 3885 } |
| 3886 } |
| 3878 | 3887 |
| 3879 void MacroAssembler::AssertNotSmi(Register object) { | 3888 void MacroAssembler::AssertNotSmi(Register object) { |
| 3880 if (emit_debug_code()) { | 3889 if (emit_debug_code()) { |
| 3881 Condition is_smi = CheckSmi(object); | 3890 Condition is_smi = CheckSmi(object); |
| 3882 Check(NegateCondition(is_smi), kOperandIsASmi); | 3891 Check(NegateCondition(is_smi), kOperandIsASmi); |
| 3883 } | 3892 } |
| 3884 } | 3893 } |
| 3885 | 3894 |
| 3886 | 3895 |
| 3887 void MacroAssembler::AssertSmi(Register object) { | 3896 void MacroAssembler::AssertSmi(Register object) { |
| (...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5672 movl(rax, dividend); | 5681 movl(rax, dividend); |
| 5673 shrl(rax, Immediate(31)); | 5682 shrl(rax, Immediate(31)); |
| 5674 addl(rdx, rax); | 5683 addl(rdx, rax); |
| 5675 } | 5684 } |
| 5676 | 5685 |
| 5677 | 5686 |
| 5678 } // namespace internal | 5687 } // namespace internal |
| 5679 } // namespace v8 | 5688 } // namespace v8 |
| 5680 | 5689 |
| 5681 #endif // V8_TARGET_ARCH_X64 | 5690 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |