| 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 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2113 SaveFPRegsMode save_doubles) { | 2113 SaveFPRegsMode save_doubles) { |
| 2114 // If the expected number of arguments of the runtime function is | 2114 // If the expected number of arguments of the runtime function is |
| 2115 // constant, we check that the actual number of arguments match the | 2115 // constant, we check that the actual number of arguments match the |
| 2116 // expectation. | 2116 // expectation. |
| 2117 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 2117 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
| 2118 | 2118 |
| 2119 // TODO(1236192): Most runtime routines don't need the number of | 2119 // TODO(1236192): Most runtime routines don't need the number of |
| 2120 // arguments passed in because it is constant. At some point we | 2120 // arguments passed in because it is constant. At some point we |
| 2121 // should remove this need and make the runtime routine entry code | 2121 // should remove this need and make the runtime routine entry code |
| 2122 // smarter. | 2122 // smarter. |
| 2123 Move(eax, Immediate(num_arguments)); | 2123 if (num_arguments >= 0) { |
| 2124 Move(eax, Immediate(num_arguments)); |
| 2125 } |
| 2124 mov(ebx, Immediate(ExternalReference(f, isolate()))); | 2126 mov(ebx, Immediate(ExternalReference(f, isolate()))); |
| 2125 CEntryStub ces(isolate(), 1, save_doubles); | 2127 CEntryStub ces(isolate(), 1, save_doubles); |
| 2126 CallStub(&ces); | 2128 CallStub(&ces); |
| 2127 } | 2129 } |
| 2128 | 2130 |
| 2129 | 2131 |
| 2130 void MacroAssembler::CallExternalReference(ExternalReference ref, | 2132 void MacroAssembler::CallExternalReference(ExternalReference ref, |
| 2131 int num_arguments) { | 2133 int num_arguments) { |
| 2132 mov(eax, Immediate(num_arguments)); | 2134 mov(eax, Immediate(num_arguments)); |
| 2133 mov(ebx, Immediate(ref)); | 2135 mov(ebx, Immediate(ref)); |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3305 mov(eax, dividend); | 3307 mov(eax, dividend); |
| 3306 shr(eax, 31); | 3308 shr(eax, 31); |
| 3307 add(edx, eax); | 3309 add(edx, eax); |
| 3308 } | 3310 } |
| 3309 | 3311 |
| 3310 | 3312 |
| 3311 } // namespace internal | 3313 } // namespace internal |
| 3312 } // namespace v8 | 3314 } // namespace v8 |
| 3313 | 3315 |
| 3314 #endif // V8_TARGET_ARCH_X87 | 3316 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |