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

Side by Side Diff: test/cctest/compiler/graph-builder-tester.cc

Issue 1109853003: [test] Remove pesky MachineCallHelper from inheritance chain. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup. Created 5 years, 7 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/cctest/compiler/graph-builder-tester.h ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "test/cctest/compiler/graph-builder-tester.h"
6
7 #include "src/compiler/linkage.h"
8 #include "src/compiler/pipeline.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace compiler {
13
14 MachineCallHelper::MachineCallHelper(Isolate* isolate,
15 MachineSignature* machine_sig)
16 : CallHelper(isolate, machine_sig),
17 parameters_(NULL),
18 isolate_(isolate),
19 graph_(NULL) {}
20
21
22 void MachineCallHelper::InitParameters(GraphBuilder* builder,
23 CommonOperatorBuilder* common) {
24 DCHECK(!parameters_);
25 graph_ = builder->graph();
26 int param_count = static_cast<int>(parameter_count());
27 if (param_count == 0) return;
28 parameters_ = graph_->zone()->NewArray<Node*>(param_count);
29 for (int i = 0; i < param_count; ++i) {
30 parameters_[i] = builder->NewNode(common->Parameter(i), graph_->start());
31 }
32 }
33
34
35 byte* MachineCallHelper::Generate() {
36 DCHECK(parameter_count() == 0 || parameters_ != NULL);
37 if (!Pipeline::SupportedBackend()) return NULL;
38 if (code_.is_null()) {
39 Zone* zone = graph_->zone();
40 CallDescriptor* desc =
41 Linkage::GetSimplifiedCDescriptor(zone, machine_sig_);
42 code_ = Pipeline::GenerateCodeForTesting(isolate_, desc, graph_);
43 }
44 return code_.ToHandleChecked()->entry();
45 }
46
47
48 Node* MachineCallHelper::Parameter(size_t index) {
49 DCHECK(parameters_);
50 DCHECK(index < parameter_count());
51 return parameters_[index];
52 }
53
54 } // namespace compiler
55 } // namespace internal
56 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/graph-builder-tester.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698