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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 SaveFPRegsMode save_doubles) { | 696 SaveFPRegsMode save_doubles) { |
697 // If the expected number of arguments of the runtime function is | 697 // If the expected number of arguments of the runtime function is |
698 // constant, we check that the actual number of arguments match the | 698 // constant, we check that the actual number of arguments match the |
699 // expectation. | 699 // expectation. |
700 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 700 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
701 | 701 |
702 // TODO(1236192): Most runtime routines don't need the number of | 702 // TODO(1236192): Most runtime routines don't need the number of |
703 // arguments passed in because it is constant. At some point we | 703 // arguments passed in because it is constant. At some point we |
704 // should remove this need and make the runtime routine entry code | 704 // should remove this need and make the runtime routine entry code |
705 // smarter. | 705 // smarter. |
706 Set(rax, num_arguments); | 706 if (num_arguments >= 0) { |
| 707 Set(rax, num_arguments); |
| 708 } |
707 LoadAddress(rbx, ExternalReference(f, isolate())); | 709 LoadAddress(rbx, ExternalReference(f, isolate())); |
708 CEntryStub ces(isolate(), f->result_size, save_doubles); | 710 CEntryStub ces(isolate(), f->result_size, save_doubles); |
709 CallStub(&ces); | 711 CallStub(&ces); |
710 } | 712 } |
711 | 713 |
712 | 714 |
713 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 715 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
714 int num_arguments) { | 716 int num_arguments) { |
715 Set(rax, num_arguments); | 717 Set(rax, num_arguments); |
716 LoadAddress(rbx, ext); | 718 LoadAddress(rbx, ext); |
(...skipping 5098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5815 movl(rax, dividend); | 5817 movl(rax, dividend); |
5816 shrl(rax, Immediate(31)); | 5818 shrl(rax, Immediate(31)); |
5817 addl(rdx, rax); | 5819 addl(rdx, rax); |
5818 } | 5820 } |
5819 | 5821 |
5820 | 5822 |
5821 } // namespace internal | 5823 } // namespace internal |
5822 } // namespace v8 | 5824 } // namespace v8 |
5823 | 5825 |
5824 #endif // V8_TARGET_ARCH_X64 | 5826 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |