| 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/compilation-info.h" | 7 #include "src/compilation-info.h" |
| 8 #include "src/compiler/pipeline.h" | 8 #include "src/compiler/pipeline.h" |
| 9 #include "src/execution.h" | 9 #include "src/execution.h" |
| 10 #include "src/handles.h" | 10 #include "src/handles.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 Local<Function> api_function = Local<Function>::Cast( | 117 Local<Function> api_function = Local<Function>::Cast( |
| 118 CcTest::global() | 118 CcTest::global() |
| 119 ->Get(CcTest::isolate()->GetCurrentContext(), v8_str(functionName)) | 119 ->Get(CcTest::isolate()->GetCurrentContext(), v8_str(functionName)) |
| 120 .ToLocalChecked()); | 120 .ToLocalChecked()); |
| 121 Handle<JSFunction> function = | 121 Handle<JSFunction> function = |
| 122 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); | 122 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); |
| 123 CHECK(function->shared()->HasBytecodeArray()); | 123 CHECK(function->shared()->HasBytecodeArray()); |
| 124 | 124 |
| 125 // TODO(mstarzinger): We should be able to prime CompilationInfo without | 125 // TODO(mstarzinger): We should be able to prime CompilationInfo without |
| 126 // having to instantiate a ParseInfo first. Fix this! | 126 // having to instantiate a ParseInfo first. Fix this! |
| 127 ParseInfo parse_info(zone_, handle(function->shared())); | 127 ParseInfo parse_info(zone_, function); |
| 128 | 128 |
| 129 CompilationInfo compilation_info(&parse_info, function); | 129 CompilationInfo compilation_info(&parse_info, function); |
| 130 compilation_info.SetOptimizing(); | 130 compilation_info.SetOptimizing(); |
| 131 compilation_info.MarkAsDeoptimizationEnabled(); | 131 compilation_info.MarkAsDeoptimizationEnabled(); |
| 132 compilation_info.MarkAsOptimizeFromBytecode(); | 132 compilation_info.MarkAsOptimizeFromBytecode(); |
| 133 Handle<Code> code = Pipeline::GenerateCodeForTesting(&compilation_info); | 133 Handle<Code> code = Pipeline::GenerateCodeForTesting(&compilation_info); |
| 134 function->ReplaceCode(*code); | 134 function->ReplaceCode(*code); |
| 135 | 135 |
| 136 return function; | 136 return function; |
| 137 } | 137 } |
| (...skipping 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3056 | 3056 |
| 3057 BytecodeGraphTester tester(isolate, zone, script.start()); | 3057 BytecodeGraphTester tester(isolate, zone, script.start()); |
| 3058 auto callable = tester.GetCallable<>(); | 3058 auto callable = tester.GetCallable<>(); |
| 3059 Handle<Object> return_value = callable().ToHandleChecked(); | 3059 Handle<Object> return_value = callable().ToHandleChecked(); |
| 3060 CHECK(return_value->SameValue(*snippet.return_value())); | 3060 CHECK(return_value->SameValue(*snippet.return_value())); |
| 3061 } | 3061 } |
| 3062 | 3062 |
| 3063 } // namespace compiler | 3063 } // namespace compiler |
| 3064 } // namespace internal | 3064 } // namespace internal |
| 3065 } // namespace v8 | 3065 } // namespace v8 |
| OLD | NEW |