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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 .ToLocalChecked()); | 117 .ToLocalChecked()); |
118 Handle<JSFunction> function = | 118 Handle<JSFunction> function = |
119 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); | 119 Handle<JSFunction>::cast(v8::Utils::OpenHandle(*api_function)); |
120 CHECK(function->shared()->HasBytecodeArray()); | 120 CHECK(function->shared()->HasBytecodeArray()); |
121 | 121 |
122 // TODO(mstarzinger): We should be able to prime CompilationInfo without | 122 // TODO(mstarzinger): We should be able to prime CompilationInfo without |
123 // having to instantiate a ParseInfo first. Fix this! | 123 // having to instantiate a ParseInfo first. Fix this! |
124 ParseInfo parse_info(zone_, function); | 124 ParseInfo parse_info(zone_, function); |
125 | 125 |
126 CompilationInfo compilation_info(&parse_info); | 126 CompilationInfo compilation_info(&parse_info); |
127 compilation_info.SetOptimizing(BailoutId::None(), Handle<Code>()); | 127 compilation_info.SetOptimizing(); |
128 compilation_info.MarkAsDeoptimizationEnabled(); | 128 compilation_info.MarkAsDeoptimizationEnabled(); |
129 compiler::Pipeline pipeline(&compilation_info); | 129 compiler::Pipeline pipeline(&compilation_info); |
130 Handle<Code> code = pipeline.GenerateCode(); | 130 Handle<Code> code = pipeline.GenerateCode(); |
131 function->ReplaceCode(*code); | 131 function->ReplaceCode(*code); |
132 | 132 |
133 return function; | 133 return function; |
134 } | 134 } |
135 | 135 |
136 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); | 136 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphTester); |
137 }; | 137 }; |
(...skipping 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 | 3003 |
3004 BytecodeGraphTester tester(isolate, zone, script.start()); | 3004 BytecodeGraphTester tester(isolate, zone, script.start()); |
3005 auto callable = tester.GetCallable<>(); | 3005 auto callable = tester.GetCallable<>(); |
3006 Handle<Object> return_value = callable().ToHandleChecked(); | 3006 Handle<Object> return_value = callable().ToHandleChecked(); |
3007 CHECK(return_value->SameValue(*snippet.return_value())); | 3007 CHECK(return_value->SameValue(*snippet.return_value())); |
3008 } | 3008 } |
3009 | 3009 |
3010 } // namespace compiler | 3010 } // namespace compiler |
3011 } // namespace internal | 3011 } // namespace internal |
3012 } // namespace v8 | 3012 } // namespace v8 |
OLD | NEW |