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 2257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2268 #undef TRACE_IC | 2268 #undef TRACE_IC |
2269 | 2269 |
2270 | 2270 |
2271 // ---------------------------------------------------------------------------- | 2271 // ---------------------------------------------------------------------------- |
2272 // Static IC stub generators. | 2272 // Static IC stub generators. |
2273 // | 2273 // |
2274 | 2274 |
2275 // Used from ic-<arch>.cc. | 2275 // Used from ic-<arch>.cc. |
2276 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { | 2276 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { |
2277 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2277 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2278 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2279 HandleScope scope(isolate); | 2278 HandleScope scope(isolate); |
2280 DCHECK(args.length() == 3); | 2279 DCHECK(args.length() == 3); |
2281 Handle<Object> function = args.at<Object>(0); | 2280 Handle<Object> function = args.at<Object>(0); |
2282 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); | 2281 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); |
2283 Handle<Smi> slot = args.at<Smi>(2); | 2282 Handle<Smi> slot = args.at<Smi>(2); |
2284 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2283 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2285 CallICNexus nexus(vector, vector_slot); | 2284 CallICNexus nexus(vector, vector_slot); |
2286 CallIC ic(isolate, &nexus); | 2285 CallIC ic(isolate, &nexus); |
2287 ic.HandleMiss(function); | 2286 ic.HandleMiss(function); |
2288 return *function; | 2287 return *function; |
2289 } | 2288 } |
2290 | 2289 |
2291 | 2290 |
2292 // Used from ic-<arch>.cc. | 2291 // Used from ic-<arch>.cc. |
2293 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { | 2292 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { |
2294 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2293 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2295 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2296 HandleScope scope(isolate); | 2294 HandleScope scope(isolate); |
2297 Handle<Object> receiver = args.at<Object>(0); | 2295 Handle<Object> receiver = args.at<Object>(0); |
2298 | 2296 |
2299 DCHECK_EQ(4, args.length()); | 2297 DCHECK_EQ(4, args.length()); |
2300 Handle<Smi> slot = args.at<Smi>(2); | 2298 Handle<Smi> slot = args.at<Smi>(2); |
2301 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2299 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2302 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2300 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2303 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2301 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
2304 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 2302 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
2305 // set up outside the IC, handle that here. | 2303 // set up outside the IC, handle that here. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2349 ic.UpdateState(global, name); | 2347 ic.UpdateState(global, name); |
2350 | 2348 |
2351 Handle<Object> result; | 2349 Handle<Object> result; |
2352 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(name)); | 2350 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(name)); |
2353 return *result; | 2351 return *result; |
2354 } | 2352 } |
2355 | 2353 |
2356 // Used from ic-<arch>.cc | 2354 // Used from ic-<arch>.cc |
2357 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { | 2355 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { |
2358 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2356 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2359 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2360 HandleScope scope(isolate); | 2357 HandleScope scope(isolate); |
2361 Handle<Object> receiver = args.at<Object>(0); | 2358 Handle<Object> receiver = args.at<Object>(0); |
2362 Handle<Object> key = args.at<Object>(1); | 2359 Handle<Object> key = args.at<Object>(1); |
2363 | 2360 |
2364 DCHECK(args.length() == 4); | 2361 DCHECK(args.length() == 4); |
2365 Handle<Smi> slot = args.at<Smi>(2); | 2362 Handle<Smi> slot = args.at<Smi>(2); |
2366 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2363 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2367 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2364 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2368 KeyedLoadICNexus nexus(vector, vector_slot); | 2365 KeyedLoadICNexus nexus(vector, vector_slot); |
2369 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2366 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2370 ic.UpdateState(receiver, key); | 2367 ic.UpdateState(receiver, key); |
2371 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2368 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2372 } | 2369 } |
2373 | 2370 |
2374 | 2371 |
2375 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { | 2372 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { |
2376 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2373 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2377 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2378 HandleScope scope(isolate); | 2374 HandleScope scope(isolate); |
2379 DCHECK_EQ(4, args.length()); | 2375 DCHECK_EQ(4, args.length()); |
2380 typedef LoadWithVectorDescriptor Descriptor; | 2376 typedef LoadWithVectorDescriptor Descriptor; |
2381 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2377 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
2382 Handle<Object> key = args.at<Object>(Descriptor::kName); | 2378 Handle<Object> key = args.at<Object>(Descriptor::kName); |
2383 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2379 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
2384 Handle<TypeFeedbackVector> vector = | 2380 Handle<TypeFeedbackVector> vector = |
2385 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2381 args.at<TypeFeedbackVector>(Descriptor::kVector); |
2386 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2382 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2387 KeyedLoadICNexus nexus(vector, vector_slot); | 2383 KeyedLoadICNexus nexus(vector, vector_slot); |
2388 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2384 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2389 ic.UpdateState(receiver, key); | 2385 ic.UpdateState(receiver, key); |
2390 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2386 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2391 } | 2387 } |
2392 | 2388 |
2393 | 2389 |
2394 // Used from ic-<arch>.cc. | 2390 // Used from ic-<arch>.cc. |
2395 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2391 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
2396 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2392 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2397 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2398 HandleScope scope(isolate); | 2393 HandleScope scope(isolate); |
2399 Handle<Object> receiver = args.at<Object>(0); | 2394 Handle<Object> receiver = args.at<Object>(0); |
2400 Handle<Name> key = args.at<Name>(1); | 2395 Handle<Name> key = args.at<Name>(1); |
2401 Handle<Object> value = args.at<Object>(2); | 2396 Handle<Object> value = args.at<Object>(2); |
2402 | 2397 |
2403 DCHECK(args.length() == 5 || args.length() == 6); | 2398 DCHECK(args.length() == 5 || args.length() == 6); |
2404 Handle<Smi> slot = args.at<Smi>(3); | 2399 Handle<Smi> slot = args.at<Smi>(3); |
2405 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2400 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2406 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2401 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2407 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2402 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
2408 StoreICNexus nexus(vector, vector_slot); | 2403 StoreICNexus nexus(vector, vector_slot); |
2409 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2404 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2410 ic.UpdateState(receiver, key); | 2405 ic.UpdateState(receiver, key); |
2411 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2406 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2412 } else { | 2407 } else { |
2413 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2408 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
2414 vector->GetKind(vector_slot)); | 2409 vector->GetKind(vector_slot)); |
2415 KeyedStoreICNexus nexus(vector, vector_slot); | 2410 KeyedStoreICNexus nexus(vector, vector_slot); |
2416 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2411 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2417 ic.UpdateState(receiver, key); | 2412 ic.UpdateState(receiver, key); |
2418 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2413 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2419 } | 2414 } |
2420 } | 2415 } |
2421 | 2416 |
2422 | 2417 |
2423 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { | 2418 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { |
2424 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2419 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2425 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2426 HandleScope scope(isolate); | 2420 HandleScope scope(isolate); |
2427 DCHECK_EQ(5, args.length()); | 2421 DCHECK_EQ(5, args.length()); |
2428 typedef StoreWithVectorDescriptor Descriptor; | 2422 typedef StoreWithVectorDescriptor Descriptor; |
2429 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2423 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
2430 Handle<Name> key = args.at<Name>(Descriptor::kName); | 2424 Handle<Name> key = args.at<Name>(Descriptor::kName); |
2431 Handle<Object> value = args.at<Object>(Descriptor::kValue); | 2425 Handle<Object> value = args.at<Object>(Descriptor::kValue); |
2432 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2426 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
2433 Handle<TypeFeedbackVector> vector = | 2427 Handle<TypeFeedbackVector> vector = |
2434 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2428 args.at<TypeFeedbackVector>(Descriptor::kVector); |
2435 | 2429 |
2436 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2430 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2437 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2431 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
2438 StoreICNexus nexus(vector, vector_slot); | 2432 StoreICNexus nexus(vector, vector_slot); |
2439 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2433 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2440 ic.UpdateState(receiver, key); | 2434 ic.UpdateState(receiver, key); |
2441 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2435 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2442 } else { | 2436 } else { |
2443 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2437 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
2444 vector->GetKind(vector_slot)); | 2438 vector->GetKind(vector_slot)); |
2445 KeyedStoreICNexus nexus(vector, vector_slot); | 2439 KeyedStoreICNexus nexus(vector, vector_slot); |
2446 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2440 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2447 ic.UpdateState(receiver, key); | 2441 ic.UpdateState(receiver, key); |
2448 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2442 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2449 } | 2443 } |
2450 } | 2444 } |
2451 | 2445 |
2452 RUNTIME_FUNCTION(Runtime_TransitionStoreIC_MissFromStubFailure) { | 2446 RUNTIME_FUNCTION(Runtime_TransitionStoreIC_MissFromStubFailure) { |
2453 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2447 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2454 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2455 HandleScope scope(isolate); | 2448 HandleScope scope(isolate); |
2456 Handle<Object> receiver = args.at<Object>(0); | 2449 Handle<Object> receiver = args.at<Object>(0); |
2457 Handle<Name> key = args.at<Name>(1); | 2450 Handle<Name> key = args.at<Name>(1); |
2458 Handle<Object> value = args.at<Object>(2); | 2451 Handle<Object> value = args.at<Object>(2); |
2459 | 2452 |
2460 int length = args.length(); | 2453 int length = args.length(); |
2461 DCHECK(length == 5 || length == 6); | 2454 DCHECK(length == 5 || length == 6); |
2462 // TODO(ishell): use VectorStoreTransitionDescriptor indices here and update | 2455 // TODO(ishell): use VectorStoreTransitionDescriptor indices here and update |
2463 // this comment: | 2456 // this comment: |
2464 // | 2457 // |
(...skipping 25 matching lines...) Expand all Loading... |
2490 KeyedStoreICNexus nexus(vector, vector_slot); | 2483 KeyedStoreICNexus nexus(vector, vector_slot); |
2491 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2484 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2492 ic.UpdateState(receiver, key); | 2485 ic.UpdateState(receiver, key); |
2493 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2486 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2494 } | 2487 } |
2495 } | 2488 } |
2496 | 2489 |
2497 // Used from ic-<arch>.cc. | 2490 // Used from ic-<arch>.cc. |
2498 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { | 2491 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { |
2499 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2492 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2500 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2501 HandleScope scope(isolate); | 2493 HandleScope scope(isolate); |
2502 DCHECK_EQ(5, args.length()); | 2494 DCHECK_EQ(5, args.length()); |
2503 Handle<Object> receiver = args.at<Object>(0); | 2495 Handle<Object> receiver = args.at<Object>(0); |
2504 Handle<Object> key = args.at<Object>(1); | 2496 Handle<Object> key = args.at<Object>(1); |
2505 Handle<Object> value = args.at<Object>(2); | 2497 Handle<Object> value = args.at<Object>(2); |
2506 Handle<Smi> slot = args.at<Smi>(3); | 2498 Handle<Smi> slot = args.at<Smi>(3); |
2507 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2499 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2508 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2500 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2509 KeyedStoreICNexus nexus(vector, vector_slot); | 2501 KeyedStoreICNexus nexus(vector, vector_slot); |
2510 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2502 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2511 ic.UpdateState(receiver, key); | 2503 ic.UpdateState(receiver, key); |
2512 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2504 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2513 } | 2505 } |
2514 | 2506 |
2515 | 2507 |
2516 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { | 2508 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { |
2517 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2509 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2518 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2519 HandleScope scope(isolate); | 2510 HandleScope scope(isolate); |
2520 DCHECK_EQ(5, args.length()); | 2511 DCHECK_EQ(5, args.length()); |
2521 typedef StoreWithVectorDescriptor Descriptor; | 2512 typedef StoreWithVectorDescriptor Descriptor; |
2522 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2513 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
2523 Handle<Object> key = args.at<Object>(Descriptor::kName); | 2514 Handle<Object> key = args.at<Object>(Descriptor::kName); |
2524 Handle<Object> value = args.at<Object>(Descriptor::kValue); | 2515 Handle<Object> value = args.at<Object>(Descriptor::kValue); |
2525 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2516 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
2526 Handle<TypeFeedbackVector> vector = | 2517 Handle<TypeFeedbackVector> vector = |
2527 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2518 args.at<TypeFeedbackVector>(Descriptor::kVector); |
2528 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2519 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
(...skipping 15 matching lines...) Expand all Loading... |
2544 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2535 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2545 language_mode = ic.language_mode(); | 2536 language_mode = ic.language_mode(); |
2546 RETURN_RESULT_OR_FAILURE( | 2537 RETURN_RESULT_OR_FAILURE( |
2547 isolate, | 2538 isolate, |
2548 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2539 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
2549 } | 2540 } |
2550 | 2541 |
2551 | 2542 |
2552 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { | 2543 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { |
2553 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2544 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2554 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2555 HandleScope scope(isolate); | 2545 HandleScope scope(isolate); |
2556 // Length == 5 or 6, depending on whether the vector slot | 2546 // Length == 5 or 6, depending on whether the vector slot |
2557 // is passed in a virtual register or not. | 2547 // is passed in a virtual register or not. |
2558 DCHECK(args.length() == 5 || args.length() == 6); | 2548 DCHECK(args.length() == 5 || args.length() == 6); |
2559 Handle<Object> object = args.at<Object>(0); | 2549 Handle<Object> object = args.at<Object>(0); |
2560 Handle<Object> key = args.at<Object>(1); | 2550 Handle<Object> key = args.at<Object>(1); |
2561 Handle<Object> value = args.at<Object>(2); | 2551 Handle<Object> value = args.at<Object>(2); |
2562 Handle<Map> map = args.at<Map>(3); | 2552 Handle<Map> map = args.at<Map>(3); |
2563 LanguageMode language_mode; | 2553 LanguageMode language_mode; |
2564 KeyedStoreICNexus nexus(isolate); | 2554 KeyedStoreICNexus nexus(isolate); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2686 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { | 2676 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { |
2687 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); | 2677 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); |
2688 } | 2678 } |
2689 | 2679 |
2690 return result; | 2680 return result; |
2691 } | 2681 } |
2692 | 2682 |
2693 | 2683 |
2694 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { | 2684 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { |
2695 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2685 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2696 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2697 HandleScope scope(isolate); | 2686 HandleScope scope(isolate); |
2698 DCHECK_EQ(2, args.length()); | 2687 DCHECK_EQ(2, args.length()); |
2699 typedef BinaryOpDescriptor Descriptor; | 2688 typedef BinaryOpDescriptor Descriptor; |
2700 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2689 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
2701 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2690 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
2702 BinaryOpIC ic(isolate); | 2691 BinaryOpIC ic(isolate); |
2703 RETURN_RESULT_OR_FAILURE( | 2692 RETURN_RESULT_OR_FAILURE( |
2704 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2693 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); |
2705 } | 2694 } |
2706 | 2695 |
2707 | 2696 |
2708 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { | 2697 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { |
2709 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2698 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2710 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2711 HandleScope scope(isolate); | 2699 HandleScope scope(isolate); |
2712 DCHECK_EQ(3, args.length()); | 2700 DCHECK_EQ(3, args.length()); |
2713 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; | 2701 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; |
2714 Handle<AllocationSite> allocation_site = | 2702 Handle<AllocationSite> allocation_site = |
2715 args.at<AllocationSite>(Descriptor::kAllocationSite); | 2703 args.at<AllocationSite>(Descriptor::kAllocationSite); |
2716 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2704 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
2717 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2705 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
2718 BinaryOpIC ic(isolate); | 2706 BinaryOpIC ic(isolate); |
2719 RETURN_RESULT_OR_FAILURE(isolate, | 2707 RETURN_RESULT_OR_FAILURE(isolate, |
2720 ic.Transition(allocation_site, left, right)); | 2708 ic.Transition(allocation_site, left, right)); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2773 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); | 2761 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); |
2774 } | 2762 } |
2775 | 2763 |
2776 return *new_target; | 2764 return *new_target; |
2777 } | 2765 } |
2778 | 2766 |
2779 | 2767 |
2780 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. | 2768 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. |
2781 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { | 2769 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { |
2782 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2770 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2783 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2784 HandleScope scope(isolate); | 2771 HandleScope scope(isolate); |
2785 DCHECK(args.length() == 3); | 2772 DCHECK(args.length() == 3); |
2786 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 2773 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
2787 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 2774 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); |
2788 } | 2775 } |
2789 | 2776 |
2790 | 2777 |
2791 RUNTIME_FUNCTION(Runtime_Unreachable) { | 2778 RUNTIME_FUNCTION(Runtime_Unreachable) { |
2792 UNREACHABLE(); | 2779 UNREACHABLE(); |
2793 CHECK(false); | 2780 CHECK(false); |
2794 return isolate->heap()->undefined_value(); | 2781 return isolate->heap()->undefined_value(); |
2795 } | 2782 } |
2796 | 2783 |
2797 | 2784 |
2798 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 2785 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
2799 ToBooleanICStub stub(isolate(), extra_ic_state()); | 2786 ToBooleanICStub stub(isolate(), extra_ic_state()); |
2800 bool to_boolean_value = stub.UpdateStatus(object); | 2787 bool to_boolean_value = stub.UpdateStatus(object); |
2801 Handle<Code> code = stub.GetCode(); | 2788 Handle<Code> code = stub.GetCode(); |
2802 set_target(*code); | 2789 set_target(*code); |
2803 return isolate()->factory()->ToBoolean(to_boolean_value); | 2790 return isolate()->factory()->ToBoolean(to_boolean_value); |
2804 } | 2791 } |
2805 | 2792 |
2806 | 2793 |
2807 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { | 2794 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { |
2808 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2795 TimerEventScope<TimerEventIcMiss> timer(isolate); |
2809 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
2810 DCHECK(args.length() == 1); | 2796 DCHECK(args.length() == 1); |
2811 HandleScope scope(isolate); | 2797 HandleScope scope(isolate); |
2812 Handle<Object> object = args.at<Object>(0); | 2798 Handle<Object> object = args.at<Object>(0); |
2813 ToBooleanIC ic(isolate); | 2799 ToBooleanIC ic(isolate); |
2814 return *ic.ToBoolean(object); | 2800 return *ic.ToBoolean(object); |
2815 } | 2801 } |
2816 | 2802 |
2817 | 2803 |
2818 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { | 2804 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { |
2819 Handle<JSObject> receiver = args.at<JSObject>(0); | 2805 Handle<JSObject> receiver = args.at<JSObject>(0); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3010 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2996 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
3011 Object::GetProperty(&it)); | 2997 Object::GetProperty(&it)); |
3012 } | 2998 } |
3013 | 2999 |
3014 return *result; | 3000 return *result; |
3015 } | 3001 } |
3016 | 3002 |
3017 | 3003 |
3018 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { | 3004 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { |
3019 TimerEventScope<TimerEventIcMiss> timer(isolate); | 3005 TimerEventScope<TimerEventIcMiss> timer(isolate); |
3020 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); | |
3021 HandleScope scope(isolate); | 3006 HandleScope scope(isolate); |
3022 DCHECK_EQ(4, args.length()); | 3007 DCHECK_EQ(4, args.length()); |
3023 typedef LoadWithVectorDescriptor Descriptor; | 3008 typedef LoadWithVectorDescriptor Descriptor; |
3024 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 3009 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
3025 Handle<Name> key = args.at<Name>(Descriptor::kName); | 3010 Handle<Name> key = args.at<Name>(Descriptor::kName); |
3026 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 3011 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
3027 Handle<TypeFeedbackVector> vector = | 3012 Handle<TypeFeedbackVector> vector = |
3028 args.at<TypeFeedbackVector>(Descriptor::kVector); | 3013 args.at<TypeFeedbackVector>(Descriptor::kVector); |
3029 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 3014 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
3030 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 3015 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
3031 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 3016 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
3032 // set up outside the IC, handle that here. | 3017 // set up outside the IC, handle that here. |
3033 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { | 3018 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { |
3034 LoadICNexus nexus(vector, vector_slot); | 3019 LoadICNexus nexus(vector, vector_slot); |
3035 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3020 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3036 ic.UpdateState(receiver, key); | 3021 ic.UpdateState(receiver, key); |
3037 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 3022 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
3038 } else { | 3023 } else { |
3039 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 3024 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
3040 vector->GetKind(vector_slot)); | 3025 vector->GetKind(vector_slot)); |
3041 KeyedLoadICNexus nexus(vector, vector_slot); | 3026 KeyedLoadICNexus nexus(vector, vector_slot); |
3042 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3027 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3043 ic.UpdateState(receiver, key); | 3028 ic.UpdateState(receiver, key); |
3044 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 3029 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
3045 } | 3030 } |
3046 } | 3031 } |
3047 } // namespace internal | 3032 } // namespace internal |
3048 } // namespace v8 | 3033 } // namespace v8 |
OLD | NEW |