Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: test/cctest/interpreter/bytecode-expectations-printer.cc

Issue 2611643002: [modules] Add an IsModule flag to ScriptOriginOptions. (Closed)
Patch Set: Remove convenience function from API. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/compiler/test-linkage.cc ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-linkage.cc ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698