| 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 ->Get(CcTest::isolate()->GetCurrentContext(), v8_str(functionName)) | 117 ->Get(CcTest::isolate()->GetCurrentContext(), v8_str(functionName)) |
| 118 .ToLocalChecked()); | 118 .ToLocalChecked()); |
| 119 Handle<JSFunction> function = | 119 Handle<JSFunction> function = |
| 120 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); | 120 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); |
| 121 CHECK(function->shared()->HasBytecodeArray()); | 121 CHECK(function->shared()->HasBytecodeArray()); |
| 122 | 122 |
| 123 // TODO(mstarzinger): We should be able to prime CompilationInfo without | 123 // TODO(mstarzinger): We should be able to prime CompilationInfo without |
| 124 // having to instantiate a ParseInfo first. Fix this! | 124 // having to instantiate a ParseInfo first. Fix this! |
| 125 ParseInfo parse_info(handle(function->shared())); | 125 ParseInfo parse_info(handle(function->shared())); |
| 126 | 126 |
| 127 CompilationInfo compilation_info(&parse_info, function); | 127 Zone compile_zone(function->GetIsolate()->allocator(), ZONE_NAME); |
| 128 CompilationInfo compilation_info(&compile_zone, &parse_info, function); |
| 128 compilation_info.SetOptimizing(); | 129 compilation_info.SetOptimizing(); |
| 129 compilation_info.MarkAsDeoptimizationEnabled(); | 130 compilation_info.MarkAsDeoptimizationEnabled(); |
| 130 compilation_info.MarkAsOptimizeFromBytecode(); | 131 compilation_info.MarkAsOptimizeFromBytecode(); |
| 131 Handle<Code> code = Pipeline::GenerateCodeForTesting(&compilation_info); | 132 Handle<Code> code = Pipeline::GenerateCodeForTesting(&compilation_info); |
| 132 function->ReplaceCode(*code); | 133 function->ReplaceCode(*code); |
| 133 | 134 |
| 134 return function; | 135 return function; |
| 135 } | 136 } |
| 136 | 137 |
| 137 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); | 138 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); |
| (...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2989 Handle<Object> return_value = callable().ToHandleChecked(); | 2990 Handle<Object> return_value = callable().ToHandleChecked(); |
| 2990 | 2991 |
| 2991 v8::Debug::SetDebugEventListener(CcTest::isolate(), nullptr); | 2992 v8::Debug::SetDebugEventListener(CcTest::isolate(), nullptr); |
| 2992 CHECK(return_value.is_identical_to(snippet.return_value())); | 2993 CHECK(return_value.is_identical_to(snippet.return_value())); |
| 2993 CHECK_EQ(2, debug_break_count); | 2994 CHECK_EQ(2, debug_break_count); |
| 2994 } | 2995 } |
| 2995 | 2996 |
| 2996 } // namespace compiler | 2997 } // namespace compiler |
| 2997 } // namespace internal | 2998 } // namespace internal |
| 2998 } // namespace v8 | 2999 } // namespace v8 |
| OLD | NEW |