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