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/compilation-dependencies.h" | 7 #include "src/compilation-dependencies.h" |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 elements = effect = | 306 elements = effect = |
307 graph()->NewNode(simplified()->MaybeGrowFastElements(flags), receiver, | 307 graph()->NewNode(simplified()->MaybeGrowFastElements(flags), receiver, |
308 elements, length, length, effect, control); | 308 elements, length, length, effect, control); |
309 | 309 |
310 // Append the value to the {elements}. | 310 // Append the value to the {elements}. |
311 effect = graph()->NewNode( | 311 effect = graph()->NewNode( |
312 simplified()->StoreElement( | 312 simplified()->StoreElement( |
313 AccessBuilder::ForFixedArrayElement(receiver_map->elements_kind())), | 313 AccessBuilder::ForFixedArrayElement(receiver_map->elements_kind())), |
314 elements, length, value, effect, control); | 314 elements, length, value, effect, control); |
315 | 315 |
| 316 // Return the new length of the {receiver}. |
| 317 value = graph()->NewNode(simplified()->NumberAdd(), length, |
| 318 jsgraph()->OneConstant()); |
| 319 |
316 ReplaceWithValue(node, value, effect, control); | 320 ReplaceWithValue(node, value, effect, control); |
317 return Replace(value); | 321 return Replace(value); |
318 } | 322 } |
319 return NoChange(); | 323 return NoChange(); |
320 } | 324 } |
321 | 325 |
322 namespace { | 326 namespace { |
323 | 327 |
324 bool HasInstanceTypeWitness(Node* receiver, Node* effect, | 328 bool HasInstanceTypeWitness(Node* receiver, Node* effect, |
325 InstanceType instance_type) { | 329 InstanceType instance_type) { |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 return jsgraph()->simplified(); | 1393 return jsgraph()->simplified(); |
1390 } | 1394 } |
1391 | 1395 |
1392 JSOperatorBuilder* JSBuiltinReducer::javascript() const { | 1396 JSOperatorBuilder* JSBuiltinReducer::javascript() const { |
1393 return jsgraph()->javascript(); | 1397 return jsgraph()->javascript(); |
1394 } | 1398 } |
1395 | 1399 |
1396 } // namespace compiler | 1400 } // namespace compiler |
1397 } // namespace internal | 1401 } // namespace internal |
1398 } // namespace v8 | 1402 } // namespace v8 |
OLD | NEW |