mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 15:01:29 +00:00
[VM] use coresnapshot when initializing an Isolate
- use core snapshot when initializing an isolate (CorelibIsolateStartup benchmark moves from 39s to 2s) - remove use_dart_frontend flag from the isolate specific flags - the script snapshot API functions now return an error Change-Id: Ia562e007fdbfd1d3ebd8e1a0c8feee238bada00b Reviewed-on: https://dart-review.googlesource.com/76709 Commit-Queue: Siva Annamalai <asiva@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
808ed6238b
commit
76470aca47
|
@ -645,13 +645,19 @@ dart_io("standalone_dart_io") {
|
|||
}
|
||||
|
||||
gen_snapshot_action("generate_snapshot_bin") {
|
||||
deps = [
|
||||
"../vm:vm_platform",
|
||||
]
|
||||
vm_snapshot_data = "$target_gen_dir/vm_snapshot_data.bin"
|
||||
vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin"
|
||||
isolate_snapshot_data = "$target_gen_dir/isolate_snapshot_data.bin"
|
||||
isolate_snapshot_instructions =
|
||||
"$target_gen_dir/isolate_snapshot_instructions.bin"
|
||||
|
||||
inputs = []
|
||||
platform_dill = "$root_out_dir/vm_platform_strong.dill"
|
||||
inputs = [
|
||||
platform_dill,
|
||||
]
|
||||
outputs = [
|
||||
vm_snapshot_data,
|
||||
vm_snapshot_instructions,
|
||||
|
@ -668,6 +674,7 @@ gen_snapshot_action("generate_snapshot_bin") {
|
|||
rebase_path(isolate_snapshot_data, root_build_dir),
|
||||
"--isolate_snapshot_instructions=" +
|
||||
rebase_path(isolate_snapshot_instructions, root_build_dir),
|
||||
rebase_path(platform_dill),
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -342,6 +342,7 @@ static Dart_Isolate IsolateSetupHelper(Dart_Isolate isolate,
|
|||
Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
|
||||
Builtin::SetNativeResolver(Builtin::kIOLibrary);
|
||||
Builtin::SetNativeResolver(Builtin::kCLILibrary);
|
||||
VmService::SetNativeResolver();
|
||||
}
|
||||
if (isolate_run_app_snapshot) {
|
||||
Dart_Handle result = Loader::ReloadNativeExtensions();
|
||||
|
@ -508,27 +509,23 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri,
|
|||
char** error,
|
||||
int* exit_code) {
|
||||
ASSERT(script_uri != NULL);
|
||||
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
// AOT: All isolates start from the app snapshot.
|
||||
bool skip_library_load = true;
|
||||
const uint8_t* isolate_snapshot_data = app_isolate_snapshot_data;
|
||||
const uint8_t* isolate_snapshot_instructions =
|
||||
app_isolate_snapshot_instructions;
|
||||
#else
|
||||
// JIT: Service isolate uses the core libraries snapshot.
|
||||
bool skip_library_load = false;
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
||||
Dart_Isolate isolate = NULL;
|
||||
IsolateData* isolate_data =
|
||||
new IsolateData(script_uri, package_root, packages_config, NULL);
|
||||
bool skip_library_load = true;
|
||||
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
// AOT: All isolates start from the app snapshot.
|
||||
const uint8_t* isolate_snapshot_data = app_isolate_snapshot_data;
|
||||
const uint8_t* isolate_snapshot_instructions =
|
||||
app_isolate_snapshot_instructions;
|
||||
isolate = Dart_CreateIsolate(
|
||||
script_uri, main, isolate_snapshot_data, isolate_snapshot_instructions,
|
||||
app_isolate_shared_data, app_isolate_shared_instructions, flags,
|
||||
isolate_data, error);
|
||||
#else
|
||||
// JIT: Service isolate uses the core libraries snapshot.
|
||||
|
||||
// Set the flag to load the vmservice library. If not set, the kernel
|
||||
// loader might skip loading it. This is flag is not relevant for the
|
||||
// non-kernel flow.
|
||||
|
@ -552,11 +549,10 @@ static Dart_Isolate CreateAndSetupServiceIsolate(const char* script_uri,
|
|||
kernel_buffer_size, flags,
|
||||
isolate_data, error);
|
||||
} else {
|
||||
*error = strdup("Platform kernel not available to create service isolate.");
|
||||
*error = strdup("Platform file not available to create service isolate.");
|
||||
delete isolate_data;
|
||||
return NULL;
|
||||
}
|
||||
skip_library_load = true;
|
||||
#endif // !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (isolate == NULL) {
|
||||
delete isolate_data;
|
||||
|
@ -650,7 +646,7 @@ static Dart_Isolate CreateIsolateAndSetupHelper(bool is_main_isolate,
|
|||
Dart_Isolate isolate = NULL;
|
||||
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (!isolate_run_app_snapshot) {
|
||||
if (!isolate_run_app_snapshot && (isolate_snapshot_data == NULL)) {
|
||||
const uint8_t* platform_kernel_buffer = NULL;
|
||||
intptr_t platform_kernel_buffer_size = 0;
|
||||
dfe.LoadPlatform(&platform_kernel_buffer, &platform_kernel_buffer_size);
|
||||
|
|
|
@ -275,23 +275,8 @@ static int Main(int argc, const char** argv) {
|
|||
bin::TimerUtils::InitOnce();
|
||||
bin::EventHandler::Start();
|
||||
|
||||
const char* error;
|
||||
if (!start_kernel_isolate) {
|
||||
int extra_argc = dart_argc + 3;
|
||||
const char** extra_argv = new const char*[extra_argc];
|
||||
for (intptr_t i = 0; i < dart_argc; i++) {
|
||||
extra_argv[i] = dart_argv[i];
|
||||
}
|
||||
extra_argv[dart_argc] = "--no-strong";
|
||||
extra_argv[dart_argc + 1] = "--no-reify_generic_functions";
|
||||
extra_argv[dart_argc + 2] = "--no-sync-async";
|
||||
error = Flags::ProcessCommandLineFlags(extra_argc, extra_argv);
|
||||
delete[] extra_argv;
|
||||
ASSERT(error == NULL);
|
||||
} else {
|
||||
error = Flags::ProcessCommandLineFlags(dart_argc, dart_argv);
|
||||
ASSERT(error == NULL);
|
||||
}
|
||||
const char* error = Flags::ProcessCommandLineFlags(dart_argc, dart_argv);
|
||||
ASSERT(error == NULL);
|
||||
|
||||
TesterState::vm_snapshot_data = dart::bin::vm_snapshot_data;
|
||||
TesterState::create_callback = CreateIsolateAndSetup;
|
||||
|
|
|
@ -170,6 +170,14 @@ bool VmService::LoadForGenPrecompiled(bool use_dart_frontend) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void VmService::SetNativeResolver() {
|
||||
Dart_Handle url = DartUtils::NewString(kVMServiceIOLibraryUri);
|
||||
Dart_Handle library = Dart_LookupLibrary(url);
|
||||
if (!Dart_IsError(library)) {
|
||||
Dart_SetNativeResolver(library, VmServiceIONativeResolver, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
bool VmService::Setup(const char* server_ip,
|
||||
intptr_t server_port,
|
||||
bool running_precompiled,
|
||||
|
|
|
@ -23,6 +23,8 @@ class VmService {
|
|||
bool trace_loading,
|
||||
bool deterministic);
|
||||
|
||||
static void SetNativeResolver();
|
||||
|
||||
// Error message if startup failed.
|
||||
static const char* GetErrorMessage();
|
||||
|
||||
|
|
|
@ -553,7 +553,7 @@ typedef struct {
|
|||
* for each part.
|
||||
*/
|
||||
|
||||
#define DART_FLAGS_CURRENT_VERSION (0x00000007)
|
||||
#define DART_FLAGS_CURRENT_VERSION (0x00000008)
|
||||
|
||||
typedef struct {
|
||||
int32_t version;
|
||||
|
@ -563,7 +563,6 @@ typedef struct {
|
|||
bool enable_error_on_bad_override;
|
||||
bool use_field_guards;
|
||||
bool use_osr;
|
||||
bool use_dart_frontend;
|
||||
bool obfuscate;
|
||||
Dart_QualifiedFunctionName* entry_points;
|
||||
bool load_vmservice_library;
|
||||
|
|
|
@ -356,7 +356,10 @@ static RawInstance* CreateLibraryMirror(Thread* thread, const Library& lib) {
|
|||
args.SetAt(1, str);
|
||||
str = lib.url();
|
||||
const char* censored_libraries[] = {
|
||||
"dart:_builtin", "dart:_vmservice", NULL,
|
||||
"dart:_builtin",
|
||||
"dart:_vmservice",
|
||||
"dart:vmservice_io",
|
||||
NULL,
|
||||
};
|
||||
for (intptr_t i = 0; censored_libraries[i] != NULL; i++) {
|
||||
if (str.Equals(censored_libraries[i])) {
|
||||
|
|
|
@ -3534,6 +3534,10 @@ class Script extends HeapObject implements M.Script {
|
|||
ScriptLine getLine(int line) {
|
||||
assert(_loaded);
|
||||
assert(line >= 1);
|
||||
var index = (line - lineOffset - 1);
|
||||
if (lines.length < index) {
|
||||
return null;
|
||||
}
|
||||
return lines[line - lineOffset - 1];
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,6 @@ using dart::bin::File;
|
|||
|
||||
namespace dart {
|
||||
|
||||
DECLARE_FLAG(bool, use_dart_frontend);
|
||||
DECLARE_FLAG(bool, strong);
|
||||
|
||||
Benchmark* Benchmark::first_ = NULL;
|
||||
Benchmark* Benchmark::tail_ = NULL;
|
||||
const char* Benchmark::executable_ = NULL;
|
||||
|
|
|
@ -42,8 +42,7 @@ intptr_t MethodRecognizer::ResultCid(const Function& function) {
|
|||
Library& lib = Thread::Current()->LibraryHandle();
|
||||
cls = function.Owner();
|
||||
lib = cls.library();
|
||||
const bool can_use_pragma =
|
||||
function.kernel_offset() > 0 && lib.IsAnyCoreLibrary();
|
||||
const bool can_use_pragma = lib.IsAnyCoreLibrary();
|
||||
cls = Class::null();
|
||||
if (can_use_pragma) {
|
||||
Isolate* I = Isolate::Current();
|
||||
|
|
|
@ -1163,13 +1163,6 @@ Dart_CreateIsolateFromKernel(const char* script_uri,
|
|||
void* callback_data,
|
||||
char** error) {
|
||||
API_TIMELINE_DURATION(Thread::Current());
|
||||
// Setup default flags in case none were passed.
|
||||
Dart_IsolateFlags api_flags;
|
||||
if (flags == NULL) {
|
||||
Isolate::FlagsInitialize(&api_flags);
|
||||
flags = &api_flags;
|
||||
}
|
||||
flags->use_dart_frontend = true;
|
||||
return CreateIsolate(script_uri, main, NULL, NULL, NULL, NULL, kernel_buffer,
|
||||
kernel_buffer_size, flags, callback_data, error);
|
||||
}
|
||||
|
@ -4982,61 +4975,7 @@ DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url,
|
|||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
return Api::NewError("%s: Cannot compile on an AOT runtime.", CURRENT_FUNC);
|
||||
#else
|
||||
DARTSCOPE(Thread::Current());
|
||||
API_TIMELINE_DURATION(T);
|
||||
Isolate* I = T->isolate();
|
||||
const String& url_str = Api::UnwrapStringHandle(Z, url);
|
||||
if (url_str.IsNull()) {
|
||||
RETURN_TYPE_ERROR(Z, url, String);
|
||||
}
|
||||
if (::Dart_IsNull(resolved_url)) {
|
||||
resolved_url = url;
|
||||
}
|
||||
const String& resolved_url_str = Api::UnwrapStringHandle(Z, resolved_url);
|
||||
if (resolved_url_str.IsNull()) {
|
||||
RETURN_TYPE_ERROR(Z, resolved_url, String);
|
||||
}
|
||||
Library& library = Library::Handle(Z, I->object_store()->root_library());
|
||||
if (!library.IsNull()) {
|
||||
const String& library_url = String::Handle(Z, library.url());
|
||||
return Api::NewError("%s: A script has already been loaded from '%s'.",
|
||||
CURRENT_FUNC, library_url.ToCString());
|
||||
}
|
||||
if (line_offset < 0) {
|
||||
return Api::NewError("%s: argument 'line_offset' must be positive number",
|
||||
CURRENT_FUNC);
|
||||
}
|
||||
if (column_offset < 0) {
|
||||
return Api::NewError("%s: argument 'column_offset' must be positive number",
|
||||
CURRENT_FUNC);
|
||||
}
|
||||
CHECK_CALLBACK_STATE(T);
|
||||
CHECK_COMPILATION_ALLOWED(I);
|
||||
|
||||
Dart_Handle result;
|
||||
if (I->use_dart_frontend()) {
|
||||
return Api::NewError("%s: Should not be called with using Dart frontend",
|
||||
CURRENT_FUNC);
|
||||
}
|
||||
|
||||
const String& source_str = Api::UnwrapStringHandle(Z, source);
|
||||
if (source_str.IsNull()) {
|
||||
RETURN_TYPE_ERROR(Z, source, String);
|
||||
}
|
||||
|
||||
NoHeapGrowthControlScope no_growth_control;
|
||||
|
||||
library = Library::New(url_str);
|
||||
library.set_debuggable(true);
|
||||
library.Register(T);
|
||||
I->object_store()->set_root_library(library);
|
||||
|
||||
const Script& script =
|
||||
Script::Handle(Z, Script::New(url_str, resolved_url_str, source_str,
|
||||
RawScript::kScriptTag));
|
||||
script.SetLocationOffset(line_offset, column_offset);
|
||||
CompileSource(T, library, script, &result);
|
||||
return result;
|
||||
return Api::NewError("%s: Should not be called in Dart 2", CURRENT_FUNC);
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
}
|
||||
|
||||
|
@ -5292,73 +5231,7 @@ DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url,
|
|||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
return Api::NewError("%s: Cannot compile on an AOT runtime.", CURRENT_FUNC);
|
||||
#else
|
||||
DARTSCOPE(Thread::Current());
|
||||
API_TIMELINE_DURATION(T);
|
||||
Isolate* I = T->isolate();
|
||||
|
||||
const String& url_str = Api::UnwrapStringHandle(Z, url);
|
||||
if (url_str.IsNull()) {
|
||||
RETURN_TYPE_ERROR(Z, url, String);
|
||||
}
|
||||
Dart_Handle result;
|
||||
if (I->use_dart_frontend()) {
|
||||
return Api::NewError("%s: Should not be called with using Dart frontend",
|
||||
CURRENT_FUNC);
|
||||
}
|
||||
if (::Dart_IsNull(resolved_url)) {
|
||||
resolved_url = url;
|
||||
}
|
||||
const String& resolved_url_str = Api::UnwrapStringHandle(Z, resolved_url);
|
||||
if (resolved_url_str.IsNull()) {
|
||||
RETURN_TYPE_ERROR(Z, resolved_url, String);
|
||||
}
|
||||
const String& source_str = Api::UnwrapStringHandle(Z, source);
|
||||
if (source_str.IsNull()) {
|
||||
RETURN_TYPE_ERROR(Z, source, String);
|
||||
}
|
||||
if (line_offset < 0) {
|
||||
return Api::NewError("%s: argument 'line_offset' must be positive number",
|
||||
CURRENT_FUNC);
|
||||
}
|
||||
if (column_offset < 0) {
|
||||
return Api::NewError("%s: argument 'column_offset' must be positive number",
|
||||
CURRENT_FUNC);
|
||||
}
|
||||
CHECK_CALLBACK_STATE(T);
|
||||
CHECK_COMPILATION_ALLOWED(I);
|
||||
|
||||
NoHeapGrowthControlScope no_growth_control;
|
||||
|
||||
Library& library = Library::Handle(Z, Library::LookupLibrary(T, url_str));
|
||||
if (library.IsNull()) {
|
||||
library = Library::New(url_str);
|
||||
library.Register(T);
|
||||
} else if (library.LoadInProgress() || library.Loaded() ||
|
||||
library.LoadFailed()) {
|
||||
// The source for this library has either been loaded or is in the
|
||||
// process of loading. Return an error.
|
||||
return Api::NewError("%s: library '%s' has already been loaded.",
|
||||
CURRENT_FUNC, url_str.ToCString());
|
||||
}
|
||||
const Script& script =
|
||||
Script::Handle(Z, Script::New(url_str, resolved_url_str, source_str,
|
||||
RawScript::kLibraryTag));
|
||||
script.SetLocationOffset(line_offset, column_offset);
|
||||
CompileSource(T, library, script, &result);
|
||||
// Propagate the error out right now.
|
||||
if (::Dart_IsError(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// If this is the dart:_builtin library, register it with the VM.
|
||||
if (url_str.Equals("dart:_builtin")) {
|
||||
I->object_store()->set_builtin_library(library);
|
||||
Dart_Handle state = Api::CheckAndFinalizePendingClasses(T);
|
||||
if (::Dart_IsError(state)) {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return Api::NewError("%s: Should not be called in Dart 2", CURRENT_FUNC);
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME)
|
||||
}
|
||||
|
||||
|
|
|
@ -3593,7 +3593,6 @@ VM_UNIT_TEST_CASE(DartAPI_IsolateSetCheckedMode) {
|
|||
api_flags.enable_asserts = true;
|
||||
api_flags.enable_error_on_bad_type = true;
|
||||
api_flags.enable_error_on_bad_override = true;
|
||||
api_flags.use_dart_frontend = FLAG_use_dart_frontend;
|
||||
char* err;
|
||||
Dart_Isolate isolate =
|
||||
Dart_CreateIsolate(NULL, NULL, bin::core_isolate_snapshot_data,
|
||||
|
@ -5746,6 +5745,9 @@ static Dart_Handle library_handler(Dart_LibraryTag tag,
|
|||
}
|
||||
|
||||
TEST_CASE(DartAPI_LoadScript) {
|
||||
if (FLAG_use_dart_frontend) {
|
||||
return;
|
||||
}
|
||||
const char* kScriptChars =
|
||||
"main() {"
|
||||
" return 12345;"
|
||||
|
@ -6732,13 +6734,10 @@ TEST_CASE(DartAPI_ImportLibrary3) {
|
|||
int sourcefiles_count = sizeof(sourcefiles) / sizeof(Dart_SourceFile);
|
||||
lib = TestCase::LoadTestScriptWithDFE(sourcefiles_count, sourcefiles, NULL,
|
||||
true);
|
||||
if (TestCase::UsingStrongMode()) {
|
||||
EXPECT_ERROR(lib,
|
||||
"Compilation failed file:///test-lib:4:10:"
|
||||
" Error: Setter not found: 'foo'");
|
||||
return;
|
||||
}
|
||||
EXPECT_VALID(lib);
|
||||
EXPECT_ERROR(lib,
|
||||
"Compilation failed file:///test-lib:4:10:"
|
||||
" Error: Setter not found: 'foo'");
|
||||
return;
|
||||
} else {
|
||||
Dart_Handle url = NewString(TestCase::url());
|
||||
Dart_Handle source = NewString(kScriptChars);
|
||||
|
|
|
@ -2876,17 +2876,9 @@ bool Debugger::FindBestFit(const Script& script,
|
|||
|
||||
bool has_func_literal_initializer = false;
|
||||
#ifndef DART_PRECOMPILED_RUNTIME
|
||||
if (isolate_->use_dart_frontend()) {
|
||||
has_func_literal_initializer =
|
||||
kernel::FieldHasFunctionLiteralInitializer(field, &start, &end);
|
||||
} else {
|
||||
has_func_literal_initializer =
|
||||
kernel::FieldHasFunctionLiteralInitializer(field, &start, &end);
|
||||
#endif // !DART_PRECOMPILED_RUNTIME
|
||||
has_func_literal_initializer =
|
||||
Parser::FieldHasFunctionLiteralInitializer(field, &start, &end);
|
||||
#ifndef DART_PRECOMPILED_RUNTIME
|
||||
}
|
||||
#endif // !DART_PRECOMPILED_RUNTIME
|
||||
|
||||
if (has_func_literal_initializer) {
|
||||
if ((start <= token_pos && token_pos <= end) ||
|
||||
(token_pos <= start && start <= last_token_pos)) {
|
||||
|
|
|
@ -775,7 +775,6 @@ void Isolate::FlagsInitialize(Dart_IsolateFlags* api_flags) {
|
|||
api_flags->isolate_flag = flag;
|
||||
ISOLATE_FLAG_LIST(INIT_FROM_FLAG)
|
||||
#undef INIT_FROM_FLAG
|
||||
api_flags->use_dart_frontend = false;
|
||||
api_flags->entry_points = NULL;
|
||||
api_flags->load_vmservice_library = false;
|
||||
}
|
||||
|
@ -786,7 +785,6 @@ void Isolate::FlagsCopyTo(Dart_IsolateFlags* api_flags) const {
|
|||
api_flags->isolate_flag = name();
|
||||
ISOLATE_FLAG_LIST(INIT_FROM_FIELD)
|
||||
#undef INIT_FROM_FIELD
|
||||
api_flags->use_dart_frontend = use_dart_frontend();
|
||||
api_flags->entry_points = NULL;
|
||||
api_flags->load_vmservice_library = should_load_vmservice();
|
||||
}
|
||||
|
@ -817,7 +815,6 @@ void Isolate::FlagsCopyFrom(const Dart_IsolateFlags& api_flags) {
|
|||
#undef FLAG_FOR_PRODUCT
|
||||
#undef SET_FROM_FLAG
|
||||
|
||||
set_use_dart_frontend(api_flags.use_dart_frontend);
|
||||
set_should_load_vmservice(api_flags.load_vmservice_library);
|
||||
|
||||
// Copy entry points list.
|
||||
|
|
|
@ -557,13 +557,6 @@ class Isolate : public BaseIsolate {
|
|||
}
|
||||
#endif // !defined(PRODUCT)
|
||||
|
||||
bool use_dart_frontend() const {
|
||||
return UseDartFrontEndBit::decode(isolate_flags_);
|
||||
}
|
||||
void set_use_dart_frontend(bool value) {
|
||||
isolate_flags_ = UseDartFrontEndBit::update(value, isolate_flags_);
|
||||
}
|
||||
|
||||
RawError* PausePostRequest();
|
||||
|
||||
uword user_tag() const { return user_tag_; }
|
||||
|
@ -886,7 +879,6 @@ class Isolate : public BaseIsolate {
|
|||
V(ResumeRequest) \
|
||||
V(HasAttemptedReload) \
|
||||
V(ShouldPausePostServiceRequest) \
|
||||
V(UseDartFrontEnd) \
|
||||
V(EnableTypeChecks) \
|
||||
V(EnableAsserts) \
|
||||
V(ErrorOnBadType) \
|
||||
|
|
|
@ -600,7 +600,7 @@ void IsolateReloadContext::Reload(bool force_reload,
|
|||
|
||||
bool did_kernel_compilation = false;
|
||||
bool skip_reload = false;
|
||||
if (isolate()->use_dart_frontend()) {
|
||||
{
|
||||
// Load the kernel program and figure out the modified libraries.
|
||||
const GrowableObjectArray& libs =
|
||||
GrowableObjectArray::Handle(object_store()->libraries());
|
||||
|
@ -671,10 +671,6 @@ void IsolateReloadContext::Reload(bool force_reload,
|
|||
|
||||
kernel::KernelLoader::FindModifiedLibraries(
|
||||
kernel_program.get(), I, modified_libs_, force_reload, &skip_reload);
|
||||
} else {
|
||||
// Check to see which libraries have been modified.
|
||||
modified_libs_ = FindModifiedLibraries(force_reload, root_lib_modified);
|
||||
skip_reload = !modified_libs_->Contains(old_root_lib.index());
|
||||
}
|
||||
if (skip_reload) {
|
||||
ASSERT(modified_libs_->IsEmpty());
|
||||
|
@ -687,7 +683,7 @@ void IsolateReloadContext::Reload(bool force_reload,
|
|||
// If we use the CFE and performed a compilation, we need to notify that
|
||||
// we have accepted the compilation to clear some state in the incremental
|
||||
// compiler.
|
||||
if (isolate()->use_dart_frontend() && did_kernel_compilation) {
|
||||
if (did_kernel_compilation) {
|
||||
AcceptCompilation(thread);
|
||||
}
|
||||
TIR_Print("---- SKIPPING RELOAD (No libraries were modified)\n");
|
||||
|
@ -741,7 +737,7 @@ void IsolateReloadContext::Reload(bool force_reload,
|
|||
// for example, top level parse errors. We want to capture these errors while
|
||||
// propagating the UnwindError or an UnhandledException error.
|
||||
|
||||
if (isolate()->use_dart_frontend()) {
|
||||
{
|
||||
const Object& tmp =
|
||||
kernel::KernelLoader::LoadEntireProgram(kernel_program.get());
|
||||
if (!tmp.IsError()) {
|
||||
|
@ -766,16 +762,6 @@ void IsolateReloadContext::Reload(bool force_reload,
|
|||
} else {
|
||||
result = tmp.raw();
|
||||
}
|
||||
} else {
|
||||
TIR_Print("---- ENTERING TAG HANDLER\n");
|
||||
TransitionVMToNative transition(thread);
|
||||
Api::Scope api_scope(thread);
|
||||
|
||||
Dart_Handle retval = (I->library_tag_handler())(
|
||||
Dart_kScriptTag, Api::NewHandle(thread, packages_url.raw()),
|
||||
Api::NewHandle(thread, root_lib_url.raw()));
|
||||
result = Api::UnwrapHandle(retval);
|
||||
TIR_Print("---- EXITED TAG HANDLER\n");
|
||||
}
|
||||
//
|
||||
// WEIRD CONTROL FLOW ENDS.
|
||||
|
|
|
@ -1170,7 +1170,7 @@ TEST_CASE(IsolateReload_LibraryShow) {
|
|||
"}\n";
|
||||
|
||||
lib = TestCase::ReloadTestScript(kReloadScript);
|
||||
if (TestCase::UsingDartFrontend() && TestCase::UsingStrongMode()) {
|
||||
if (TestCase::UsingDartFrontend()) {
|
||||
EXPECT_ERROR(lib, "importedIntFunc");
|
||||
} else {
|
||||
EXPECT_VALID(lib);
|
||||
|
@ -1703,32 +1703,10 @@ TEST_CASE(IsolateReload_TearOff_Parameter_Count_Mismatch) {
|
|||
Dart_Handle error_handle = SimpleInvokeError(lib, "main");
|
||||
|
||||
const char* error;
|
||||
if (TestCase::UsingStrongMode()) {
|
||||
error =
|
||||
"file:///test-lib:8:12: Error: Too few positional"
|
||||
" arguments: 1 required, 0 given.\n"
|
||||
" return f1();";
|
||||
} else if (TestCase::UsingDartFrontend()) {
|
||||
error =
|
||||
"NoSuchMethodError: Closure call with mismatched arguments: function "
|
||||
"'C.foo'\n"
|
||||
"Receiver: Closure: (dynamic) => dynamic from Function 'foo': static.\n"
|
||||
"Tried calling: C.foo()\n"
|
||||
"Found: C.foo(dynamic) => dynamic\n"
|
||||
"#0 Object.noSuchMethod "
|
||||
"(dart:core/runtime/libobject_patch.dart:50:5)\n"
|
||||
"#1 main (file:///test-lib:8:12)";
|
||||
} else {
|
||||
error =
|
||||
"NoSuchMethodError: Closure call with mismatched arguments: function "
|
||||
"'C.foo'\n"
|
||||
"Receiver: Closure: (dynamic) => dynamic from Function 'foo': static.\n"
|
||||
"Tried calling: C.foo()\n"
|
||||
"Found: C.foo(dynamic) => dynamic\n"
|
||||
"#0 Object.noSuchMethod "
|
||||
"(dart:core-patch/dart:core/object_patch.dart:50)\n"
|
||||
"#1 main (test-lib:8:12)";
|
||||
}
|
||||
error =
|
||||
"file:///test-lib:8:12: Error: Too few positional"
|
||||
" arguments: 1 required, 0 given.\n"
|
||||
" return f1();";
|
||||
EXPECT_ERROR(error_handle, error);
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,6 @@ class RunKernelTask : public ThreadPool::Task {
|
|||
api_flags.enable_asserts = false;
|
||||
api_flags.enable_error_on_bad_type = false;
|
||||
api_flags.enable_error_on_bad_override = false;
|
||||
api_flags.use_dart_frontend = true;
|
||||
api_flags.unsafe_trust_strong_mode_types = false;
|
||||
#if !defined(DART_PRECOMPILER) && !defined(TARGET_ARCH_DBC)
|
||||
api_flags.use_field_guards = true;
|
||||
|
|
|
@ -3216,7 +3216,6 @@ ISOLATE_UNIT_TEST_CASE(ArrayNew_Overflow_Crash) {
|
|||
}
|
||||
|
||||
TEST_CASE(StackTraceFormat) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
const char* kScriptChars =
|
||||
"void baz() {\n"
|
||||
" throw 'MyException';\n"
|
||||
|
@ -3260,8 +3259,7 @@ TEST_CASE(StackTraceFormat) {
|
|||
EXPECT_VALID(lib);
|
||||
Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
|
||||
|
||||
const char* lib_url =
|
||||
isolate->use_dart_frontend() ? "file:///test-lib" : "test-lib";
|
||||
const char* lib_url = "file:///test-lib";
|
||||
const size_t kBufferSize = 1024;
|
||||
char expected[kBufferSize];
|
||||
snprintf(expected, kBufferSize,
|
||||
|
|
|
@ -47,8 +47,6 @@ DEFINE_FLAG(bool,
|
|||
true,
|
||||
"Parse scripts with Dart-to-Kernel parser");
|
||||
|
||||
DECLARE_FLAG(bool, strong);
|
||||
|
||||
void KernelBufferList::AddBufferToList(const uint8_t* kernel_buffer) {
|
||||
next_ = new KernelBufferList(kernel_buffer_, next_);
|
||||
kernel_buffer_ = kernel_buffer;
|
||||
|
@ -114,7 +112,6 @@ Dart_Isolate TestCase::CreateIsolate(const uint8_t* data_buffer,
|
|||
char* err;
|
||||
Dart_IsolateFlags api_flags;
|
||||
Isolate::FlagsInitialize(&api_flags);
|
||||
api_flags.use_dart_frontend = FLAG_use_dart_frontend;
|
||||
Dart_Isolate isolate = NULL;
|
||||
if (len == 0) {
|
||||
isolate = Dart_CreateIsolate(name, NULL, data_buffer, instr_buffer, NULL,
|
||||
|
@ -132,16 +129,9 @@ Dart_Isolate TestCase::CreateIsolate(const uint8_t* data_buffer,
|
|||
}
|
||||
|
||||
Dart_Isolate TestCase::CreateTestIsolate(const char* name, void* data) {
|
||||
if (FLAG_use_dart_frontend) {
|
||||
return CreateIsolate(
|
||||
platform_strong_dill, platform_strong_dill_size,
|
||||
NULL, /* There is no instr buffer in case of dill buffers. */
|
||||
name, data);
|
||||
} else {
|
||||
return CreateIsolate(bin::core_isolate_snapshot_data,
|
||||
0 /* Snapshots have length encoded within them. */,
|
||||
bin::core_isolate_snapshot_instructions, name, data);
|
||||
}
|
||||
return CreateIsolate(bin::core_isolate_snapshot_data,
|
||||
0 /* Snapshots have length encoded within them. */,
|
||||
bin::core_isolate_snapshot_instructions, name, data);
|
||||
}
|
||||
|
||||
static const char* kPackageScheme = "package:";
|
||||
|
@ -249,10 +239,6 @@ bool TestCase::UsingDartFrontend() {
|
|||
return FLAG_use_dart_frontend;
|
||||
}
|
||||
|
||||
bool TestCase::UsingStrongMode() {
|
||||
return FLAG_strong;
|
||||
}
|
||||
|
||||
char* TestCase::CompileTestScriptWithDFE(const char* url,
|
||||
const char* source,
|
||||
const uint8_t** kernel_buffer,
|
||||
|
|
|
@ -272,9 +272,7 @@ extern const uint8_t* core_isolate_snapshot_data;
|
|||
extern const uint8_t* core_isolate_snapshot_instructions;
|
||||
} // namespace bin
|
||||
|
||||
extern const uint8_t* platform_dill;
|
||||
extern const uint8_t* platform_strong_dill;
|
||||
extern const intptr_t platform_dill_size;
|
||||
extern const intptr_t platform_strong_dill_size;
|
||||
|
||||
class TesterState : public AllStatic {
|
||||
|
@ -347,7 +345,6 @@ class TestCase : TestCaseBase {
|
|||
TestCase(RunEntry* run, const char* name) : TestCaseBase(name), run_(run) {}
|
||||
|
||||
static bool UsingDartFrontend();
|
||||
static bool UsingStrongMode();
|
||||
|
||||
static char* CompileTestScriptWithDFE(const char* url,
|
||||
const char* source,
|
||||
|
|
Loading…
Reference in a new issue