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/compiler/js-builtin-reducer.h" | 5 #include "src/compiler/js-builtin-reducer.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
9 #include "src/compiler/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 DCHECK_LE(map_index, Context::GENERIC_ARRAY_VALUE_ITERATOR_MAP_INDEX); | 300 DCHECK_LE(map_index, Context::GENERIC_ARRAY_VALUE_ITERATOR_MAP_INDEX); |
301 | 301 |
302 Handle<Map> map(Map::cast(native_context()->get(map_index)), isolate()); | 302 Handle<Map> map(Map::cast(native_context()->get(map_index)), isolate()); |
303 | 303 |
304 // allocate new iterator | 304 // allocate new iterator |
305 effect = graph()->NewNode( | 305 effect = graph()->NewNode( |
306 common()->BeginRegion(RegionObservability::kNotObservable), effect); | 306 common()->BeginRegion(RegionObservability::kNotObservable), effect); |
307 Node* value = effect = graph()->NewNode( | 307 Node* value = effect = graph()->NewNode( |
308 simplified()->Allocate(NOT_TENURED), | 308 simplified()->Allocate(NOT_TENURED), |
309 jsgraph()->Constant(JSArrayIterator::kSize), effect, control); | 309 jsgraph()->Constant(JSArrayIterator::kSize), effect, control); |
| 310 NodeProperties::SetType(value, Type::OtherObject()); |
310 effect = graph()->NewNode(simplified()->StoreField(AccessBuilder::ForMap()), | 311 effect = graph()->NewNode(simplified()->StoreField(AccessBuilder::ForMap()), |
311 value, jsgraph()->Constant(map), effect, control); | 312 value, jsgraph()->Constant(map), effect, control); |
312 effect = graph()->NewNode( | 313 effect = graph()->NewNode( |
313 simplified()->StoreField(AccessBuilder::ForJSObjectProperties()), value, | 314 simplified()->StoreField(AccessBuilder::ForJSObjectProperties()), value, |
314 jsgraph()->EmptyFixedArrayConstant(), effect, control); | 315 jsgraph()->EmptyFixedArrayConstant(), effect, control); |
315 effect = graph()->NewNode( | 316 effect = graph()->NewNode( |
316 simplified()->StoreField(AccessBuilder::ForJSObjectElements()), value, | 317 simplified()->StoreField(AccessBuilder::ForJSObjectElements()), value, |
317 jsgraph()->EmptyFixedArrayConstant(), effect, control); | 318 jsgraph()->EmptyFixedArrayConstant(), effect, control); |
318 | 319 |
319 // attach the iterator to this object | 320 // attach the iterator to this object |
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 | 1737 |
1737 Node* map = jsgraph()->HeapConstant( | 1738 Node* map = jsgraph()->HeapConstant( |
1738 handle(native_context()->string_iterator_map(), isolate())); | 1739 handle(native_context()->string_iterator_map(), isolate())); |
1739 | 1740 |
1740 // allocate new iterator | 1741 // allocate new iterator |
1741 effect = graph()->NewNode( | 1742 effect = graph()->NewNode( |
1742 common()->BeginRegion(RegionObservability::kNotObservable), effect); | 1743 common()->BeginRegion(RegionObservability::kNotObservable), effect); |
1743 Node* value = effect = graph()->NewNode( | 1744 Node* value = effect = graph()->NewNode( |
1744 simplified()->Allocate(NOT_TENURED), | 1745 simplified()->Allocate(NOT_TENURED), |
1745 jsgraph()->Constant(JSStringIterator::kSize), effect, control); | 1746 jsgraph()->Constant(JSStringIterator::kSize), effect, control); |
| 1747 NodeProperties::SetType(value, Type::OtherObject()); |
1746 effect = graph()->NewNode(simplified()->StoreField(AccessBuilder::ForMap()), | 1748 effect = graph()->NewNode(simplified()->StoreField(AccessBuilder::ForMap()), |
1747 value, map, effect, control); | 1749 value, map, effect, control); |
1748 effect = graph()->NewNode( | 1750 effect = graph()->NewNode( |
1749 simplified()->StoreField(AccessBuilder::ForJSObjectProperties()), value, | 1751 simplified()->StoreField(AccessBuilder::ForJSObjectProperties()), value, |
1750 jsgraph()->EmptyFixedArrayConstant(), effect, control); | 1752 jsgraph()->EmptyFixedArrayConstant(), effect, control); |
1751 effect = graph()->NewNode( | 1753 effect = graph()->NewNode( |
1752 simplified()->StoreField(AccessBuilder::ForJSObjectElements()), value, | 1754 simplified()->StoreField(AccessBuilder::ForJSObjectElements()), value, |
1753 jsgraph()->EmptyFixedArrayConstant(), effect, control); | 1755 jsgraph()->EmptyFixedArrayConstant(), effect, control); |
1754 | 1756 |
1755 // attach the iterator to this string | 1757 // attach the iterator to this string |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 return jsgraph()->simplified(); | 2170 return jsgraph()->simplified(); |
2169 } | 2171 } |
2170 | 2172 |
2171 JSOperatorBuilder* JSBuiltinReducer::javascript() const { | 2173 JSOperatorBuilder* JSBuiltinReducer::javascript() const { |
2172 return jsgraph()->javascript(); | 2174 return jsgraph()->javascript(); |
2173 } | 2175 } |
2174 | 2176 |
2175 } // namespace compiler | 2177 } // namespace compiler |
2176 } // namespace internal | 2178 } // namespace internal |
2177 } // namespace v8 | 2179 } // namespace v8 |
OLD | NEW |