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

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

Issue 2425903002: [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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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