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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 if (emit_debug_code()) { | 900 if (emit_debug_code()) { |
901 Label ok; | 901 Label ok; |
902 JumpIfSmi(object, &ok); | 902 JumpIfSmi(object, &ok); |
903 cmp(FieldOperand(object, HeapObject::kMapOffset), | 903 cmp(FieldOperand(object, HeapObject::kMapOffset), |
904 isolate()->factory()->heap_number_map()); | 904 isolate()->factory()->heap_number_map()); |
905 Check(equal, kOperandNotANumber); | 905 Check(equal, kOperandNotANumber); |
906 bind(&ok); | 906 bind(&ok); |
907 } | 907 } |
908 } | 908 } |
909 | 909 |
| 910 void MacroAssembler::AssertNotNumber(Register object) { |
| 911 if (emit_debug_code()) { |
| 912 test(object, Immediate(kSmiTagMask)); |
| 913 Check(not_equal, kOperandIsANumber); |
| 914 cmp(FieldOperand(object, HeapObject::kMapOffset), |
| 915 isolate()->factory()->heap_number_map()); |
| 916 Check(not_equal, kOperandIsANumber); |
| 917 } |
| 918 } |
910 | 919 |
911 void MacroAssembler::AssertSmi(Register object) { | 920 void MacroAssembler::AssertSmi(Register object) { |
912 if (emit_debug_code()) { | 921 if (emit_debug_code()) { |
913 test(object, Immediate(kSmiTagMask)); | 922 test(object, Immediate(kSmiTagMask)); |
914 Check(equal, kOperandIsNotASmi); | 923 Check(equal, kOperandIsNotASmi); |
915 } | 924 } |
916 } | 925 } |
917 | 926 |
918 | 927 |
919 void MacroAssembler::AssertString(Register object) { | 928 void MacroAssembler::AssertString(Register object) { |
(...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3232 mov(eax, dividend); | 3241 mov(eax, dividend); |
3233 shr(eax, 31); | 3242 shr(eax, 31); |
3234 add(edx, eax); | 3243 add(edx, eax); |
3235 } | 3244 } |
3236 | 3245 |
3237 | 3246 |
3238 } // namespace internal | 3247 } // namespace internal |
3239 } // namespace v8 | 3248 } // namespace v8 |
3240 | 3249 |
3241 #endif // V8_TARGET_ARCH_X87 | 3250 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |