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

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 1418833004: VM: Service isolate under precompilation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 5173 matching lines...) Expand 10 before | Expand all | Expand 10 after
5184 } 5184 }
5185 5185
5186 5186
5187 DART_EXPORT Dart_Handle Dart_RootLibrary() { 5187 DART_EXPORT Dart_Handle Dart_RootLibrary() {
5188 Isolate* isolate = Isolate::Current(); 5188 Isolate* isolate = Isolate::Current();
5189 CHECK_ISOLATE(isolate); 5189 CHECK_ISOLATE(isolate);
5190 return Api::NewHandle(isolate, isolate->object_store()->root_library()); 5190 return Api::NewHandle(isolate, isolate->object_store()->root_library());
5191 } 5191 }
5192 5192
5193 5193
5194 DART_EXPORT Dart_Handle Dart_SetRootLibrary(Dart_Handle library) {
5195 DARTSCOPE(Thread::Current());
5196 const Library& lib = Api::UnwrapLibraryHandle(Z, library);
5197 if (lib.IsNull()) {
5198 RETURN_TYPE_ERROR(Z, library, Library);
5199 }
5200 Isolate* isolate = Isolate::Current();
5201 isolate->object_store()->set_root_library(lib);
5202 return library;
5203 }
5204
5205
5194 DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, 5206 DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library,
5195 Dart_Handle class_name) { 5207 Dart_Handle class_name) {
5196 DARTSCOPE(Thread::Current()); 5208 DARTSCOPE(Thread::Current());
5197 const Library& lib = Api::UnwrapLibraryHandle(Z, library); 5209 const Library& lib = Api::UnwrapLibraryHandle(Z, library);
5198 if (lib.IsNull()) { 5210 if (lib.IsNull()) {
5199 RETURN_TYPE_ERROR(Z, library, Library); 5211 RETURN_TYPE_ERROR(Z, library, Library);
5200 } 5212 }
5201 const String& cls_name = Api::UnwrapStringHandle(Z, class_name); 5213 const String& cls_name = Api::UnwrapStringHandle(Z, class_name);
5202 if (cls_name.IsNull()) { 5214 if (cls_name.IsNull()) {
5203 RETURN_TYPE_ERROR(Z, class_name, String); 5215 RETURN_TYPE_ERROR(Z, class_name, String);
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
6072 ApiReallocate); 6084 ApiReallocate);
6073 writer.WriteFullSnapshot(); 6085 writer.WriteFullSnapshot();
6074 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); 6086 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
6075 *isolate_snapshot_size = writer.IsolateSnapshotSize(); 6087 *isolate_snapshot_size = writer.IsolateSnapshotSize();
6076 *instructions_snapshot_size = writer.InstructionsSnapshotSize(); 6088 *instructions_snapshot_size = writer.InstructionsSnapshotSize();
6077 6089
6078 return Api::Success(); 6090 return Api::Success();
6079 } 6091 }
6080 6092
6081 } // namespace dart 6093 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698