| OLD | NEW |
| 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "src/compiler/pipeline.h" | 7 #include "src/compiler/pipeline.h" |
| 8 #include "src/execution.h" | 8 #include "src/execution.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/interpreter/bytecode-array-builder.h" | 10 #include "src/interpreter/bytecode-array-builder.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 ->Get(CcTest::isolate()->GetCurrentContext(), v8_str(functionName)) | 115 ->Get(CcTest::isolate()->GetCurrentContext(), v8_str(functionName)) |
| 116 .ToLocalChecked()); | 116 .ToLocalChecked()); |
| 117 Handle<JSFunction> function = | 117 Handle<JSFunction> function = |
| 118 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); | 118 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); |
| 119 CHECK(function->shared()->HasBytecodeArray()); | 119 CHECK(function->shared()->HasBytecodeArray()); |
| 120 | 120 |
| 121 ParseInfo parse_info(zone_, function); | 121 ParseInfo parse_info(zone_, function); |
| 122 | 122 |
| 123 CompilationInfo compilation_info(&parse_info); | 123 CompilationInfo compilation_info(&parse_info); |
| 124 compilation_info.SetOptimizing(BailoutId::None(), Handle<Code>()); | 124 compilation_info.SetOptimizing(BailoutId::None(), Handle<Code>()); |
| 125 compilation_info.MarkAsDeoptimizationEnabled(); |
| 125 // TODO(mythria): Remove this step once parse_info is not needed. | 126 // TODO(mythria): Remove this step once parse_info is not needed. |
| 126 CHECK(Compiler::ParseAndAnalyze(&parse_info)); | 127 CHECK(Compiler::ParseAndAnalyze(&parse_info)); |
| 127 compiler::Pipeline pipeline(&compilation_info); | 128 compiler::Pipeline pipeline(&compilation_info); |
| 128 Handle<Code> code = pipeline.GenerateCode(); | 129 Handle<Code> code = pipeline.GenerateCode(); |
| 129 function->ReplaceCode(*code); | 130 function->ReplaceCode(*code); |
| 130 | 131 |
| 131 return function; | 132 return function; |
| 132 } | 133 } |
| 133 | 134 |
| 134 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); | 135 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); |
| (...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1875 BytecodeGraphTester tester(isolate, zone, script.start()); | 1876 BytecodeGraphTester tester(isolate, zone, script.start()); |
| 1876 auto callable = tester.GetCallable<>(); | 1877 auto callable = tester.GetCallable<>(); |
| 1877 Handle<Object> return_value = callable().ToHandleChecked(); | 1878 Handle<Object> return_value = callable().ToHandleChecked(); |
| 1878 CHECK(return_value->SameValue(*snippets[i].return_value())); | 1879 CHECK(return_value->SameValue(*snippets[i].return_value())); |
| 1879 } | 1880 } |
| 1880 } | 1881 } |
| 1881 | 1882 |
| 1882 } // namespace compiler | 1883 } // namespace compiler |
| 1883 } // namespace internal | 1884 } // namespace internal |
| 1884 } // namespace v8 | 1885 } // namespace v8 |
| OLD | NEW |