| 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 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2371 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2371 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2372 ic.UpdateState(receiver, key); | 2372 ic.UpdateState(receiver, key); |
| 2373 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2373 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2374 } | 2374 } |
| 2375 | 2375 |
| 2376 | 2376 |
| 2377 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { | 2377 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { |
| 2378 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2378 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2379 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 2379 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2380 HandleScope scope(isolate); | 2380 HandleScope scope(isolate); |
| 2381 Handle<Object> receiver = args.at<Object>(0); | 2381 DCHECK_EQ(4, args.length()); |
| 2382 Handle<Object> key = args.at<Object>(1); | 2382 typedef LoadWithVectorDescriptor Descriptor; |
| 2383 | 2383 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
| 2384 DCHECK(args.length() == 4); | 2384 Handle<Object> key = args.at<Object>(Descriptor::kName); |
| 2385 Handle<Smi> slot = args.at<Smi>(2); | 2385 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
| 2386 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2386 Handle<TypeFeedbackVector> vector = |
| 2387 args.at<TypeFeedbackVector>(Descriptor::kVector); |
| 2387 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2388 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2388 KeyedLoadICNexus nexus(vector, vector_slot); | 2389 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2389 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2390 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2390 ic.UpdateState(receiver, key); | 2391 ic.UpdateState(receiver, key); |
| 2391 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2392 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 2392 } | 2393 } |
| 2393 | 2394 |
| 2394 | 2395 |
| 2395 // Used from ic-<arch>.cc. | 2396 // Used from ic-<arch>.cc. |
| 2396 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2397 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2418 ic.UpdateState(receiver, key); | 2419 ic.UpdateState(receiver, key); |
| 2419 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2420 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2420 } | 2421 } |
| 2421 } | 2422 } |
| 2422 | 2423 |
| 2423 | 2424 |
| 2424 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { | 2425 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { |
| 2425 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2426 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2426 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 2427 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2427 HandleScope scope(isolate); | 2428 HandleScope scope(isolate); |
| 2429 DCHECK_EQ(5, args.length()); |
| 2430 typedef StoreWithVectorDescriptor Descriptor; |
| 2431 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
| 2432 Handle<Name> key = args.at<Name>(Descriptor::kName); |
| 2433 Handle<Object> value = args.at<Object>(Descriptor::kValue); |
| 2434 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
| 2435 Handle<TypeFeedbackVector> vector = |
| 2436 args.at<TypeFeedbackVector>(Descriptor::kVector); |
| 2437 |
| 2438 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2439 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
| 2440 StoreICNexus nexus(vector, vector_slot); |
| 2441 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2442 ic.UpdateState(receiver, key); |
| 2443 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2444 } else { |
| 2445 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
| 2446 vector->GetKind(vector_slot)); |
| 2447 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2448 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2449 ic.UpdateState(receiver, key); |
| 2450 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2451 } |
| 2452 } |
| 2453 |
| 2454 RUNTIME_FUNCTION(Runtime_TransitionStoreIC_MissFromStubFailure) { |
| 2455 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2456 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2457 HandleScope scope(isolate); |
| 2428 Handle<Object> receiver = args.at<Object>(0); | 2458 Handle<Object> receiver = args.at<Object>(0); |
| 2429 Handle<Name> key = args.at<Name>(1); | 2459 Handle<Name> key = args.at<Name>(1); |
| 2430 Handle<Object> value = args.at<Object>(2); | 2460 Handle<Object> value = args.at<Object>(2); |
| 2431 | 2461 |
| 2432 int length = args.length(); | 2462 int length = args.length(); |
| 2433 DCHECK(length == 5 || length == 6); | 2463 DCHECK(length == 5 || length == 6); |
| 2464 // TODO(ishell): use VectorStoreTransitionDescriptor indices here and update |
| 2465 // this comment: |
| 2466 // |
| 2434 // We might have slot and vector, for a normal miss (slot(3), vector(4)). | 2467 // We might have slot and vector, for a normal miss (slot(3), vector(4)). |
| 2435 // Or, map and vector for a transitioning store miss (map(3), vector(4)). | 2468 // Or, map and vector for a transitioning store miss (map(3), vector(4)). |
| 2436 // In this case, we need to recover the slot from a virtual register. | 2469 // In this case, we need to recover the slot from a virtual register. |
| 2437 // If length == 6, then a map is included (map(3), slot(4), vector(5)). | 2470 // If length == 6, then a map is included (map(3), slot(4), vector(5)). |
| 2438 Handle<Smi> slot; | 2471 Handle<Smi> slot; |
| 2439 Handle<TypeFeedbackVector> vector; | 2472 Handle<TypeFeedbackVector> vector; |
| 2440 if (length == 5) { | 2473 if (length == 5) { |
| 2441 if (args.at<Object>(3)->IsMap()) { | 2474 vector = args.at<TypeFeedbackVector>(4); |
| 2442 vector = args.at<TypeFeedbackVector>(4); | 2475 slot = handle( |
| 2443 slot = handle( | 2476 *reinterpret_cast<Smi**>(isolate->virtual_slot_register_address()), |
| 2444 *reinterpret_cast<Smi**>(isolate->virtual_slot_register_address()), | 2477 isolate); |
| 2445 isolate); | |
| 2446 } else { | |
| 2447 vector = args.at<TypeFeedbackVector>(4); | |
| 2448 slot = args.at<Smi>(3); | |
| 2449 } | |
| 2450 } else { | 2478 } else { |
| 2451 vector = args.at<TypeFeedbackVector>(5); | 2479 vector = args.at<TypeFeedbackVector>(5); |
| 2452 slot = args.at<Smi>(4); | 2480 slot = args.at<Smi>(4); |
| 2453 } | 2481 } |
| 2454 | 2482 |
| 2455 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2483 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2456 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2484 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
| 2457 StoreICNexus nexus(vector, vector_slot); | 2485 StoreICNexus nexus(vector, vector_slot); |
| 2458 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2486 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2459 ic.UpdateState(receiver, key); | 2487 ic.UpdateState(receiver, key); |
| 2460 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2488 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2461 } else { | 2489 } else { |
| 2462 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2490 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
| 2463 vector->GetKind(vector_slot)); | 2491 vector->GetKind(vector_slot)); |
| 2464 KeyedStoreICNexus nexus(vector, vector_slot); | 2492 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2465 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2493 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2466 ic.UpdateState(receiver, key); | 2494 ic.UpdateState(receiver, key); |
| 2467 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2495 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2468 } | 2496 } |
| 2469 } | 2497 } |
| 2470 | 2498 |
| 2471 | |
| 2472 // Used from ic-<arch>.cc. | 2499 // Used from ic-<arch>.cc. |
| 2473 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { | 2500 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { |
| 2474 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2501 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2475 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 2502 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2476 HandleScope scope(isolate); | 2503 HandleScope scope(isolate); |
| 2504 DCHECK_EQ(5, args.length()); |
| 2477 Handle<Object> receiver = args.at<Object>(0); | 2505 Handle<Object> receiver = args.at<Object>(0); |
| 2478 Handle<Object> key = args.at<Object>(1); | 2506 Handle<Object> key = args.at<Object>(1); |
| 2479 Handle<Object> value = args.at<Object>(2); | 2507 Handle<Object> value = args.at<Object>(2); |
| 2480 | |
| 2481 DCHECK(args.length() == 5); | |
| 2482 Handle<Smi> slot = args.at<Smi>(3); | 2508 Handle<Smi> slot = args.at<Smi>(3); |
| 2483 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2509 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
| 2484 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2510 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2485 KeyedStoreICNexus nexus(vector, vector_slot); | 2511 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2486 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2512 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2487 ic.UpdateState(receiver, key); | 2513 ic.UpdateState(receiver, key); |
| 2488 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2514 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2489 } | 2515 } |
| 2490 | 2516 |
| 2491 | 2517 |
| 2492 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { | 2518 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { |
| 2493 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2519 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2494 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 2520 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2495 HandleScope scope(isolate); | 2521 HandleScope scope(isolate); |
| 2496 Handle<Object> receiver = args.at<Object>(0); | 2522 DCHECK_EQ(5, args.length()); |
| 2497 Handle<Object> key = args.at<Object>(1); | 2523 typedef StoreWithVectorDescriptor Descriptor; |
| 2498 Handle<Object> value = args.at<Object>(2); | 2524 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
| 2499 | 2525 Handle<Object> key = args.at<Object>(Descriptor::kName); |
| 2500 DCHECK(args.length() == 5); | 2526 Handle<Object> value = args.at<Object>(Descriptor::kValue); |
| 2501 Handle<Smi> slot = args.at<Smi>(3); | 2527 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
| 2502 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2528 Handle<TypeFeedbackVector> vector = |
| 2529 args.at<TypeFeedbackVector>(Descriptor::kVector); |
| 2503 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2530 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 2504 KeyedStoreICNexus nexus(vector, vector_slot); | 2531 KeyedStoreICNexus nexus(vector, vector_slot); |
| 2505 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2532 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2506 ic.UpdateState(receiver, key); | 2533 ic.UpdateState(receiver, key); |
| 2507 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2534 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
| 2508 } | 2535 } |
| 2509 | 2536 |
| 2510 | 2537 |
| 2511 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { | 2538 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Slow) { |
| 2512 HandleScope scope(isolate); | 2539 HandleScope scope(isolate); |
| 2513 DCHECK(args.length() == 5); | 2540 DCHECK_EQ(5, args.length()); |
| 2514 Handle<Object> object = args.at<Object>(0); | 2541 Handle<Object> object = args.at<Object>(0); |
| 2515 Handle<Object> key = args.at<Object>(1); | 2542 Handle<Object> key = args.at<Object>(1); |
| 2516 Handle<Object> value = args.at<Object>(2); | 2543 Handle<Object> value = args.at<Object>(2); |
| 2517 LanguageMode language_mode; | 2544 LanguageMode language_mode; |
| 2518 KeyedStoreICNexus nexus(isolate); | 2545 KeyedStoreICNexus nexus(isolate); |
| 2519 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2546 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
| 2520 language_mode = ic.language_mode(); | 2547 language_mode = ic.language_mode(); |
| 2521 RETURN_RESULT_OR_FAILURE( | 2548 RETURN_RESULT_OR_FAILURE( |
| 2522 isolate, | 2549 isolate, |
| 2523 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2550 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2664 | 2691 |
| 2665 return result; | 2692 return result; |
| 2666 } | 2693 } |
| 2667 | 2694 |
| 2668 | 2695 |
| 2669 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { | 2696 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { |
| 2670 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2697 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2671 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 2698 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2672 HandleScope scope(isolate); | 2699 HandleScope scope(isolate); |
| 2673 DCHECK_EQ(2, args.length()); | 2700 DCHECK_EQ(2, args.length()); |
| 2674 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); | 2701 typedef BinaryOpDescriptor Descriptor; |
| 2675 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); | 2702 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
| 2703 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
| 2676 BinaryOpIC ic(isolate); | 2704 BinaryOpIC ic(isolate); |
| 2677 RETURN_RESULT_OR_FAILURE( | 2705 RETURN_RESULT_OR_FAILURE( |
| 2678 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2706 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); |
| 2679 } | 2707 } |
| 2680 | 2708 |
| 2681 | 2709 |
| 2682 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { | 2710 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { |
| 2683 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2711 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2684 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 2712 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2685 HandleScope scope(isolate); | 2713 HandleScope scope(isolate); |
| 2686 DCHECK_EQ(3, args.length()); | 2714 DCHECK_EQ(3, args.length()); |
| 2715 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; |
| 2687 Handle<AllocationSite> allocation_site = | 2716 Handle<AllocationSite> allocation_site = |
| 2688 args.at<AllocationSite>(BinaryOpWithAllocationSiteStub::kAllocationSite); | 2717 args.at<AllocationSite>(Descriptor::kAllocationSite); |
| 2689 Handle<Object> left = args.at<Object>(BinaryOpWithAllocationSiteStub::kLeft); | 2718 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
| 2690 Handle<Object> right = | 2719 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
| 2691 args.at<Object>(BinaryOpWithAllocationSiteStub::kRight); | |
| 2692 BinaryOpIC ic(isolate); | 2720 BinaryOpIC ic(isolate); |
| 2693 RETURN_RESULT_OR_FAILURE(isolate, | 2721 RETURN_RESULT_OR_FAILURE(isolate, |
| 2694 ic.Transition(allocation_site, left, right)); | 2722 ic.Transition(allocation_site, left, right)); |
| 2695 } | 2723 } |
| 2696 | 2724 |
| 2697 Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op) { | 2725 Code* CompareIC::GetRawUninitialized(Isolate* isolate, Token::Value op) { |
| 2698 CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED, | 2726 CompareICStub stub(isolate, op, CompareICState::UNINITIALIZED, |
| 2699 CompareICState::UNINITIALIZED, | 2727 CompareICState::UNINITIALIZED, |
| 2700 CompareICState::UNINITIALIZED); | 2728 CompareICState::UNINITIALIZED); |
| 2701 Code* code = NULL; | 2729 Code* code = NULL; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2986 } | 3014 } |
| 2987 | 3015 |
| 2988 return *result; | 3016 return *result; |
| 2989 } | 3017 } |
| 2990 | 3018 |
| 2991 | 3019 |
| 2992 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { | 3020 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { |
| 2993 TimerEventScope<TimerEventIcMiss> timer(isolate); | 3021 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2994 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | 3022 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
| 2995 HandleScope scope(isolate); | 3023 HandleScope scope(isolate); |
| 2996 Handle<Object> receiver = args.at<Object>(0); | 3024 DCHECK_EQ(4, args.length()); |
| 2997 Handle<Name> key = args.at<Name>(1); | 3025 typedef LoadWithVectorDescriptor Descriptor; |
| 2998 | 3026 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
| 2999 DCHECK(args.length() == 4); | 3027 Handle<Name> key = args.at<Name>(Descriptor::kName); |
| 3000 Handle<Smi> slot = args.at<Smi>(2); | 3028 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
| 3001 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 3029 Handle<TypeFeedbackVector> vector = |
| 3030 args.at<TypeFeedbackVector>(Descriptor::kVector); |
| 3002 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 3031 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
| 3003 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 3032 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
| 3004 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 3033 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
| 3005 // set up outside the IC, handle that here. | 3034 // set up outside the IC, handle that here. |
| 3006 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { | 3035 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { |
| 3007 LoadICNexus nexus(vector, vector_slot); | 3036 LoadICNexus nexus(vector, vector_slot); |
| 3008 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3037 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 3009 ic.UpdateState(receiver, key); | 3038 ic.UpdateState(receiver, key); |
| 3010 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 3039 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 3011 } else { | 3040 } else { |
| 3012 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 3041 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
| 3013 vector->GetKind(vector_slot)); | 3042 vector->GetKind(vector_slot)); |
| 3014 KeyedLoadICNexus nexus(vector, vector_slot); | 3043 KeyedLoadICNexus nexus(vector, vector_slot); |
| 3015 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3044 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 3016 ic.UpdateState(receiver, key); | 3045 ic.UpdateState(receiver, key); |
| 3017 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 3046 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
| 3018 } | 3047 } |
| 3019 } | 3048 } |
| 3020 } // namespace internal | 3049 } // namespace internal |
| 3021 } // namespace v8 | 3050 } // namespace v8 |
| OLD | NEW |