| OLD | NEW |
| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> function) { | 157 Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> function) { |
| 158 Zone zone(function->GetIsolate()->allocator(), ZONE_NAME); | 158 Zone zone(function->GetIsolate()->allocator(), ZONE_NAME); |
| 159 ParseInfo parse_info(&zone, handle(function->shared())); | 159 ParseInfo parse_info(&zone, handle(function->shared())); |
| 160 CompilationInfo info(&parse_info, function); | 160 CompilationInfo info(&parse_info, function); |
| 161 | 161 |
| 162 info.SetOptimizing(); | 162 info.SetOptimizing(); |
| 163 info.MarkAsDeoptimizationEnabled(); | 163 info.MarkAsDeoptimizationEnabled(); |
| 164 if (flags_ & CompilationInfo::kInliningEnabled) { | 164 if (flags_ & CompilationInfo::kInliningEnabled) { |
| 165 info.MarkAsInliningEnabled(); | 165 info.MarkAsInliningEnabled(); |
| 166 } | 166 } |
| 167 if (Compiler::EnsureBytecode(&info)) { | 167 |
| 168 CHECK(Compiler::Compile(function, Compiler::CLEAR_EXCEPTION)); |
| 169 if (info.shared_info()->HasBytecodeArray()) { |
| 168 info.MarkAsOptimizeFromBytecode(); | 170 info.MarkAsOptimizeFromBytecode(); |
| 169 } else { | 171 } else { |
| 170 CHECK(Compiler::ParseAndAnalyze(info.parse_info())); | 172 CHECK(Compiler::ParseAndAnalyze(info.parse_info())); |
| 171 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); | 173 CHECK(Compiler::EnsureDeoptimizationSupport(&info)); |
| 172 } | 174 } |
| 173 JSFunction::EnsureLiterals(function); | 175 JSFunction::EnsureLiterals(function); |
| 174 | 176 |
| 175 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info); | 177 Handle<Code> code = Pipeline::GenerateCodeForTesting(&info); |
| 176 CHECK(!code.is_null()); | 178 CHECK(!code.is_null()); |
| 177 info.dependencies()->Commit(code); | 179 info.dependencies()->Commit(code); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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 |
| OLD | NEW |