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

Side by Side Diff: test/unittests/compiler/js-builtin-reducer-unittest.cc

Issue 2239703002: [turbofan] Add inlined Array.prototype.pop support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Only convert hole to undefined for holey elements Created 4 years, 4 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 | « test/mjsunit/compiler/inlined-array-pop-opt.js ('k') | no next file » | 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 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/simplified-operator.h" 8 #include "src/compiler/simplified-operator.h"
9 #include "src/compiler/typer.h" 9 #include "src/compiler/typer.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 15 matching lines...) Expand all
26 protected: 26 protected:
27 Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags = 27 Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags =
28 MachineOperatorBuilder::Flag::kNoFlags) { 28 MachineOperatorBuilder::Flag::kNoFlags) {
29 MachineOperatorBuilder machine(zone(), MachineType::PointerRepresentation(), 29 MachineOperatorBuilder machine(zone(), MachineType::PointerRepresentation(),
30 flags); 30 flags);
31 SimplifiedOperatorBuilder simplified(zone()); 31 SimplifiedOperatorBuilder simplified(zone());
32 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &simplified, 32 JSGraph jsgraph(isolate(), graph(), common(), javascript(), &simplified,
33 &machine); 33 &machine);
34 // TODO(titzer): mock the GraphReducer here for better unit testing. 34 // TODO(titzer): mock the GraphReducer here for better unit testing.
35 GraphReducer graph_reducer(zone(), graph()); 35 GraphReducer graph_reducer(zone(), graph());
36 JSBuiltinReducer reducer(&graph_reducer, &jsgraph); 36 JSBuiltinReducer reducer(&graph_reducer, &jsgraph,
37 JSBuiltinReducer::kNoFlags, nullptr);
37 return reducer.Reduce(node); 38 return reducer.Reduce(node);
38 } 39 }
39 40
40 Node* MathFunction(const char* name) { 41 Node* MathFunction(const char* name) {
41 Handle<Object> m = 42 Handle<Object> m =
42 JSObject::GetProperty(isolate()->global_object(), 43 JSObject::GetProperty(isolate()->global_object(),
43 isolate()->factory()->NewStringFromAsciiChecked( 44 isolate()->factory()->NewStringFromAsciiChecked(
44 "Math")).ToHandleChecked(); 45 "Math")).ToHandleChecked();
45 Handle<JSFunction> f = Handle<JSFunction>::cast( 46 Handle<JSFunction> f = Handle<JSFunction>::cast(
46 Object::GetProperty( 47 Object::GetProperty(
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 Reduction r = Reduce(call); 1392 Reduction r = Reduce(call);
1392 1393
1393 ASSERT_TRUE(r.Changed()); 1394 ASSERT_TRUE(r.Changed());
1394 EXPECT_THAT(r.replacement(), 1395 EXPECT_THAT(r.replacement(),
1395 IsStringFromCharCode(IsPlainPrimitiveToNumber(p0))); 1396 IsStringFromCharCode(IsPlainPrimitiveToNumber(p0)));
1396 } 1397 }
1397 1398
1398 } // namespace compiler 1399 } // namespace compiler
1399 } // namespace internal 1400 } // namespace internal
1400 } // namespace v8 1401 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/inlined-array-pop-opt.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698