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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2173 SaveFPRegsMode save_doubles) { | 2173 SaveFPRegsMode save_doubles) { |
2174 // If the expected number of arguments of the runtime function is | 2174 // If the expected number of arguments of the runtime function is |
2175 // constant, we check that the actual number of arguments match the | 2175 // constant, we check that the actual number of arguments match the |
2176 // expectation. | 2176 // expectation. |
2177 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 2177 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
2178 | 2178 |
2179 // TODO(1236192): Most runtime routines don't need the number of | 2179 // TODO(1236192): Most runtime routines don't need the number of |
2180 // arguments passed in because it is constant. At some point we | 2180 // arguments passed in because it is constant. At some point we |
2181 // should remove this need and make the runtime routine entry code | 2181 // should remove this need and make the runtime routine entry code |
2182 // smarter. | 2182 // smarter. |
2183 Move(eax, Immediate(num_arguments)); | 2183 if (num_arguments >= 0) { |
| 2184 Move(eax, Immediate(num_arguments)); |
| 2185 } |
2184 mov(ebx, Immediate(ExternalReference(f, isolate()))); | 2186 mov(ebx, Immediate(ExternalReference(f, isolate()))); |
2185 CEntryStub ces(isolate(), 1, save_doubles); | 2187 CEntryStub ces(isolate(), 1, save_doubles); |
2186 CallStub(&ces); | 2188 CallStub(&ces); |
2187 } | 2189 } |
2188 | 2190 |
2189 | 2191 |
2190 void MacroAssembler::CallExternalReference(ExternalReference ref, | 2192 void MacroAssembler::CallExternalReference(ExternalReference ref, |
2191 int num_arguments) { | 2193 int num_arguments) { |
2192 mov(eax, Immediate(num_arguments)); | 2194 mov(eax, Immediate(num_arguments)); |
2193 mov(ebx, Immediate(ref)); | 2195 mov(ebx, Immediate(ref)); |
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3458 mov(eax, dividend); | 3460 mov(eax, dividend); |
3459 shr(eax, 31); | 3461 shr(eax, 31); |
3460 add(edx, eax); | 3462 add(edx, eax); |
3461 } | 3463 } |
3462 | 3464 |
3463 | 3465 |
3464 } // namespace internal | 3466 } // namespace internal |
3465 } // namespace v8 | 3467 } // namespace v8 |
3466 | 3468 |
3467 #endif // V8_TARGET_ARCH_IA32 | 3469 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |