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

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

Issue 2504913002: Revert of [refactoring] Split CodeAssemblerState out of CodeAssembler (Closed)
Patch Set: 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(Handle<Code> code) : FunctionTester(code, 0) {} 49 FunctionTester::FunctionTester(const CallInterfaceDescriptor& descriptor,
50 Handle<Code> code)
51 : FunctionTester(code, descriptor.GetParameterCount()) {}
50 52
51 MaybeHandle<Object> FunctionTester::Call() { 53 MaybeHandle<Object> FunctionTester::Call() {
52 return Execution::Call(isolate, function, undefined(), 0, nullptr); 54 return Execution::Call(isolate, function, undefined(), 0, nullptr);
53 } 55 }
54 56
55 MaybeHandle<Object> FunctionTester::Call(Handle<Object> a) { 57 MaybeHandle<Object> FunctionTester::Call(Handle<Object> a) {
56 Handle<Object> args[] = {a}; 58 Handle<Object> args[] = {a};
57 return Execution::Call(isolate, function, undefined(), 1, args); 59 return Execution::Call(isolate, function, undefined(), 1, args);
58 } 60 }
59 61
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 194
193 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph); 195 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info, graph);
194 CHECK(!code.is_null()); 196 CHECK(!code.is_null());
195 function->ReplaceCode(*code); 197 function->ReplaceCode(*code);
196 return function; 198 return function;
197 } 199 }
198 200
199 } // namespace compiler 201 } // namespace compiler
200 } // namespace internal 202 } // namespace internal
201 } // namespace v8 203 } // 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