| 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 #include "src/profiler/cpu-profiler.h" | 9 #include "src/profiler/cpu-profiler.h" |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 receiver_maps, transitioned_maps, handlers, store_mode); | 76 receiver_maps, transitioned_maps, handlers, store_mode); |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 void PropertyICCompiler::CompileKeyedStorePolymorphicHandlers( | 80 void PropertyICCompiler::CompileKeyedStorePolymorphicHandlers( |
| 81 MapHandleList* receiver_maps, MapHandleList* transitioned_maps, | 81 MapHandleList* receiver_maps, MapHandleList* transitioned_maps, |
| 82 CodeHandleList* handlers, KeyedAccessStoreMode store_mode) { | 82 CodeHandleList* handlers, KeyedAccessStoreMode store_mode) { |
| 83 for (int i = 0; i < receiver_maps->length(); ++i) { | 83 for (int i = 0; i < receiver_maps->length(); ++i) { |
| 84 Handle<Map> receiver_map(receiver_maps->at(i)); | 84 Handle<Map> receiver_map(receiver_maps->at(i)); |
| 85 Handle<Code> cached_stub; | 85 Handle<Code> cached_stub; |
| 86 Handle<Map> transitioned_map = | 86 Handle<Map> transitioned_map; |
| 87 Map::FindTransitionedMap(receiver_map, receiver_maps); | 87 { |
| 88 Map* tmap = receiver_map->FindElementsKindTransitionedMap(receiver_maps); |
| 89 if (tmap != nullptr) transitioned_map = handle(tmap); |
| 90 } |
| 88 | 91 |
| 89 // TODO(mvstanton): The code below is doing pessimistic elements | 92 // TODO(mvstanton): The code below is doing pessimistic elements |
| 90 // transitions. I would like to stop doing that and rely on Allocation Site | 93 // transitions. I would like to stop doing that and rely on Allocation Site |
| 91 // Tracking to do a better job of ensuring the data types are what they need | 94 // Tracking to do a better job of ensuring the data types are what they need |
| 92 // to be. Not all the elements are in place yet, pessimistic elements | 95 // to be. Not all the elements are in place yet, pessimistic elements |
| 93 // transitions are still important for performance. | 96 // transitions are still important for performance. |
| 94 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; | 97 bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
| 95 ElementsKind elements_kind = receiver_map->elements_kind(); | 98 ElementsKind elements_kind = receiver_map->elements_kind(); |
| 96 if (!transitioned_map.is_null()) { | 99 if (!transitioned_map.is_null()) { |
| 97 cached_stub = | 100 cached_stub = |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_StoreElementStub); | 145 TRACE_HANDLER_STATS(isolate(), KeyedStoreIC_StoreElementStub); |
| 143 stub = StoreElementStub(isolate(), elements_kind, store_mode).GetCode(); | 146 stub = StoreElementStub(isolate(), elements_kind, store_mode).GetCode(); |
| 144 } | 147 } |
| 145 return stub; | 148 return stub; |
| 146 } | 149 } |
| 147 | 150 |
| 148 | 151 |
| 149 #undef __ | 152 #undef __ |
| 150 } // namespace internal | 153 } // namespace internal |
| 151 } // namespace v8 | 154 } // namespace v8 |
| OLD | NEW |