| 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 #include "src/ic/ic.h" | 5 #include "src/ic/ic.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-arguments-inl.h" | 8 #include "src/api-arguments-inl.h" |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
| (...skipping 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2397 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2397 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2398 } | 2398 } |
| 2399 | 2399 |
| 2400 | 2400 |
| 2401 // Used from ic-<arch>.cc. | 2401 // Used from ic-<arch>.cc. |
| 2402 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2402 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
| 2403 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2403 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2404 HandleScope scope(isolate); | 2404 HandleScope scope(isolate); |
| 2405 DCHECK_EQ(5, args.length()); | 2405 DCHECK_EQ(5, args.length()); |
| 2406 // Runtime functions don't follow the IC's calling convention. | 2406 // Runtime functions don't follow the IC's calling convention. |
| 2407 Handle<Object> receiver = args.at<Object>(0); | 2407 Handle<Object> value = args.at<Object>(0); |
| 2408 Handle<Name> key = args.at<Name>(1); | 2408 Handle<Smi> slot = args.at<Smi>(1); |
| 2409 Handle<Object> value = args.at<Object>(2); | 2409 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); |
| 2410 Handle<Smi> slot = args.at<Smi>(3); | 2410 Handle<Object> receiver = args.at<Object>(3); |
| 2411 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2411 Handle<Name> key = args.at<Name>(4); |
| 2412 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2412 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2413 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2413 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
| 2414 StoreICNexus nexus(vector, vector_slot); | 2414 StoreICNexus nexus(vector, vector_slot); |
| 2415 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2415 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2416 ic.UpdateState(receiver, key); | 2416 ic.UpdateState(receiver, key); |
| 2417 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2417 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2418 } else { | 2418 } else { |
| 2419 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2419 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
| 2420 vector->GetKind(vector_slot)); | 2420 vector->GetKind(vector_slot)); |
| 2421 KeyedStoreICNexus nexus(vector, vector_slot); | 2421 KeyedStoreICNexus nexus(vector, vector_slot); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2453 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2453 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2454 } | 2454 } |
| 2455 } | 2455 } |
| 2456 | 2456 |
| 2457 // Used from ic-<arch>.cc. | 2457 // Used from ic-<arch>.cc. |
| 2458 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { | 2458 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { |
| 2459 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2459 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2460 HandleScope scope(isolate); | 2460 HandleScope scope(isolate); |
| 2461 DCHECK_EQ(5, args.length()); | 2461 DCHECK_EQ(5, args.length()); |
| 2462 // Runtime functions don't follow the IC's calling convention. | 2462 // Runtime functions don't follow the IC's calling convention. |
| 2463 Handle<Object> receiver = args.at<Object>(0); | 2463 Handle<Object> value = args.at<Object>(0); |
| 2464 Handle<Object> key = args.at<Object>(1); | 2464 Handle<Smi> slot = args.at<Smi>(1); |
| 2465 Handle<Object> value = args.at<Object>(2); | 2465 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(2); |
| 2466 Handle<Smi> slot = args.at<Smi>(3); | 2466 Handle<Object> receiver = args.at<Object>(3); |
| 2467 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2467 Handle<Object> key = args.at<Object>(4); |
| 2468 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2468 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2469 KeyedStoreICNexus nexus(vector, vector_slot); | 2469 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2470 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2470 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2471 ic.UpdateState(receiver, key); | 2471 ic.UpdateState(receiver, key); |
| 2472 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2472 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2473 } | 2473 } |
| 2474 | 2474 |
| 2475 | 2475 |
| 2476 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { | 2476 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { |
| 2477 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2477 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2489 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2489 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2490 ic.UpdateState(receiver, key); | 2490 ic.UpdateState(receiver, key); |
| 2491 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2491 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2492 } | 2492 } |
| 2493 | 2493 |
| 2494 | 2494 |
| 2495 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { | 2495 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { |
| 2496 HandleScope scope(isolate); | 2496 HandleScope scope(isolate); |
| 2497 DCHECK_EQ(5, args.length()); | 2497 DCHECK_EQ(5, args.length()); |
| 2498 // Runtime functions don't follow the IC's calling convention. | 2498 // Runtime functions don't follow the IC's calling convention. |
| 2499 Handle<Object> object = args.at<Object>(0); | 2499 Handle<Object> value = args.at<Object>(0); |
| 2500 Handle<Object> key = args.at<Object>(1); | 2500 // slot and vector parameters are not used. |
| 2501 Handle<Object> value = args.at<Object>(2); | 2501 Handle<Object> object = args.at<Object>(3); |
| 2502 Handle<Object> key = args.at<Object>(4); |
| 2502 LanguageMode language_mode; | 2503 LanguageMode language_mode; |
| 2503 KeyedStoreICNexus nexus(isolate); | 2504 KeyedStoreICNexus nexus(isolate); |
| 2504 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2505 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2505 language_mode = ic.language_mode(); | 2506 language_mode = ic.language_mode(); |
| 2506 RETURN_RESULT_OR_FAILURE( | 2507 RETURN_RESULT_OR_FAILURE( |
| 2507 isolate, | 2508 isolate, |
| 2508 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2509 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
| 2509 } | 2510 } |
| 2510 | 2511 |
| 2511 | 2512 |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2983 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2984 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
| 2984 vector->GetKind(vector_slot)); | 2985 vector->GetKind(vector_slot)); |
| 2985 KeyedLoadICNexus nexus(vector, vector_slot); | 2986 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2986 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2987 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2987 ic.UpdateState(receiver, key); | 2988 ic.UpdateState(receiver, key); |
| 2988 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2989 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2989 } | 2990 } |
| 2990 } | 2991 } |
| 2991 } // namespace internal | 2992 } // namespace internal |
| 2992 } // namespace v8 | 2993 } // namespace v8 |
| OLD | NEW |