| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/kernel_isolate.h" | 5 #include "vm/kernel_isolate.h" |
| 6 | 6 |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 Isolate* isolate = NULL; | 61 Isolate* isolate = NULL; |
| 62 | 62 |
| 63 Dart_IsolateCreateCallback create_callback = | 63 Dart_IsolateCreateCallback create_callback = |
| 64 KernelIsolate::create_callback(); | 64 KernelIsolate::create_callback(); |
| 65 | 65 |
| 66 if (create_callback == NULL) { | 66 if (create_callback == NULL) { |
| 67 KernelIsolate::FinishedInitializing(); | 67 KernelIsolate::FinishedInitializing(); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| 70 | 70 |
| 71 // Note: these flags must match those passed to the VM during |
| 72 // the app-jit training run (see //utils/kernel-service/BUILD.gn). |
| 71 Dart_IsolateFlags api_flags; | 73 Dart_IsolateFlags api_flags; |
| 72 api_flags.version = DART_FLAGS_CURRENT_VERSION; | 74 api_flags.version = DART_FLAGS_CURRENT_VERSION; |
| 73 api_flags.enable_type_checks = false; | 75 api_flags.enable_type_checks = false; |
| 74 api_flags.enable_asserts = false; | 76 api_flags.enable_asserts = false; |
| 75 api_flags.enable_error_on_bad_type = false; | 77 api_flags.enable_error_on_bad_type = false; |
| 76 api_flags.enable_error_on_bad_override = false; | 78 api_flags.enable_error_on_bad_override = false; |
| 79 api_flags.use_field_guards = true; |
| 77 | 80 |
| 78 isolate = reinterpret_cast<Isolate*>(create_callback( | 81 isolate = reinterpret_cast<Isolate*>(create_callback( |
| 79 KernelIsolate::kName, NULL, NULL, NULL, &api_flags, NULL, &error)); | 82 KernelIsolate::kName, NULL, NULL, NULL, &api_flags, NULL, &error)); |
| 80 if (isolate == NULL) { | 83 if (isolate == NULL) { |
| 81 OS::PrintErr(DART_KERNEL_ISOLATE_NAME ": Isolate creation error: %s\n", | 84 OS::PrintErr(DART_KERNEL_ISOLATE_NAME ": Isolate creation error: %s\n", |
| 82 error); | 85 error); |
| 83 KernelIsolate::SetKernelIsolate(NULL); | 86 KernelIsolate::SetKernelIsolate(NULL); |
| 84 KernelIsolate::FinishedInitializing(); | 87 KernelIsolate::FinishedInitializing(); |
| 85 return; | 88 return; |
| 86 } | 89 } |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 } | 440 } |
| 438 | 441 |
| 439 KernelCompilationRequest request; | 442 KernelCompilationRequest request; |
| 440 return request.SendAndWaitForResponse(kernel_port, script_uri); | 443 return request.SendAndWaitForResponse(kernel_port, script_uri); |
| 441 } | 444 } |
| 442 | 445 |
| 443 | 446 |
| 444 #endif // DART_PRECOMPILED_RUNTIME | 447 #endif // DART_PRECOMPILED_RUNTIME |
| 445 | 448 |
| 446 } // namespace dart | 449 } // namespace dart |
| OLD | NEW |