| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/interpreter/bytecode-expectations-printer.h" | 5 #include "test/cctest/interpreter/bytecode-expectations-printer.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 #include <iostream> | 8 #include <iostream> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 i::Handle<i::BytecodeArray> bytecodes = | 76 i::Handle<i::BytecodeArray> bytecodes = |
| 77 i::handle(js_function->shared()->bytecode_array(), i_isolate()); | 77 i::handle(js_function->shared()->bytecode_array(), i_isolate()); |
| 78 | 78 |
| 79 return bytecodes; | 79 return bytecodes; |
| 80 } | 80 } |
| 81 | 81 |
| 82 i::Handle<i::BytecodeArray> | 82 i::Handle<i::BytecodeArray> |
| 83 BytecodeExpectationsPrinter::GetBytecodeArrayForModule( | 83 BytecodeExpectationsPrinter::GetBytecodeArrayForModule( |
| 84 v8::Local<v8::Module> module) const { | 84 v8::Local<v8::Module> module) const { |
| 85 i::Handle<i::Module> i_module = v8::Utils::OpenHandle(*module); | 85 i::Handle<i::Module> i_module = v8::Utils::OpenHandle(*module); |
| 86 return i::handle(i_module->shared()->bytecode_array(), i_isolate()); | 86 CHECK(!i_module->instantiated()); |
| 87 return i::handle(SharedFunctionInfo::cast(i_module->code())->bytecode_array(), |
| 88 i_isolate()); |
| 87 } | 89 } |
| 88 | 90 |
| 89 i::Handle<i::BytecodeArray> | 91 i::Handle<i::BytecodeArray> |
| 90 BytecodeExpectationsPrinter::GetBytecodeArrayForScript( | 92 BytecodeExpectationsPrinter::GetBytecodeArrayForScript( |
| 91 v8::Local<v8::Script> script) const { | 93 v8::Local<v8::Script> script) const { |
| 92 i::Handle<i::JSFunction> js_function = v8::Utils::OpenHandle(*script); | 94 i::Handle<i::JSFunction> js_function = v8::Utils::OpenHandle(*script); |
| 93 return i::handle(js_function->shared()->bytecode_array(), i_isolate()); | 95 return i::handle(js_function->shared()->bytecode_array(), i_isolate()); |
| 94 } | 96 } |
| 95 | 97 |
| 96 void BytecodeExpectationsPrinter::PrintEscapedString( | 98 void BytecodeExpectationsPrinter::PrintEscapedString( |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 358 |
| 357 stream << "---\n"; | 359 stream << "---\n"; |
| 358 PrintCodeSnippet(stream, snippet); | 360 PrintCodeSnippet(stream, snippet); |
| 359 PrintBytecodeArray(stream, bytecode_array); | 361 PrintBytecodeArray(stream, bytecode_array); |
| 360 stream << '\n'; | 362 stream << '\n'; |
| 361 } | 363 } |
| 362 | 364 |
| 363 } // namespace interpreter | 365 } // namespace interpreter |
| 364 } // namespace internal | 366 } // namespace internal |
| 365 } // namespace v8 | 367 } // namespace v8 |
| OLD | NEW |