OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <ostream> | 5 #include <ostream> |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
9 #include "src/compiler/access-info.h" | 9 #include "src/compiler/access-info.h" |
10 #include "src/field-index-inl.h" | 10 #include "src/field-index-inl.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 type_cache_(TypeCache::Get()), | 134 type_cache_(TypeCache::Get()), |
135 zone_(zone) {} | 135 zone_(zone) {} |
136 | 136 |
137 | 137 |
138 bool AccessInfoFactory::ComputeElementAccessInfo( | 138 bool AccessInfoFactory::ComputeElementAccessInfo( |
139 Handle<Map> map, AccessMode access_mode, ElementAccessInfo* access_info) { | 139 Handle<Map> map, AccessMode access_mode, ElementAccessInfo* access_info) { |
140 // Check if it is safe to inline element access for the {map}. | 140 // Check if it is safe to inline element access for the {map}. |
141 if (!CanInlineElementAccess(map)) return false; | 141 if (!CanInlineElementAccess(map)) return false; |
142 | 142 |
143 ElementsKind const elements_kind = map->elements_kind(); | 143 ElementsKind const elements_kind = map->elements_kind(); |
144 if (access_mode == AccessMode::kLoad && | |
145 elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) { | |
146 // TODO(bmeurer): Add support for holey loads. | |
147 return false; | |
148 } | |
149 | 144 |
150 // Certain (monomorphic) stores need a prototype chain check because shape | 145 // Certain (monomorphic) stores need a prototype chain check because shape |
151 // changes could allow callbacks on elements in the chain that are not | 146 // changes could allow callbacks on elements in the chain that are not |
152 // compatible with monomorphic keyed stores. | 147 // compatible with monomorphic keyed stores. |
153 MaybeHandle<JSObject> holder; | 148 MaybeHandle<JSObject> holder; |
154 if (access_mode == AccessMode::kStore && map->prototype()->IsJSObject()) { | 149 if (access_mode == AccessMode::kStore && map->prototype()->IsJSObject()) { |
155 for (PrototypeIterator i(map); !i.IsAtEnd(); i.Advance()) { | 150 for (PrototypeIterator i(map); !i.IsAtEnd(); i.Advance()) { |
156 Handle<JSReceiver> prototype = | 151 Handle<JSReceiver> prototype = |
157 PrototypeIterator::GetCurrent<JSReceiver>(i); | 152 PrototypeIterator::GetCurrent<JSReceiver>(i); |
158 if (!prototype->IsJSObject()) return false; | 153 if (!prototype->IsJSObject()) return false; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 447 } |
453 return false; | 448 return false; |
454 } | 449 } |
455 | 450 |
456 | 451 |
457 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } | 452 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } |
458 | 453 |
459 } // namespace compiler | 454 } // namespace compiler |
460 } // namespace internal | 455 } // namespace internal |
461 } // namespace v8 | 456 } // namespace v8 |
OLD | NEW |