OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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-compiler.h" | 5 #include "src/ic/ic-compiler.h" |
6 | 6 |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 #include "src/ic/ic-inl.h" | 8 #include "src/ic/ic-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 { | 49 { |
50 Map* tmap = receiver_map->FindElementsKindTransitionedMap(receiver_maps); | 50 Map* tmap = receiver_map->FindElementsKindTransitionedMap(receiver_maps); |
51 if (tmap != nullptr) transitioned_map = handle(tmap); | 51 if (tmap != nullptr) transitioned_map = handle(tmap); |
52 } | 52 } |
53 | 53 |
54 // TODO(mvstanton): The code below is doing pessimistic elements | 54 // TODO(mvstanton): The code below is doing pessimistic elements |
55 // transitions. I would like to stop doing that and rely on Allocation Site | 55 // transitions. I would like to stop doing that and rely on Allocation Site |
56 // Tracking to do a better job of ensuring the data types are what they need | 56 // Tracking to do a better job of ensuring the data types are what they need |
57 // to be. Not all the elements are in place yet, pessimistic elements | 57 // to be. Not all the elements are in place yet, pessimistic elements |
58 // transitions are still important for performance. | 58 // transitions are still important for performance. |
59 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | |
60 ElementsKind elements_kind = receiver_map->elements_kind(); | |
61 if (!transitioned_map.is_null()) { | 59 if (!transitioned_map.is_null()) { |
| 60 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 61 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 62 TRACE_HANDLER_STATS(isolate(), |
| 63 KeyedStoreIC_ElementsTransitionAndStoreStub); |
62 cached_stub = | 64 cached_stub = |
63 ElementsTransitionAndStoreStub(isolate(), elements_kind, | 65 ElementsTransitionAndStoreStub(isolate(), elements_kind, |
64 transitioned_map->elements_kind(), | 66 transitioned_map->elements_kind(), |
65 is_js_array, store_mode).GetCode(); | 67 is_js_array, store_mode).GetCode(); |
66 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { | 68 } else if (receiver_map->instance_type() < FIRST_JS_RECEIVER_TYPE) { |
67 // TODO(mvstanton): Consider embedding store_mode in the state of the slow | 69 // TODO(mvstanton): Consider embedding store_mode in the state of the slow |
68 // keyed store ic for uniformity. | 70 // keyed store ic for uniformity. |
| 71 TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_SlowStub); |
69 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); | 72 cached_stub = isolate()->builtins()->KeyedStoreIC_Slow(); |
70 } else { | 73 } else { |
71 if (IsSloppyArgumentsElements(elements_kind)) { | 74 cached_stub = |
72 cached_stub = | 75 CompileKeyedStoreMonomorphicHandler(receiver_map, store_mode); |
73 KeyedStoreSloppyArgumentsStub(isolate(), store_mode).GetCode(); | |
74 } else if (receiver_map->has_fast_elements() || | |
75 receiver_map->has_fixed_typed_array_elements()) { | |
76 cached_stub = StoreFastElementStub(isolate(), is_js_array, | |
77 elements_kind, store_mode).GetCode(); | |
78 } else { | |
79 cached_stub = | |
80 StoreElementStub(isolate(), elements_kind, store_mode).GetCode(); | |
81 } | |
82 } | 76 } |
83 DCHECK(!cached_stub.is_null()); | 77 DCHECK(!cached_stub.is_null()); |
84 handlers->Add(cached_stub); | 78 handlers->Add(cached_stub); |
85 transitioned_maps->Add(transitioned_map); | 79 transitioned_maps->Add(transitioned_map); |
86 } | 80 } |
87 } | 81 } |
88 | 82 |
89 | 83 |
90 #define __ ACCESS_MASM(masm()) | 84 #define __ ACCESS_MASM(masm()) |
91 | 85 |
(...skipping 15 matching lines...) Expand all Loading... |
107 TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_StoreElementStub); | 101 TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_StoreElementStub); |
108 stub = StoreElementStub(isolate(), elements_kind, store_mode).GetCode(); | 102 stub = StoreElementStub(isolate(), elements_kind, store_mode).GetCode(); |
109 } | 103 } |
110 return stub; | 104 return stub; |
111 } | 105 } |
112 | 106 |
113 | 107 |
114 #undef __ | 108 #undef __ |
115 } // namespace internal | 109 } // namespace internal |
116 } // namespace v8 | 110 } // namespace v8 |
OLD | NEW |