Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: src/compiler/js-builtin-reducer.cc

Issue 2434753002: Merged: [turbofan] Fix return value of Array.prototype.push. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/typer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 elements = effect = 301 elements = effect =
302 graph()->NewNode(simplified()->MaybeGrowFastElements(flags), receiver, 302 graph()->NewNode(simplified()->MaybeGrowFastElements(flags), receiver,
303 elements, length, length, effect, control); 303 elements, length, length, effect, control);
304 304
305 // Append the value to the {elements}. 305 // Append the value to the {elements}.
306 effect = graph()->NewNode( 306 effect = graph()->NewNode(
307 simplified()->StoreElement( 307 simplified()->StoreElement(
308 AccessBuilder::ForFixedArrayElement(receiver_map->elements_kind())), 308 AccessBuilder::ForFixedArrayElement(receiver_map->elements_kind())),
309 elements, length, value, effect, control); 309 elements, length, value, effect, control);
310 310
311 // Return the new length of the {receiver}.
312 value = graph()->NewNode(simplified()->NumberAdd(), length,
313 jsgraph()->OneConstant());
314
311 ReplaceWithValue(node, value, effect, control); 315 ReplaceWithValue(node, value, effect, control);
312 return Replace(value); 316 return Replace(value);
313 } 317 }
314 return NoChange(); 318 return NoChange();
315 } 319 }
316 320
317 // ES6 section 20.2.2.1 Math.abs ( x ) 321 // ES6 section 20.2.2.1 Math.abs ( x )
318 Reduction JSBuiltinReducer::ReduceMathAbs(Node* node) { 322 Reduction JSBuiltinReducer::ReduceMathAbs(Node* node) {
319 JSCallReduction r(node); 323 JSCallReduction r(node);
320 if (r.InputsMatchOne(Type::PlainPrimitive())) { 324 if (r.InputsMatchOne(Type::PlainPrimitive())) {
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 } 1137 }
1134 1138
1135 1139
1136 SimplifiedOperatorBuilder* JSBuiltinReducer::simplified() const { 1140 SimplifiedOperatorBuilder* JSBuiltinReducer::simplified() const {
1137 return jsgraph()->simplified(); 1141 return jsgraph()->simplified();
1138 } 1142 }
1139 1143
1140 } // namespace compiler 1144 } // namespace compiler
1141 } // namespace internal 1145 } // namespace internal
1142 } // namespace v8 1146 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698