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.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
11 #include "src/codegen.h" | 11 #include "src/codegen.h" |
12 #include "src/conversions.h" | 12 #include "src/conversions.h" |
13 #include "src/execution.h" | 13 #include "src/execution.h" |
14 #include "src/field-type.h" | 14 #include "src/field-type.h" |
15 #include "src/frames-inl.h" | 15 #include "src/frames-inl.h" |
16 #include "src/ic/call-optimization.h" | 16 #include "src/ic/call-optimization.h" |
17 #include "src/ic/handler-compiler.h" | 17 #include "src/ic/handler-compiler.h" |
18 #include "src/ic/ic-inl.h" | 18 #include "src/ic/ic-inl.h" |
19 #include "src/ic/ic-compiler.h" | 19 #include "src/ic/ic-compiler.h" |
20 #include "src/ic/stub-cache.h" | 20 #include "src/ic/stub-cache.h" |
21 #include "src/isolate-inl.h" | 21 #include "src/isolate-inl.h" |
22 #include "src/macro-assembler.h" | 22 #include "src/macro-assembler.h" |
23 #include "src/prototype.h" | 23 #include "src/prototype.h" |
24 #include "src/runtime/runtime.h" | 24 #include "src/runtime/runtime.h" |
25 #include "src/runtime/runtime-utils.h" | 25 #include "src/runtime/runtime-utils.h" |
| 26 #include "src/tracing/trace-event.h" |
26 | 27 |
27 namespace v8 { | 28 namespace v8 { |
28 namespace internal { | 29 namespace internal { |
29 | 30 |
30 char IC::TransitionMarkFromState(IC::State state) { | 31 char IC::TransitionMarkFromState(IC::State state) { |
31 switch (state) { | 32 switch (state) { |
32 case UNINITIALIZED: | 33 case UNINITIALIZED: |
33 return '0'; | 34 return '0'; |
34 case PREMONOMORPHIC: | 35 case PREMONOMORPHIC: |
35 return '.'; | 36 return '.'; |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 #undef TRACE_IC | 2213 #undef TRACE_IC |
2213 | 2214 |
2214 | 2215 |
2215 // ---------------------------------------------------------------------------- | 2216 // ---------------------------------------------------------------------------- |
2216 // Static IC stub generators. | 2217 // Static IC stub generators. |
2217 // | 2218 // |
2218 | 2219 |
2219 // Used from ic-<arch>.cc. | 2220 // Used from ic-<arch>.cc. |
2220 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { | 2221 RUNTIME_FUNCTION(Runtime_CallIC_Miss) { |
2221 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2222 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2223 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2222 HandleScope scope(isolate); | 2224 HandleScope scope(isolate); |
2223 DCHECK(args.length() == 3); | 2225 DCHECK(args.length() == 3); |
2224 Handle<Object> function = args.at<Object>(0); | 2226 Handle<Object> function = args.at<Object>(0); |
2225 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); | 2227 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(1); |
2226 Handle<Smi> slot = args.at<Smi>(2); | 2228 Handle<Smi> slot = args.at<Smi>(2); |
2227 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2229 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2228 CallICNexus nexus(vector, vector_slot); | 2230 CallICNexus nexus(vector, vector_slot); |
2229 CallIC ic(isolate, &nexus); | 2231 CallIC ic(isolate, &nexus); |
2230 ic.HandleMiss(function); | 2232 ic.HandleMiss(function); |
2231 return *function; | 2233 return *function; |
2232 } | 2234 } |
2233 | 2235 |
2234 | 2236 |
2235 // Used from ic-<arch>.cc. | 2237 // Used from ic-<arch>.cc. |
2236 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { | 2238 RUNTIME_FUNCTION(Runtime_LoadIC_Miss) { |
2237 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2239 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2240 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2238 HandleScope scope(isolate); | 2241 HandleScope scope(isolate); |
2239 Handle<Object> receiver = args.at<Object>(0); | 2242 Handle<Object> receiver = args.at<Object>(0); |
2240 Handle<Name> key = args.at<Name>(1); | 2243 Handle<Name> key = args.at<Name>(1); |
2241 Handle<Object> result; | 2244 Handle<Object> result; |
2242 | 2245 |
2243 DCHECK(args.length() == 4); | 2246 DCHECK(args.length() == 4); |
2244 Handle<Smi> slot = args.at<Smi>(2); | 2247 Handle<Smi> slot = args.at<Smi>(2); |
2245 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2248 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2246 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2249 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2247 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2250 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
(...skipping 12 matching lines...) Expand all Loading... |
2260 ic.UpdateState(receiver, key); | 2263 ic.UpdateState(receiver, key); |
2261 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2264 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2262 } | 2265 } |
2263 return *result; | 2266 return *result; |
2264 } | 2267 } |
2265 | 2268 |
2266 | 2269 |
2267 // Used from ic-<arch>.cc | 2270 // Used from ic-<arch>.cc |
2268 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { | 2271 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_Miss) { |
2269 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2272 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2273 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2270 HandleScope scope(isolate); | 2274 HandleScope scope(isolate); |
2271 Handle<Object> receiver = args.at<Object>(0); | 2275 Handle<Object> receiver = args.at<Object>(0); |
2272 Handle<Object> key = args.at<Object>(1); | 2276 Handle<Object> key = args.at<Object>(1); |
2273 Handle<Object> result; | 2277 Handle<Object> result; |
2274 | 2278 |
2275 DCHECK(args.length() == 4); | 2279 DCHECK(args.length() == 4); |
2276 Handle<Smi> slot = args.at<Smi>(2); | 2280 Handle<Smi> slot = args.at<Smi>(2); |
2277 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2281 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2278 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2282 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2279 KeyedLoadICNexus nexus(vector, vector_slot); | 2283 KeyedLoadICNexus nexus(vector, vector_slot); |
2280 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2284 KeyedLoadIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2281 ic.UpdateState(receiver, key); | 2285 ic.UpdateState(receiver, key); |
2282 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2286 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2283 return *result; | 2287 return *result; |
2284 } | 2288 } |
2285 | 2289 |
2286 | 2290 |
2287 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { | 2291 RUNTIME_FUNCTION(Runtime_KeyedLoadIC_MissFromStubFailure) { |
2288 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2292 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2293 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2289 HandleScope scope(isolate); | 2294 HandleScope scope(isolate); |
2290 Handle<Object> receiver = args.at<Object>(0); | 2295 Handle<Object> receiver = args.at<Object>(0); |
2291 Handle<Object> key = args.at<Object>(1); | 2296 Handle<Object> key = args.at<Object>(1); |
2292 Handle<Object> result; | 2297 Handle<Object> result; |
2293 | 2298 |
2294 DCHECK(args.length() == 4); | 2299 DCHECK(args.length() == 4); |
2295 Handle<Smi> slot = args.at<Smi>(2); | 2300 Handle<Smi> slot = args.at<Smi>(2); |
2296 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2301 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2297 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2302 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2298 KeyedLoadICNexus nexus(vector, vector_slot); | 2303 KeyedLoadICNexus nexus(vector, vector_slot); |
2299 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2304 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2300 ic.UpdateState(receiver, key); | 2305 ic.UpdateState(receiver, key); |
2301 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2306 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2302 | 2307 |
2303 return *result; | 2308 return *result; |
2304 } | 2309 } |
2305 | 2310 |
2306 | 2311 |
2307 // Used from ic-<arch>.cc. | 2312 // Used from ic-<arch>.cc. |
2308 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { | 2313 RUNTIME_FUNCTION(Runtime_StoreIC_Miss) { |
2309 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2314 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2315 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2310 HandleScope scope(isolate); | 2316 HandleScope scope(isolate); |
2311 Handle<Object> receiver = args.at<Object>(0); | 2317 Handle<Object> receiver = args.at<Object>(0); |
2312 Handle<Name> key = args.at<Name>(1); | 2318 Handle<Name> key = args.at<Name>(1); |
2313 Handle<Object> value = args.at<Object>(2); | 2319 Handle<Object> value = args.at<Object>(2); |
2314 Handle<Object> result; | 2320 Handle<Object> result; |
2315 | 2321 |
2316 DCHECK(args.length() == 5 || args.length() == 6); | 2322 DCHECK(args.length() == 5 || args.length() == 6); |
2317 Handle<Smi> slot = args.at<Smi>(3); | 2323 Handle<Smi> slot = args.at<Smi>(3); |
2318 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2324 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2319 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2325 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
(...skipping 11 matching lines...) Expand all Loading... |
2331 ic.UpdateState(receiver, key); | 2337 ic.UpdateState(receiver, key); |
2332 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2338 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
2333 ic.Store(receiver, key, value)); | 2339 ic.Store(receiver, key, value)); |
2334 } | 2340 } |
2335 return *result; | 2341 return *result; |
2336 } | 2342 } |
2337 | 2343 |
2338 | 2344 |
2339 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { | 2345 RUNTIME_FUNCTION(Runtime_StoreIC_MissFromStubFailure) { |
2340 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2346 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2347 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2341 HandleScope scope(isolate); | 2348 HandleScope scope(isolate); |
2342 Handle<Object> receiver = args.at<Object>(0); | 2349 Handle<Object> receiver = args.at<Object>(0); |
2343 Handle<Name> key = args.at<Name>(1); | 2350 Handle<Name> key = args.at<Name>(1); |
2344 Handle<Object> value = args.at<Object>(2); | 2351 Handle<Object> value = args.at<Object>(2); |
2345 Handle<Object> result; | 2352 Handle<Object> result; |
2346 | 2353 |
2347 int length = args.length(); | 2354 int length = args.length(); |
2348 DCHECK(length == 5 || length == 6); | 2355 DCHECK(length == 5 || length == 6); |
2349 // We might have slot and vector, for a normal miss (slot(3), vector(4)). | 2356 // We might have slot and vector, for a normal miss (slot(3), vector(4)). |
2350 // Or, map and vector for a transitioning store miss (map(3), vector(4)). | 2357 // Or, map and vector for a transitioning store miss (map(3), vector(4)). |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2383 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2390 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
2384 ic.Store(receiver, key, value)); | 2391 ic.Store(receiver, key, value)); |
2385 } | 2392 } |
2386 return *result; | 2393 return *result; |
2387 } | 2394 } |
2388 | 2395 |
2389 | 2396 |
2390 // Used from ic-<arch>.cc. | 2397 // Used from ic-<arch>.cc. |
2391 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { | 2398 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_Miss) { |
2392 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2399 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2400 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2393 HandleScope scope(isolate); | 2401 HandleScope scope(isolate); |
2394 Handle<Object> receiver = args.at<Object>(0); | 2402 Handle<Object> receiver = args.at<Object>(0); |
2395 Handle<Object> key = args.at<Object>(1); | 2403 Handle<Object> key = args.at<Object>(1); |
2396 Handle<Object> value = args.at<Object>(2); | 2404 Handle<Object> value = args.at<Object>(2); |
2397 Handle<Object> result; | 2405 Handle<Object> result; |
2398 | 2406 |
2399 DCHECK(args.length() == 5); | 2407 DCHECK(args.length() == 5); |
2400 Handle<Smi> slot = args.at<Smi>(3); | 2408 Handle<Smi> slot = args.at<Smi>(3); |
2401 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2409 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2402 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2410 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2403 KeyedStoreICNexus nexus(vector, vector_slot); | 2411 KeyedStoreICNexus nexus(vector, vector_slot); |
2404 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); | 2412 KeyedStoreIC ic(IC::NO_EXTRA_FRAME, isolate, &nexus); |
2405 ic.UpdateState(receiver, key); | 2413 ic.UpdateState(receiver, key); |
2406 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, | 2414 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
2407 ic.Store(receiver, key, value)); | 2415 ic.Store(receiver, key, value)); |
2408 return *result; | 2416 return *result; |
2409 } | 2417 } |
2410 | 2418 |
2411 | 2419 |
2412 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { | 2420 RUNTIME_FUNCTION(Runtime_KeyedStoreIC_MissFromStubFailure) { |
2413 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2421 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2422 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2414 HandleScope scope(isolate); | 2423 HandleScope scope(isolate); |
2415 Handle<Object> receiver = args.at<Object>(0); | 2424 Handle<Object> receiver = args.at<Object>(0); |
2416 Handle<Object> key = args.at<Object>(1); | 2425 Handle<Object> key = args.at<Object>(1); |
2417 Handle<Object> value = args.at<Object>(2); | 2426 Handle<Object> value = args.at<Object>(2); |
2418 Handle<Object> result; | 2427 Handle<Object> result; |
2419 | 2428 |
2420 DCHECK(args.length() == 5); | 2429 DCHECK(args.length() == 5); |
2421 Handle<Smi> slot = args.at<Smi>(3); | 2430 Handle<Smi> slot = args.at<Smi>(3); |
2422 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); | 2431 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(4); |
2423 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2432 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2461 Handle<Object> result; | 2470 Handle<Object> result; |
2462 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2471 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2463 isolate, result, | 2472 isolate, result, |
2464 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); | 2473 Runtime::SetObjectProperty(isolate, object, key, value, language_mode)); |
2465 return *result; | 2474 return *result; |
2466 } | 2475 } |
2467 | 2476 |
2468 | 2477 |
2469 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { | 2478 RUNTIME_FUNCTION(Runtime_ElementsTransitionAndStoreIC_Miss) { |
2470 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2479 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2480 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2471 HandleScope scope(isolate); | 2481 HandleScope scope(isolate); |
2472 // Length == 5 or 6, depending on whether the vector slot | 2482 // Length == 5 or 6, depending on whether the vector slot |
2473 // is passed in a virtual register or not. | 2483 // is passed in a virtual register or not. |
2474 DCHECK(args.length() == 5 || args.length() == 6); | 2484 DCHECK(args.length() == 5 || args.length() == 6); |
2475 Handle<Object> object = args.at<Object>(0); | 2485 Handle<Object> object = args.at<Object>(0); |
2476 Handle<Object> key = args.at<Object>(1); | 2486 Handle<Object> key = args.at<Object>(1); |
2477 Handle<Object> value = args.at<Object>(2); | 2487 Handle<Object> value = args.at<Object>(2); |
2478 Handle<Map> map = args.at<Map>(3); | 2488 Handle<Map> map = args.at<Map>(3); |
2479 LanguageMode language_mode; | 2489 LanguageMode language_mode; |
2480 KeyedStoreICNexus nexus(isolate); | 2490 KeyedStoreICNexus nexus(isolate); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2608 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { | 2618 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { |
2609 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); | 2619 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); |
2610 } | 2620 } |
2611 | 2621 |
2612 return result; | 2622 return result; |
2613 } | 2623 } |
2614 | 2624 |
2615 | 2625 |
2616 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { | 2626 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { |
2617 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2627 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2628 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2618 HandleScope scope(isolate); | 2629 HandleScope scope(isolate); |
2619 DCHECK_EQ(2, args.length()); | 2630 DCHECK_EQ(2, args.length()); |
2620 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); | 2631 Handle<Object> left = args.at<Object>(BinaryOpICStub::kLeft); |
2621 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); | 2632 Handle<Object> right = args.at<Object>(BinaryOpICStub::kRight); |
2622 BinaryOpIC ic(isolate); | 2633 BinaryOpIC ic(isolate); |
2623 Handle<Object> result; | 2634 Handle<Object> result; |
2624 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2635 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2625 isolate, result, | 2636 isolate, result, |
2626 ic.Transition(Handle<AllocationSite>::null(), left, right)); | 2637 ic.Transition(Handle<AllocationSite>::null(), left, right)); |
2627 return *result; | 2638 return *result; |
2628 } | 2639 } |
2629 | 2640 |
2630 | 2641 |
2631 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { | 2642 RUNTIME_FUNCTION(Runtime_BinaryOpIC_MissWithAllocationSite) { |
2632 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2643 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2644 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2633 HandleScope scope(isolate); | 2645 HandleScope scope(isolate); |
2634 DCHECK_EQ(3, args.length()); | 2646 DCHECK_EQ(3, args.length()); |
2635 Handle<AllocationSite> allocation_site = | 2647 Handle<AllocationSite> allocation_site = |
2636 args.at<AllocationSite>(BinaryOpWithAllocationSiteStub::kAllocationSite); | 2648 args.at<AllocationSite>(BinaryOpWithAllocationSiteStub::kAllocationSite); |
2637 Handle<Object> left = args.at<Object>(BinaryOpWithAllocationSiteStub::kLeft); | 2649 Handle<Object> left = args.at<Object>(BinaryOpWithAllocationSiteStub::kLeft); |
2638 Handle<Object> right = | 2650 Handle<Object> right = |
2639 args.at<Object>(BinaryOpWithAllocationSiteStub::kRight); | 2651 args.at<Object>(BinaryOpWithAllocationSiteStub::kRight); |
2640 BinaryOpIC ic(isolate); | 2652 BinaryOpIC ic(isolate); |
2641 Handle<Object> result; | 2653 Handle<Object> result; |
2642 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2654 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2697 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); | 2709 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); |
2698 } | 2710 } |
2699 | 2711 |
2700 return *new_target; | 2712 return *new_target; |
2701 } | 2713 } |
2702 | 2714 |
2703 | 2715 |
2704 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. | 2716 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. |
2705 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { | 2717 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { |
2706 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2718 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2719 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2707 HandleScope scope(isolate); | 2720 HandleScope scope(isolate); |
2708 DCHECK(args.length() == 3); | 2721 DCHECK(args.length() == 3); |
2709 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); | 2722 CompareIC ic(isolate, static_cast<Token::Value>(args.smi_at(2))); |
2710 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); | 2723 return ic.UpdateCaches(args.at<Object>(0), args.at<Object>(1)); |
2711 } | 2724 } |
2712 | 2725 |
2713 | 2726 |
2714 void CompareNilIC::Clear(Address address, Code* target, Address constant_pool) { | 2727 void CompareNilIC::Clear(Address address, Code* target, Address constant_pool) { |
2715 if (IsCleared(target)) return; | 2728 if (IsCleared(target)) return; |
2716 ExtraICState state = target->extra_ic_state(); | 2729 ExtraICState state = target->extra_ic_state(); |
(...skipping 30 matching lines...) Expand all Loading... |
2747 } else { | 2760 } else { |
2748 code = stub.GetCode(); | 2761 code = stub.GetCode(); |
2749 } | 2762 } |
2750 set_target(*code); | 2763 set_target(*code); |
2751 return isolate()->factory()->ToBoolean(object->IsUndetectableObject()); | 2764 return isolate()->factory()->ToBoolean(object->IsUndetectableObject()); |
2752 } | 2765 } |
2753 | 2766 |
2754 | 2767 |
2755 RUNTIME_FUNCTION(Runtime_CompareNilIC_Miss) { | 2768 RUNTIME_FUNCTION(Runtime_CompareNilIC_Miss) { |
2756 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2769 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2770 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2757 HandleScope scope(isolate); | 2771 HandleScope scope(isolate); |
2758 Handle<Object> object = args.at<Object>(0); | 2772 Handle<Object> object = args.at<Object>(0); |
2759 CompareNilIC ic(isolate); | 2773 CompareNilIC ic(isolate); |
2760 return *ic.CompareNil(object); | 2774 return *ic.CompareNil(object); |
2761 } | 2775 } |
2762 | 2776 |
2763 | 2777 |
2764 RUNTIME_FUNCTION(Runtime_Unreachable) { | 2778 RUNTIME_FUNCTION(Runtime_Unreachable) { |
2765 UNREACHABLE(); | 2779 UNREACHABLE(); |
2766 CHECK(false); | 2780 CHECK(false); |
2767 return isolate->heap()->undefined_value(); | 2781 return isolate->heap()->undefined_value(); |
2768 } | 2782 } |
2769 | 2783 |
2770 | 2784 |
2771 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { | 2785 Handle<Object> ToBooleanIC::ToBoolean(Handle<Object> object) { |
2772 ToBooleanStub stub(isolate(), target()->extra_ic_state()); | 2786 ToBooleanStub stub(isolate(), target()->extra_ic_state()); |
2773 bool to_boolean_value = stub.UpdateStatus(object); | 2787 bool to_boolean_value = stub.UpdateStatus(object); |
2774 Handle<Code> code = stub.GetCode(); | 2788 Handle<Code> code = stub.GetCode(); |
2775 set_target(*code); | 2789 set_target(*code); |
2776 return isolate()->factory()->ToBoolean(to_boolean_value); | 2790 return isolate()->factory()->ToBoolean(to_boolean_value); |
2777 } | 2791 } |
2778 | 2792 |
2779 | 2793 |
2780 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { | 2794 RUNTIME_FUNCTION(Runtime_ToBooleanIC_Miss) { |
2781 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2795 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2796 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2782 DCHECK(args.length() == 1); | 2797 DCHECK(args.length() == 1); |
2783 HandleScope scope(isolate); | 2798 HandleScope scope(isolate); |
2784 Handle<Object> object = args.at<Object>(0); | 2799 Handle<Object> object = args.at<Object>(0); |
2785 ToBooleanIC ic(isolate); | 2800 ToBooleanIC ic(isolate); |
2786 return *ic.ToBoolean(object); | 2801 return *ic.ToBoolean(object); |
2787 } | 2802 } |
2788 | 2803 |
2789 | 2804 |
2790 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { | 2805 RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) { |
2791 Handle<JSObject> receiver = args.at<JSObject>(0); | 2806 Handle<JSObject> receiver = args.at<JSObject>(0); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2923 LanguageMode language_mode = SLOPPY; | 2938 LanguageMode language_mode = SLOPPY; |
2924 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | 2939 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
2925 isolate, result, | 2940 isolate, result, |
2926 Object::GetElement(isolate, receiver, index, language_mode)); | 2941 Object::GetElement(isolate, receiver, index, language_mode)); |
2927 return *result; | 2942 return *result; |
2928 } | 2943 } |
2929 | 2944 |
2930 | 2945 |
2931 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { | 2946 RUNTIME_FUNCTION(Runtime_LoadIC_MissFromStubFailure) { |
2932 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2947 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2948 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.IcMiss"); |
2933 HandleScope scope(isolate); | 2949 HandleScope scope(isolate); |
2934 Handle<Object> receiver = args.at<Object>(0); | 2950 Handle<Object> receiver = args.at<Object>(0); |
2935 Handle<Name> key = args.at<Name>(1); | 2951 Handle<Name> key = args.at<Name>(1); |
2936 Handle<Object> result; | 2952 Handle<Object> result; |
2937 | 2953 |
2938 DCHECK(args.length() == 4); | 2954 DCHECK(args.length() == 4); |
2939 Handle<Smi> slot = args.at<Smi>(2); | 2955 Handle<Smi> slot = args.at<Smi>(2); |
2940 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); | 2956 Handle<TypeFeedbackVector> vector = args.at<TypeFeedbackVector>(3); |
2941 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); | 2957 FeedbackVectorSlot vector_slot = vector->ToSlot(slot->value()); |
2942 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the | 2958 // A monomorphic or polymorphic KeyedLoadIC with a string key can call the |
(...skipping 10 matching lines...) Expand all Loading... |
2953 KeyedLoadICNexus nexus(vector, vector_slot); | 2969 KeyedLoadICNexus nexus(vector, vector_slot); |
2954 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2970 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
2955 ic.UpdateState(receiver, key); | 2971 ic.UpdateState(receiver, key); |
2956 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2972 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
2957 } | 2973 } |
2958 | 2974 |
2959 return *result; | 2975 return *result; |
2960 } | 2976 } |
2961 } // namespace internal | 2977 } // namespace internal |
2962 } // namespace v8 | 2978 } // namespace v8 |
OLD | NEW |