| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 v8::Local<v8::Script> BytecodeExpectationsPrinter::CompileScript( | 64 v8::Local<v8::Script> BytecodeExpectationsPrinter::CompileScript( |
| 65 const char* program) const { | 65 const char* program) const { |
| 66 v8::Local<v8::String> source = V8StringFromUTF8(program); | 66 v8::Local<v8::String> source = V8StringFromUTF8(program); |
| 67 return v8::Script::Compile(isolate_->GetCurrentContext(), source) | 67 return v8::Script::Compile(isolate_->GetCurrentContext(), source) |
| 68 .ToLocalChecked(); | 68 .ToLocalChecked(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 v8::Local<v8::Module> BytecodeExpectationsPrinter::CompileModule( | 71 v8::Local<v8::Module> BytecodeExpectationsPrinter::CompileModule( |
| 72 const char* program) const { | 72 const char* program) const { |
| 73 v8::ScriptCompiler::Source source(V8StringFromUTF8(program)); | 73 ScriptOrigin origin( |
| 74 Local<v8::Value>(), Local<v8::Integer>(), Local<v8::Integer>(), |
| 75 Local<v8::Boolean>(), Local<v8::Integer>(), Local<v8::Value>(), |
| 76 Local<v8::Boolean>(), Local<v8::Boolean>(), True(isolate_)); |
| 77 v8::ScriptCompiler::Source source(V8StringFromUTF8(program), origin); |
| 74 return v8::ScriptCompiler::CompileModule(isolate_, &source).ToLocalChecked(); | 78 return v8::ScriptCompiler::CompileModule(isolate_, &source).ToLocalChecked(); |
| 75 } | 79 } |
| 76 | 80 |
| 77 void BytecodeExpectationsPrinter::Run(v8::Local<v8::Script> script) const { | 81 void BytecodeExpectationsPrinter::Run(v8::Local<v8::Script> script) const { |
| 78 (void)script->Run(isolate_->GetCurrentContext()); | 82 (void)script->Run(isolate_->GetCurrentContext()); |
| 79 } | 83 } |
| 80 | 84 |
| 81 i::Handle<v8::internal::BytecodeArray> | 85 i::Handle<v8::internal::BytecodeArray> |
| 82 BytecodeExpectationsPrinter::GetBytecodeArrayForGlobal( | 86 BytecodeExpectationsPrinter::GetBytecodeArrayForGlobal( |
| 83 const char* global_name) const { | 87 const char* global_name) const { |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 383 |
| 380 stream << "---\n"; | 384 stream << "---\n"; |
| 381 PrintCodeSnippet(stream, snippet); | 385 PrintCodeSnippet(stream, snippet); |
| 382 PrintBytecodeArray(stream, bytecode_array); | 386 PrintBytecodeArray(stream, bytecode_array); |
| 383 stream << '\n'; | 387 stream << '\n'; |
| 384 } | 388 } |
| 385 | 389 |
| 386 } // namespace interpreter | 390 } // namespace interpreter |
| 387 } // namespace internal | 391 } // namespace internal |
| 388 } // namespace v8 | 392 } // namespace v8 |
| OLD | NEW |