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 3924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3935 Check(not_equal, kOperandIsASmiAndNotABoundFunction); | 3935 Check(not_equal, kOperandIsASmiAndNotABoundFunction); |
3936 Push(object); | 3936 Push(object); |
3937 CmpObjectType(object, JS_BOUND_FUNCTION_TYPE, object); | 3937 CmpObjectType(object, JS_BOUND_FUNCTION_TYPE, object); |
3938 Pop(object); | 3938 Pop(object); |
3939 Check(equal, kOperandIsNotABoundFunction); | 3939 Check(equal, kOperandIsNotABoundFunction); |
3940 } | 3940 } |
3941 } | 3941 } |
3942 | 3942 |
3943 void MacroAssembler::AssertGeneratorObject(Register object) { | 3943 void MacroAssembler::AssertGeneratorObject(Register object) { |
3944 if (emit_debug_code()) { | 3944 if (emit_debug_code()) { |
| 3945 Label ok; |
3945 testb(object, Immediate(kSmiTagMask)); | 3946 testb(object, Immediate(kSmiTagMask)); |
3946 Check(not_equal, kOperandIsASmiAndNotAGeneratorObject); | 3947 Check(not_equal, kOperandIsASmiAndNotAGeneratorObject); |
| 3948 |
3947 Push(object); | 3949 Push(object); |
3948 CmpObjectType(object, JS_GENERATOR_OBJECT_TYPE, object); | 3950 CmpObjectType(object, JS_GENERATOR_OBJECT_TYPE, object); |
3949 Pop(object); | 3951 Pop(object); |
| 3952 j(equal, &ok, Label::kNear); |
| 3953 |
| 3954 Push(object); |
| 3955 CmpObjectType(object, JS_ASYNC_GENERATOR_OBJECT_TYPE, object); |
| 3956 Pop(object); |
3950 Check(equal, kOperandIsNotAGeneratorObject); | 3957 Check(equal, kOperandIsNotAGeneratorObject); |
| 3958 |
| 3959 bind(&ok); |
3951 } | 3960 } |
3952 } | 3961 } |
3953 | 3962 |
| 3963 void MacroAssembler::AssertAsyncGeneratorObject(Register object) { |
| 3964 if (emit_debug_code()) { |
| 3965 testb(object, Immediate(kSmiTagMask)); |
| 3966 Check(not_equal, kOperandIsASmiAndNotAnAsyncGeneratorObject); |
| 3967 Push(object); |
| 3968 CmpObjectType(object, JS_ASYNC_GENERATOR_OBJECT_TYPE, object); |
| 3969 Pop(object); |
| 3970 Check(equal, kOperandIsNotAnAsyncGeneratorObject); |
| 3971 } |
| 3972 } |
| 3973 |
3954 void MacroAssembler::AssertReceiver(Register object) { | 3974 void MacroAssembler::AssertReceiver(Register object) { |
3955 if (emit_debug_code()) { | 3975 if (emit_debug_code()) { |
3956 testb(object, Immediate(kSmiTagMask)); | 3976 testb(object, Immediate(kSmiTagMask)); |
3957 Check(not_equal, kOperandIsASmiAndNotAReceiver); | 3977 Check(not_equal, kOperandIsASmiAndNotAReceiver); |
3958 Push(object); | 3978 Push(object); |
3959 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); | 3979 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE); |
3960 CmpObjectType(object, FIRST_JS_RECEIVER_TYPE, object); | 3980 CmpObjectType(object, FIRST_JS_RECEIVER_TYPE, object); |
3961 Pop(object); | 3981 Pop(object); |
3962 Check(above_equal, kOperandIsNotAReceiver); | 3982 Check(above_equal, kOperandIsNotAReceiver); |
3963 } | 3983 } |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5299 movl(rax, dividend); | 5319 movl(rax, dividend); |
5300 shrl(rax, Immediate(31)); | 5320 shrl(rax, Immediate(31)); |
5301 addl(rdx, rax); | 5321 addl(rdx, rax); |
5302 } | 5322 } |
5303 | 5323 |
5304 | 5324 |
5305 } // namespace internal | 5325 } // namespace internal |
5306 } // namespace v8 | 5326 } // namespace v8 |
5307 | 5327 |
5308 #endif // V8_TARGET_ARCH_X64 | 5328 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |