| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2238 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); | 2238 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rcx); |
| 2239 __ j(not_equal, &slow); | 2239 __ j(not_equal, &slow); |
| 2240 __ jmp(&have_js_function); | 2240 __ jmp(&have_js_function); |
| 2241 | 2241 |
| 2242 // Unreachable | 2242 // Unreachable |
| 2243 __ int3(); | 2243 __ int3(); |
| 2244 } | 2244 } |
| 2245 | 2245 |
| 2246 | 2246 |
| 2247 void CallICStub::GenerateMiss(MacroAssembler* masm) { | 2247 void CallICStub::GenerateMiss(MacroAssembler* masm) { |
| 2248 // Get the receiver of the function from the stack; 1 ~ return address. | 2248 FrameScope scope(masm, StackFrame::INTERNAL); |
| 2249 __ movp(rcx, Operand(rsp, (arg_count() + 1) * kPointerSize)); | |
| 2250 | 2249 |
| 2251 { | 2250 // Push the receiver and the function and feedback info. |
| 2252 FrameScope scope(masm, StackFrame::INTERNAL); | 2251 __ Push(rdi); |
| 2252 __ Push(rbx); |
| 2253 __ Integer32ToSmi(rdx, rdx); |
| 2254 __ Push(rdx); |
| 2253 | 2255 |
| 2254 // Push the receiver and the function and feedback info. | 2256 // Call the entry. |
| 2255 __ Push(rcx); | 2257 IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss |
| 2256 __ Push(rdi); | 2258 : IC::kCallIC_Customization_Miss; |
| 2257 __ Push(rbx); | |
| 2258 __ Integer32ToSmi(rdx, rdx); | |
| 2259 __ Push(rdx); | |
| 2260 | 2259 |
| 2261 // Call the entry. | 2260 ExternalReference miss = ExternalReference(IC_Utility(id), masm->isolate()); |
| 2262 IC::UtilityId id = GetICState() == DEFAULT ? IC::kCallIC_Miss | 2261 __ CallExternalReference(miss, 3); |
| 2263 : IC::kCallIC_Customization_Miss; | |
| 2264 | 2262 |
| 2265 ExternalReference miss = ExternalReference(IC_Utility(id), | 2263 // Move result to edi and exit the internal frame. |
| 2266 masm->isolate()); | 2264 __ movp(rdi, rax); |
| 2267 __ CallExternalReference(miss, 4); | |
| 2268 | |
| 2269 // Move result to edi and exit the internal frame. | |
| 2270 __ movp(rdi, rax); | |
| 2271 } | |
| 2272 } | 2265 } |
| 2273 | 2266 |
| 2274 | 2267 |
| 2275 bool CEntryStub::NeedsImmovableCode() { | 2268 bool CEntryStub::NeedsImmovableCode() { |
| 2276 return false; | 2269 return false; |
| 2277 } | 2270 } |
| 2278 | 2271 |
| 2279 | 2272 |
| 2280 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { | 2273 void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
| 2281 CEntryStub::GenerateAheadOfTime(isolate); | 2274 CEntryStub::GenerateAheadOfTime(isolate); |
| (...skipping 2779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5061 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, | 5054 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, |
| 5062 kStackSpace, nullptr, return_value_operand, NULL); | 5055 kStackSpace, nullptr, return_value_operand, NULL); |
| 5063 } | 5056 } |
| 5064 | 5057 |
| 5065 | 5058 |
| 5066 #undef __ | 5059 #undef __ |
| 5067 | 5060 |
| 5068 } } // namespace v8::internal | 5061 } } // namespace v8::internal |
| 5069 | 5062 |
| 5070 #endif // V8_TARGET_ARCH_X64 | 5063 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |