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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 if (emit_debug_code()) { | 952 if (emit_debug_code()) { |
953 Label ok; | 953 Label ok; |
954 JumpIfSmi(object, &ok); | 954 JumpIfSmi(object, &ok); |
955 cmp(FieldOperand(object, HeapObject::kMapOffset), | 955 cmp(FieldOperand(object, HeapObject::kMapOffset), |
956 isolate()->factory()->heap_number_map()); | 956 isolate()->factory()->heap_number_map()); |
957 Check(equal, kOperandNotANumber); | 957 Check(equal, kOperandNotANumber); |
958 bind(&ok); | 958 bind(&ok); |
959 } | 959 } |
960 } | 960 } |
961 | 961 |
| 962 void MacroAssembler::AssertNotNumber(Register object) { |
| 963 if (emit_debug_code()) { |
| 964 test(object, Immediate(kSmiTagMask)); |
| 965 Check(not_equal, kOperandIsANumber); |
| 966 cmp(FieldOperand(object, HeapObject::kMapOffset), |
| 967 isolate()->factory()->heap_number_map()); |
| 968 Check(not_equal, kOperandIsANumber); |
| 969 } |
| 970 } |
962 | 971 |
963 void MacroAssembler::AssertSmi(Register object) { | 972 void MacroAssembler::AssertSmi(Register object) { |
964 if (emit_debug_code()) { | 973 if (emit_debug_code()) { |
965 test(object, Immediate(kSmiTagMask)); | 974 test(object, Immediate(kSmiTagMask)); |
966 Check(equal, kOperandIsNotASmi); | 975 Check(equal, kOperandIsNotASmi); |
967 } | 976 } |
968 } | 977 } |
969 | 978 |
970 | 979 |
971 void MacroAssembler::AssertString(Register object) { | 980 void MacroAssembler::AssertString(Register object) { |
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3385 mov(eax, dividend); | 3394 mov(eax, dividend); |
3386 shr(eax, 31); | 3395 shr(eax, 31); |
3387 add(edx, eax); | 3396 add(edx, eax); |
3388 } | 3397 } |
3389 | 3398 |
3390 | 3399 |
3391 } // namespace internal | 3400 } // namespace internal |
3392 } // namespace v8 | 3401 } // namespace v8 |
3393 | 3402 |
3394 #endif // V8_TARGET_ARCH_IA32 | 3403 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |