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/base/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 4768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4779 | 4779 |
4780 | 4780 |
4781 void MacroAssembler::CallCFunction(ExternalReference function, | 4781 void MacroAssembler::CallCFunction(ExternalReference function, |
4782 int num_arguments) { | 4782 int num_arguments) { |
4783 LoadAddress(rax, function); | 4783 LoadAddress(rax, function); |
4784 CallCFunction(rax, num_arguments); | 4784 CallCFunction(rax, num_arguments); |
4785 } | 4785 } |
4786 | 4786 |
4787 | 4787 |
4788 void MacroAssembler::CallCFunction(Register function, int num_arguments) { | 4788 void MacroAssembler::CallCFunction(Register function, int num_arguments) { |
| 4789 DCHECK_LE(num_arguments, kMaxCParameters); |
4789 DCHECK(has_frame()); | 4790 DCHECK(has_frame()); |
4790 // Check stack alignment. | 4791 // Check stack alignment. |
4791 if (emit_debug_code()) { | 4792 if (emit_debug_code()) { |
4792 CheckStackAlignment(); | 4793 CheckStackAlignment(); |
4793 } | 4794 } |
4794 | 4795 |
4795 call(function); | 4796 call(function); |
4796 DCHECK(base::OS::ActivationFrameAlignment() != 0); | 4797 DCHECK(base::OS::ActivationFrameAlignment() != 0); |
4797 DCHECK(num_arguments >= 0); | 4798 DCHECK(num_arguments >= 0); |
4798 int argument_slots_on_stack = | 4799 int argument_slots_on_stack = |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5038 movl(rax, dividend); | 5039 movl(rax, dividend); |
5039 shrl(rax, Immediate(31)); | 5040 shrl(rax, Immediate(31)); |
5040 addl(rdx, rax); | 5041 addl(rdx, rax); |
5041 } | 5042 } |
5042 | 5043 |
5043 | 5044 |
5044 } // namespace internal | 5045 } // namespace internal |
5045 } // namespace v8 | 5046 } // namespace v8 |
5046 | 5047 |
5047 #endif // V8_TARGET_ARCH_X64 | 5048 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |