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

Side by Side Diff: test/cctest/compiler/test-run-stubs.cc

Issue 1409993002: [turbofan] Move SimplifiedOperatorBuilder into JSGraph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/js-operator.h" 10 #include "src/compiler/js-operator.h"
(...skipping 17 matching lines...) Expand all
28 Zone* zone = scope.main_zone(); 28 Zone* zone = scope.main_zone();
29 CompilationInfo info(&stub, isolate, zone); 29 CompilationInfo info(&stub, isolate, zone);
30 CallDescriptor* descriptor = Linkage::ComputeIncoming(zone, &info); 30 CallDescriptor* descriptor = Linkage::ComputeIncoming(zone, &info);
31 Handle<FixedArray> tv = isolate->factory()->NewFixedArray(10); 31 Handle<FixedArray> tv = isolate->factory()->NewFixedArray(10);
32 32
33 // Create a function to call the code using the descriptor. 33 // Create a function to call the code using the descriptor.
34 Graph graph(zone); 34 Graph graph(zone);
35 CommonOperatorBuilder common(zone); 35 CommonOperatorBuilder common(zone);
36 JSOperatorBuilder javascript(zone); 36 JSOperatorBuilder javascript(zone);
37 MachineOperatorBuilder machine(zone); 37 MachineOperatorBuilder machine(zone);
38 JSGraph js(isolate, &graph, &common, &javascript, &machine); 38 JSGraph js(isolate, &graph, &common, &javascript, nullptr, &machine);
39 39
40 // FunctionTester (ab)uses a 2-argument function 40 // FunctionTester (ab)uses a 2-argument function
41 Node* start = graph.NewNode(common.Start(4)); 41 Node* start = graph.NewNode(common.Start(4));
42 // Parameter 0 is the number to round 42 // Parameter 0 is the number to round
43 Node* numberParam = graph.NewNode(common.Parameter(1), start); 43 Node* numberParam = graph.NewNode(common.Parameter(1), start);
44 Node* theCode = graph.NewNode(common.HeapConstant(code)); 44 Node* theCode = graph.NewNode(common.HeapConstant(code));
45 Node* vector = graph.NewNode(common.HeapConstant(tv)); 45 Node* vector = graph.NewNode(common.HeapConstant(tv));
46 Node* dummyContext = graph.NewNode(common.NumberConstant(0.0)); 46 Node* dummyContext = graph.NewNode(common.NumberConstant(0.0));
47 Node* call = 47 Node* call =
48 graph.NewNode(common.Call(descriptor), theCode, js.UndefinedConstant(), 48 graph.NewNode(common.Call(descriptor), theCode, js.UndefinedConstant(),
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 graph.SetStart(start); 133 graph.SetStart(start);
134 graph.SetEnd(end); 134 graph.SetEnd(end);
135 FunctionTester ft(&graph); 135 FunctionTester ft(&graph);
136 136
137 // Actuall call through to the stub, verifying its result. 137 // Actuall call through to the stub, verifying its result.
138 Handle<String> leftArg = ft.Val("links"); 138 Handle<String> leftArg = ft.Val("links");
139 Handle<String> rightArg = ft.Val("rechts"); 139 Handle<String> rightArg = ft.Val("rechts");
140 Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked(); 140 Handle<Object> result = ft.Call(leftArg, rightArg).ToHandleChecked();
141 CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result))); 141 CHECK(String::Equals(ft.Val("linksrechts"), Handle<String>::cast(result)));
142 } 142 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-representation-change.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698