| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2142 STATIC_ASSERT(String::kHashShift >= kSmiTagSize && kSmiTag == 0); | 2142 STATIC_ASSERT(String::kHashShift >= kSmiTagSize && kSmiTag == 0); |
| 2143 if (String::kHashShift > kSmiTagSize) { | 2143 if (String::kHashShift > kSmiTagSize) { |
| 2144 shr(hash, String::kHashShift - kSmiTagSize); | 2144 shr(hash, String::kHashShift - kSmiTagSize); |
| 2145 } | 2145 } |
| 2146 if (!index.is(hash)) { | 2146 if (!index.is(hash)) { |
| 2147 mov(index, hash); | 2147 mov(index, hash); |
| 2148 } | 2148 } |
| 2149 } | 2149 } |
| 2150 | 2150 |
| 2151 | 2151 |
| 2152 void MacroAssembler::CallRuntime(Runtime::FunctionId id, int num_arguments) { | |
| 2153 CallRuntime(Runtime::FunctionForId(id), num_arguments); | |
| 2154 } | |
| 2155 | |
| 2156 | |
| 2157 void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { | |
| 2158 const Runtime::Function* function = Runtime::FunctionForId(id); | |
| 2159 Set(eax, Immediate(function->nargs)); | |
| 2160 mov(ebx, Immediate(ExternalReference(function, isolate()))); | |
| 2161 CEntryStub ces(1, CpuFeatures::IsSupported(SSE2) ? kSaveFPRegs | |
| 2162 : kDontSaveFPRegs); | |
| 2163 CallStub(&ces); | |
| 2164 } | |
| 2165 | |
| 2166 | |
| 2167 void MacroAssembler::CallRuntime(const Runtime::Function* f, | 2152 void MacroAssembler::CallRuntime(const Runtime::Function* f, |
| 2168 int num_arguments) { | 2153 int num_arguments, |
| 2154 SaveFPRegsMode save_doubles) { |
| 2169 // If the expected number of arguments of the runtime function is | 2155 // If the expected number of arguments of the runtime function is |
| 2170 // constant, we check that the actual number of arguments match the | 2156 // constant, we check that the actual number of arguments match the |
| 2171 // expectation. | 2157 // expectation. |
| 2172 if (f->nargs >= 0 && f->nargs != num_arguments) { | 2158 if (f->nargs >= 0 && f->nargs != num_arguments) { |
| 2173 IllegalOperation(num_arguments); | 2159 IllegalOperation(num_arguments); |
| 2174 return; | 2160 return; |
| 2175 } | 2161 } |
| 2176 | 2162 |
| 2177 // TODO(1236192): Most runtime routines don't need the number of | 2163 // TODO(1236192): Most runtime routines don't need the number of |
| 2178 // arguments passed in because it is constant. At some point we | 2164 // arguments passed in because it is constant. At some point we |
| 2179 // should remove this need and make the runtime routine entry code | 2165 // should remove this need and make the runtime routine entry code |
| 2180 // smarter. | 2166 // smarter. |
| 2181 Set(eax, Immediate(num_arguments)); | 2167 Set(eax, Immediate(num_arguments)); |
| 2182 mov(ebx, Immediate(ExternalReference(f, isolate()))); | 2168 mov(ebx, Immediate(ExternalReference(f, isolate()))); |
| 2183 CEntryStub ces(1); | 2169 CEntryStub ces(1, CpuFeatures::IsSupported(SSE2) ? save_doubles |
| 2170 : kDontSaveFPRegs); |
| 2184 CallStub(&ces); | 2171 CallStub(&ces); |
| 2185 } | 2172 } |
| 2186 | 2173 |
| 2187 | 2174 |
| 2188 void MacroAssembler::CallExternalReference(ExternalReference ref, | 2175 void MacroAssembler::CallExternalReference(ExternalReference ref, |
| 2189 int num_arguments) { | 2176 int num_arguments) { |
| 2190 mov(eax, Immediate(num_arguments)); | 2177 mov(eax, Immediate(num_arguments)); |
| 2191 mov(ebx, Immediate(ref)); | 2178 mov(ebx, Immediate(ref)); |
| 2192 | 2179 |
| 2193 CEntryStub stub(1); | 2180 CEntryStub stub(1); |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3526 j(greater, &no_memento_available); | 3513 j(greater, &no_memento_available); |
| 3527 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), | 3514 cmp(MemOperand(scratch_reg, -AllocationMemento::kSize), |
| 3528 Immediate(Handle<Map>(isolate()->heap()->allocation_memento_map()))); | 3515 Immediate(Handle<Map>(isolate()->heap()->allocation_memento_map()))); |
| 3529 bind(&no_memento_available); | 3516 bind(&no_memento_available); |
| 3530 } | 3517 } |
| 3531 | 3518 |
| 3532 | 3519 |
| 3533 } } // namespace v8::internal | 3520 } } // namespace v8::internal |
| 3534 | 3521 |
| 3535 #endif // V8_TARGET_ARCH_IA32 | 3522 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |