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 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 #undef TRACE_IC | 2228 #undef TRACE_IC |
2229 | 2229 |
2230 | 2230 |
2231 // ---------------------------------------------------------------------------- | 2231 // ---------------------------------------------------------------------------- |
2232 // Static IC stub generators. | 2232 // Static IC stub generators. |
2233 // | 2233 // |
2234 | 2234 |
2235 // Used from ic-<arch>.cc. | 2235 // Used from ic-<arch>.cc. |
2236 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { | 2236 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { |
2237 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2237 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2238 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2238 HandleScope scope(isolate); | 2239 HandleScope scope(isolate); |
2239 DCHECK(args.length() == 3); | 2240 DCHECK(args.length() == 3); |
2240 Handle<Object> function = args.at<Object>(0); | 2241 Handle<Object> function = args.at<Object>(0); |
2241 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); | 2242 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); |
2242 Handle<Smi> slot = args.at<Smi>(2); | 2243 Handle<Smi> slot = args.at<Smi>(2); |
2243 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2244 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2244 CallICNexus nexus(vector, vector_slot); | 2245 CallICNexus nexus(vector, vector_slot); |
2245 CallIC ic(isolate, &nexus); | 2246 CallIC ic(isolate, &nexus); |
2246 ic.HandleMiss(function); | 2247 ic.HandleMiss(function); |
2247 return *function; | 2248 return *function; |
2248 } | 2249 } |
2249 | 2250 |
2250 | 2251 |
2251 // Used from ic-<arch>.cc. | 2252 // Used from ic-<arch>.cc. |
2252 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { | 2253 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { |
2253 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2254 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2255 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2254 HandleScope scope(isolate); | 2256 HandleScope scope(isolate); |
2255 Handle<Object> receiver = args.at<Object>(0); | 2257 Handle<Object> receiver = args.at<Object>(0); |
2256 | 2258 |
2257 DCHECK_EQ(4, args.length()); | 2259 DCHECK_EQ(4, args.length()); |
2258 Handle<Smi> slot = args.at<Smi>(2); | 2260 Handle<Smi> slot = args.at<Smi>(2); |
2259 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2261 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2260 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2262 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2261 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2263 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
2262 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 2264 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
2263 // set up outside the IC, handle that here. | 2265 // set up outside the IC, handle that here. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2307 ic.UpdateState(global, name); | 2309 ic.UpdateState(global, name); |
2308 | 2310 |
2309 Handle<Object> result; | 2311 Handle<Object> result; |
2310 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(name)); | 2312 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(name)); |
2311 return *result; | 2313 return *result; |
2312 } | 2314 } |
2313 | 2315 |
2314 // Used from ic-<arch>.cc | 2316 // Used from ic-<arch>.cc |
2315 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { | 2317 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { |
2316 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2318 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2319 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2317 HandleScope scope(isolate); | 2320 HandleScope scope(isolate); |
2318 Handle<Object> receiver = args.at<Object>(0); | 2321 Handle<Object> receiver = args.at<Object>(0); |
2319 Handle<Object> key = args.at<Object>(1); | 2322 Handle<Object> key = args.at<Object>(1); |
2320 | 2323 |
2321 DCHECK(args.length() == 4); | 2324 DCHECK(args.length() == 4); |
2322 Handle<Smi> slot = args.at<Smi>(2); | 2325 Handle<Smi> slot = args.at<Smi>(2); |
2323 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2326 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2324 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2327 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2325 KeyedLoadICNexus nexus(vector, vector_slot); | 2328 KeyedLoadICNexus nexus(vector, vector_slot); |
2326 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2329 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2327 ic.UpdateState(receiver, key); | 2330 ic.UpdateState(receiver, key); |
2328 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2331 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2329 } | 2332 } |
2330 | 2333 |
2331 | 2334 |
2332 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { | 2335 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { |
2333 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2336 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2337 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2334 HandleScope scope(isolate); | 2338 HandleScope scope(isolate); |
2335 DCHECK_EQ(4, args.length()); | 2339 DCHECK_EQ(4, args.length()); |
2336 typedef LoadWithVectorDescriptor Descriptor; | 2340 typedef LoadWithVectorDescriptor Descriptor; |
2337 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2341 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
2338 Handle<Object> key = args.at<Object>(Descriptor::kName); | 2342 Handle<Object> key = args.at<Object>(Descriptor::kName); |
2339 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2343 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
2340 Handle<TypeFeedbackVector> vector = | 2344 Handle<TypeFeedbackVector> vector = |
2341 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2345 args.at<TypeFeedbackVector>(Descriptor::kVector); |
2342 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2346 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2343 KeyedLoadICNexus nexus(vector, vector_slot); | 2347 KeyedLoadICNexus nexus(vector, vector_slot); |
2344 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2348 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2345 ic.UpdateState(receiver, key); | 2349 ic.UpdateState(receiver, key); |
2346 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2350 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2347 } | 2351 } |
2348 | 2352 |
2349 | 2353 |
2350 // Used from ic-<arch>.cc. | 2354 // Used from ic-<arch>.cc. |
2351 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2355 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
2352 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2356 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2357 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2353 HandleScope scope(isolate); | 2358 HandleScope scope(isolate); |
2354 Handle<Object> receiver = args.at<Object>(0); | 2359 Handle<Object> receiver = args.at<Object>(0); |
2355 Handle<Name> key = args.at<Name>(1); | 2360 Handle<Name> key = args.at<Name>(1); |
2356 Handle<Object> value = args.at<Object>(2); | 2361 Handle<Object> value = args.at<Object>(2); |
2357 | 2362 |
2358 DCHECK(args.length() == 5 || args.length() == 6); | 2363 DCHECK(args.length() == 5 || args.length() == 6); |
2359 Handle<Smi> slot = args.at<Smi>(3); | 2364 Handle<Smi> slot = args.at<Smi>(3); |
2360 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2365 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2361 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2366 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2362 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2367 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
2363 StoreICNexus nexus(vector, vector_slot); | 2368 StoreICNexus nexus(vector, vector_slot); |
2364 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2369 StoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2365 ic.UpdateState(receiver, key); | 2370 ic.UpdateState(receiver, key); |
2366 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2371 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2367 } else { | 2372 } else { |
2368 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2373 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
2369 vector->GetKind(vector_slot)); | 2374 vector->GetKind(vector_slot)); |
2370 KeyedStoreICNexus nexus(vector, vector_slot); | 2375 KeyedStoreICNexus nexus(vector, vector_slot); |
2371 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2376 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2372 ic.UpdateState(receiver, key); | 2377 ic.UpdateState(receiver, key); |
2373 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2378 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2374 } | 2379 } |
2375 } | 2380 } |
2376 | 2381 |
2377 | 2382 |
2378 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { | 2383 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { |
2379 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2384 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2385 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2380 HandleScope scope(isolate); | 2386 HandleScope scope(isolate); |
2381 DCHECK_EQ(5, args.length()); | 2387 DCHECK_EQ(5, args.length()); |
2382 typedef StoreWithVectorDescriptor Descriptor; | 2388 typedef StoreWithVectorDescriptor Descriptor; |
2383 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2389 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
2384 Handle<Name> key = args.at<Name>(Descriptor::kName); | 2390 Handle<Name> key = args.at<Name>(Descriptor::kName); |
2385 Handle<Object> value = args.at<Object>(Descriptor::kValue); | 2391 Handle<Object> value = args.at<Object>(Descriptor::kValue); |
2386 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2392 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
2387 Handle<TypeFeedbackVector> vector = | 2393 Handle<TypeFeedbackVector> vector = |
2388 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2394 args.at<TypeFeedbackVector>(Descriptor::kVector); |
2389 | 2395 |
2390 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2396 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2391 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { | 2397 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::STORE_IC) { |
2392 StoreICNexus nexus(vector, vector_slot); | 2398 StoreICNexus nexus(vector, vector_slot); |
2393 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2399 StoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2394 ic.UpdateState(receiver, key); | 2400 ic.UpdateState(receiver, key); |
2395 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2401 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2396 } else { | 2402 } else { |
2397 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, | 2403 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_STORE_IC, |
2398 vector->GetKind(vector_slot)); | 2404 vector->GetKind(vector_slot)); |
2399 KeyedStoreICNexus nexus(vector, vector_slot); | 2405 KeyedStoreICNexus nexus(vector, vector_slot); |
2400 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2406 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2401 ic.UpdateState(receiver, key); | 2407 ic.UpdateState(receiver, key); |
2402 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2408 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2403 } | 2409 } |
2404 } | 2410 } |
2405 | 2411 |
2406 RUNTIME_FUNCTION(Runtime_TransitionStoreIC_MissFromStubFailure) { | 2412 RUNTIME_FUNCTION(Runtime_TransitionStoreIC_MissFromStubFailure) { |
2407 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2413 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2414 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2408 HandleScope scope(isolate); | 2415 HandleScope scope(isolate); |
2409 Handle<Object> receiver = args.at<Object>(0); | 2416 Handle<Object> receiver = args.at<Object>(0); |
2410 Handle<Name> key = args.at<Name>(1); | 2417 Handle<Name> key = args.at<Name>(1); |
2411 Handle<Object> value = args.at<Object>(2); | 2418 Handle<Object> value = args.at<Object>(2); |
2412 | 2419 |
2413 int length = args.length(); | 2420 int length = args.length(); |
2414 DCHECK(length == 5 || length == 6); | 2421 DCHECK(length == 5 || length == 6); |
2415 // TODO(ishell): use VectorStoreTransitionDescriptor indices here and update | 2422 // TODO(ishell): use VectorStoreTransitionDescriptor indices here and update |
2416 // this comment: | 2423 // this comment: |
2417 // | 2424 // |
(...skipping 25 matching lines...) Expand all Loading... |
2443 KeyedStoreICNexus nexus(vector, vector_slot); | 2450 KeyedStoreICNexus nexus(vector, vector_slot); |
2444 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2451 KeyedStoreIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2445 ic.UpdateState(receiver, key); | 2452 ic.UpdateState(receiver, key); |
2446 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2453 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2447 } | 2454 } |
2448 } | 2455 } |
2449 | 2456 |
2450 // Used from ic-<arch>.cc. | 2457 // Used from ic-<arch>.cc. |
2451 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { | 2458 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { |
2452 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2459 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2460 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2453 HandleScope scope(isolate); | 2461 HandleScope scope(isolate); |
2454 DCHECK_EQ(5, args.length()); | 2462 DCHECK_EQ(5, args.length()); |
2455 Handle<Object> receiver = args.at<Object>(0); | 2463 Handle<Object> receiver = args.at<Object>(0); |
2456 Handle<Object> key = args.at<Object>(1); | 2464 Handle<Object> key = args.at<Object>(1); |
2457 Handle<Object> value = args.at<Object>(2); | 2465 Handle<Object> value = args.at<Object>(2); |
2458 Handle<Smi> slot = args.at<Smi>(3); | 2466 Handle<Smi> slot = args.at<Smi>(3); |
2459 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2467 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2460 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2468 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2461 KeyedStoreICNexus nexus(vector, vector_slot); | 2469 KeyedStoreICNexus nexus(vector, vector_slot); |
2462 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2470 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2463 ic.UpdateState(receiver, key); | 2471 ic.UpdateState(receiver, key); |
2464 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); | 2472 RETURN_RESULT_OR_FAILURE(isolate, ic.Store(receiver, key, value)); |
2465 } | 2473 } |
2466 | 2474 |
2467 | 2475 |
2468 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { | 2476 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { |
2469 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2477 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2478 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2470 HandleScope scope(isolate); | 2479 HandleScope scope(isolate); |
2471 DCHECK_EQ(5, args.length()); | 2480 DCHECK_EQ(5, args.length()); |
2472 typedef StoreWithVectorDescriptor Descriptor; | 2481 typedef StoreWithVectorDescriptor Descriptor; |
2473 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2482 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
2474 Handle<Object> key = args.at<Object>(Descriptor::kName); | 2483 Handle<Object> key = args.at<Object>(Descriptor::kName); |
2475 Handle<Object> value = args.at<Object>(Descriptor::kValue); | 2484 Handle<Object> value = args.at<Object>(Descriptor::kValue); |
2476 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2485 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
2477 Handle<TypeFeedbackVector> vector = | 2486 Handle<TypeFeedbackVector> vector = |
2478 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2487 args.at<TypeFeedbackVector>(Descriptor::kVector); |
2479 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2488 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
(...skipping 15 matching lines...) Expand all Loading... |
2495 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2504 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2496 language_mode = ic.language_mode(); | 2505 language_mode = ic.language_mode(); |
2497 RETURN_RESULT_OR_FAILURE( | 2506 RETURN_RESULT_OR_FAILURE( |
2498 isolate, | 2507 isolate, |
2499 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2508 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
2500 } | 2509 } |
2501 | 2510 |
2502 | 2511 |
2503 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { | 2512 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { |
2504 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2513 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2514 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2505 HandleScope scope(isolate); | 2515 HandleScope scope(isolate); |
2506 // Length == 5 or 6, depending on whether the vector slot | 2516 // Length == 5 or 6, depending on whether the vector slot |
2507 // is passed in a virtual register or not. | 2517 // is passed in a virtual register or not. |
2508 DCHECK(args.length() == 5 || args.length() == 6); | 2518 DCHECK(args.length() == 5 || args.length() == 6); |
2509 Handle<Object> object = args.at<Object>(0); | 2519 Handle<Object> object = args.at<Object>(0); |
2510 Handle<Object> key = args.at<Object>(1); | 2520 Handle<Object> key = args.at<Object>(1); |
2511 Handle<Object> value = args.at<Object>(2); | 2521 Handle<Object> value = args.at<Object>(2); |
2512 Handle<Map> map = args.at<Map>(3); | 2522 Handle<Map> map = args.at<Map>(3); |
2513 LanguageMode language_mode; | 2523 LanguageMode language_mode; |
2514 KeyedStoreICNexus nexus(isolate); | 2524 KeyedStoreICNexus nexus(isolate); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { | 2646 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { |
2637 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); | 2647 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); |
2638 } | 2648 } |
2639 | 2649 |
2640 return result; | 2650 return result; |
2641 } | 2651 } |
2642 | 2652 |
2643 | 2653 |
2644 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { | 2654 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { |
2645 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2655 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2656 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2646 HandleScope scope(isolate); | 2657 HandleScope scope(isolate); |
2647 DCHECK_EQ(2, args.length()); | 2658 DCHECK_EQ(2, args.length()); |
2648 typedef BinaryOpDescriptor Descriptor; | 2659 typedef BinaryOpDescriptor Descriptor; |
2649 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2660 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
2650 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2661 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
2651 BinaryOpIC ic(isolate); | 2662 BinaryOpIC ic(isolate); |
2652 RETURN_RESULT_OR_FAILURE( | 2663 RETURN_RESULT_OR_FAILURE( |
2653 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2664 isolate, ic.Transition(Handle<AllocationSite>::null(), left, right)); |
2654 } | 2665 } |
2655 | 2666 |
2656 | 2667 |
2657 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { | 2668 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { |
2658 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2669 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2670 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2659 HandleScope scope(isolate); | 2671 HandleScope scope(isolate); |
2660 DCHECK_EQ(3, args.length()); | 2672 DCHECK_EQ(3, args.length()); |
2661 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; | 2673 typedef BinaryOpWithAllocationSiteDescriptor Descriptor; |
2662 Handle<AllocationSite> allocation_site = | 2674 Handle<AllocationSite> allocation_site = |
2663 args.at<AllocationSite>(Descriptor::kAllocationSite); | 2675 args.at<AllocationSite>(Descriptor::kAllocationSite); |
2664 Handle<Object> left = args.at<Object>(Descriptor::kLeft); | 2676 Handle<Object> left = args.at<Object>(Descriptor::kLeft); |
2665 Handle<Object> right = args.at<Object>(Descriptor::kRight); | 2677 Handle<Object> right = args.at<Object>(Descriptor::kRight); |
2666 BinaryOpIC ic(isolate); | 2678 BinaryOpIC ic(isolate); |
2667 RETURN_RESULT_OR_FAILURE(isolate, | 2679 RETURN_RESULT_OR_FAILURE(isolate, |
2668 ic.Transition(allocation_site, left, right)); | 2680 ic.Transition(allocation_site, left, right)); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); | 2725 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); |
2714 } | 2726 } |
2715 | 2727 |
2716 return *new_target; | 2728 return *new_target; |
2717 } | 2729 } |
2718 | 2730 |
2719 | 2731 |
2720 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. | 2732 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. |
2721 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { | 2733 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { |
2722 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2734 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2735 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2723 HandleScope scope(isolate); | 2736 HandleScope scope(isolate); |
2724 DCHECK(args.length() == 3); | 2737 DCHECK(args.length() == 3); |
2725 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 2738 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
2726 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 2739 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); |
2727 } | 2740 } |
2728 | 2741 |
2729 | 2742 |
2730 RUNTIME_FUNCTION(Runtime_Unreachable) { | 2743 RUNTIME_FUNCTION(Runtime_Unreachable) { |
2731 UNREACHABLE(); | 2744 UNREACHABLE(); |
2732 CHECK(false); | 2745 CHECK(false); |
2733 return isolate->heap()->undefined_value(); | 2746 return isolate->heap()->undefined_value(); |
2734 } | 2747 } |
2735 | 2748 |
2736 | 2749 |
2737 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 2750 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
2738 ToBooleanICStub stub(isolate(), extra_ic_state()); | 2751 ToBooleanICStub stub(isolate(), extra_ic_state()); |
2739 bool to_boolean_value = stub.UpdateStatus(object); | 2752 bool to_boolean_value = stub.UpdateStatus(object); |
2740 Handle<Code> code = stub.GetCode(); | 2753 Handle<Code> code = stub.GetCode(); |
2741 set_target(*code); | 2754 set_target(*code); |
2742 return isolate()->factory()->ToBoolean(to_boolean_value); | 2755 return isolate()->factory()->ToBoolean(to_boolean_value); |
2743 } | 2756 } |
2744 | 2757 |
2745 | 2758 |
2746 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { | 2759 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { |
2747 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2760 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2761 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2748 DCHECK(args.length() == 1); | 2762 DCHECK(args.length() == 1); |
2749 HandleScope scope(isolate); | 2763 HandleScope scope(isolate); |
2750 Handle<Object> object = args.at<Object>(0); | 2764 Handle<Object> object = args.at<Object>(0); |
2751 ToBooleanIC ic(isolate); | 2765 ToBooleanIC ic(isolate); |
2752 return *ic.ToBoolean(object); | 2766 return *ic.ToBoolean(object); |
2753 } | 2767 } |
2754 | 2768 |
2755 | 2769 |
2756 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { | 2770 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { |
2757 Handle<JSObject> receiver = args.at<JSObject>(0); | 2771 Handle<JSObject> receiver = args.at<JSObject>(0); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2948 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2962 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
2949 Object::GetProperty(&it)); | 2963 Object::GetProperty(&it)); |
2950 } | 2964 } |
2951 | 2965 |
2952 return *result; | 2966 return *result; |
2953 } | 2967 } |
2954 | 2968 |
2955 | 2969 |
2956 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { | 2970 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { |
2957 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2971 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2972 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2958 HandleScope scope(isolate); | 2973 HandleScope scope(isolate); |
2959 DCHECK_EQ(4, args.length()); | 2974 DCHECK_EQ(4, args.length()); |
2960 typedef LoadWithVectorDescriptor Descriptor; | 2975 typedef LoadWithVectorDescriptor Descriptor; |
2961 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); | 2976 Handle<Object> receiver = args.at<Object>(Descriptor::kReceiver); |
2962 Handle<Name> key = args.at<Name>(Descriptor::kName); | 2977 Handle<Name> key = args.at<Name>(Descriptor::kName); |
2963 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); | 2978 Handle<Smi> slot = args.at<Smi>(Descriptor::kSlot); |
2964 Handle<TypeFeedbackVector> vector = | 2979 Handle<TypeFeedbackVector> vector = |
2965 args.at<TypeFeedbackVector>(Descriptor::kVector); | 2980 args.at<TypeFeedbackVector>(Descriptor::kVector); |
2966 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2981 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2967 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2982 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
2968 // LoadIC miss handler if the handler misses. Since the vector Nexus is | 2983 // LoadIC miss handler if the handler misses. Since the vector Nexus is |
2969 // set up outside the IC, handle that here. | 2984 // set up outside the IC, handle that here. |
2970 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { | 2985 if (vector->GetKind(vector_slot) == FeedbackVectorSlotKind::LOAD_IC) { |
2971 LoadICNexus nexus(vector, vector_slot); | 2986 LoadICNexus nexus(vector, vector_slot); |
2972 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2987 LoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2973 ic.UpdateState(receiver, key); | 2988 ic.UpdateState(receiver, key); |
2974 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2989 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2975 } else { | 2990 } else { |
2976 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, | 2991 DCHECK_EQ(FeedbackVectorSlotKind::KEYED_LOAD_IC, |
2977 vector->GetKind(vector_slot)); | 2992 vector->GetKind(vector_slot)); |
2978 KeyedLoadICNexus nexus(vector, vector_slot); | 2993 KeyedLoadICNexus nexus(vector, vector_slot); |
2979 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2994 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2980 ic.UpdateState(receiver, key); | 2995 ic.UpdateState(receiver, key); |
2981 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); | 2996 RETURN_RESULT_OR_FAILURE(isolate, ic.Load(receiver, key)); |
2982 } | 2997 } |
2983 } | 2998 } |
2984 } // namespace internal | 2999 } // namespace internal |
2985 } // namespace v8 | 3000 } // namespace v8 |
OLD | NEW |