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

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

Issue 2502293002: Reland of [refactoring] Split CodeAssemblerState out of CodeAssembler (Closed)
Patch Set: fix Created 4 years, 1 month 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/function-tester.h ('k') | test/cctest/compiler/test-code-assembler.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 "test/cctest/compiler/function-tester.h" 5 #include "test/cctest/compiler/function-tester.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/compilation-info.h" 8 #include "src/compilation-info.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 28 matching lines...) Expand all
39 39
40 FunctionTester::FunctionTester(Handle<Code> code, int param_count) 40 FunctionTester::FunctionTester(Handle<Code> code, int param_count)
41 : isolate(main_isolate()), 41 : isolate(main_isolate()),
42 function((FLAG_allow_natives_syntax = true, 42 function((FLAG_allow_natives_syntax = true,
43 NewFunction(BuildFunction(param_count).c_str()))), 43 NewFunction(BuildFunction(param_count).c_str()))),
44 flags_(0) { 44 flags_(0) {
45 Compile(function); 45 Compile(function);
46 function->ReplaceCode(*code); 46 function->ReplaceCode(*code);
47 } 47 }
48 48
49 FunctionTester::FunctionTester(const CallInterfaceDescriptor& descriptor, 49 FunctionTester::FunctionTester(Handle<Code> code) : FunctionTester(code, 0) {}
50 Handle<Code> code)
51 : FunctionTester(code, descriptor.GetParameterCount()) {}
52 50
53 MaybeHandle<Object> FunctionTester::Call() { 51 MaybeHandle<Object> FunctionTester::Call() {
54 return Execution::Call(isolate, function, undefined(), 0, nullptr); 52 return Execution::Call(isolate, function, undefined(), 0, nullptr);
55 } 53 }
56 54
57 MaybeHandle<Object> FunctionTester::Call(Handle<Object> a) { 55 MaybeHandle<Object> FunctionTester::Call(Handle<Object> a) {
58 Handle<Object> args[] = {a}; 56 Handle<Object> args[] = {a};
59 return Execution::Call(isolate, function, undefined(), 1, args); 57 return Execution::Call(isolate, function, undefined(), 1, args);
60 } 58 }
61 59
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 192
195 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph); 193 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph);
196 CHECK(!code.is_null()); 194 CHECK(!code.is_null());
197 function->ReplaceCode(*code); 195 function->ReplaceCode(*code);
198 return function; 196 return function;
199 } 197 }
200 198
201 } // namespace compiler 199 } // namespace compiler
202 } // namespace internal 200 } // namespace internal
203 } // namespace v8 201 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/function-tester.h ('k') | test/cctest/compiler/test-code-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698