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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1023753006: First step towards splitting a full snapshot into a vm isolate snapshot and a (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 44745)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -1200,6 +1200,7 @@
}
DART_EXPORT bool Dart_Initialize(
+ const uint8_t* vm_isolate_snapshot,
Dart_IsolateCreateCallback create,
Dart_IsolateInterruptCallback interrupt,
Dart_IsolateUnhandledExceptionCallback unhandled,
@@ -1209,7 +1210,8 @@
Dart_FileWriteCallback file_write,
Dart_FileCloseCallback file_close,
Dart_EntropySource entropy_source) {
- const char* err_msg = Dart::InitOnce(create, interrupt, unhandled, shutdown,
+ const char* err_msg = Dart::InitOnce(vm_isolate_snapshot,
+ create, interrupt, unhandled, shutdown,
file_open, file_read, file_write,
file_close, entropy_source);
if (err_msg != NULL) {
@@ -1408,17 +1410,26 @@
}
-DART_EXPORT Dart_Handle Dart_CreateSnapshot(uint8_t** buffer,
- intptr_t* size) {
+DART_EXPORT Dart_Handle Dart_CreateSnapshot(
+ uint8_t** vm_isolate_snapshot_buffer,
+ intptr_t* vm_isolate_snapshot_size,
+ uint8_t** isolate_snapshot_buffer,
+ intptr_t* isolate_snapshot_size) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
TIMERSCOPE(isolate, time_creating_snapshot);
- if (buffer == NULL) {
- RETURN_NULL_ERROR(buffer);
+ if (vm_isolate_snapshot_buffer == NULL) {
+ RETURN_NULL_ERROR(vm_isolate_snapshot_buffer);
}
- if (size == NULL) {
- RETURN_NULL_ERROR(size);
+ if (vm_isolate_snapshot_size == NULL) {
+ RETURN_NULL_ERROR(vm_isolate_snapshot_size);
}
+ if (isolate_snapshot_buffer == NULL) {
+ RETURN_NULL_ERROR(isolate_snapshot_buffer);
+ }
+ if (isolate_snapshot_size == NULL) {
+ RETURN_NULL_ERROR(isolate_snapshot_size);
+ }
// Finalize all classes if needed.
Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate);
if (::Dart_IsError(state)) {
@@ -1426,9 +1437,12 @@
}
// Since this is only a snapshot the root library should not be set.
isolate->object_store()->set_root_library(Library::Handle(isolate));
- FullSnapshotWriter writer(buffer, ApiReallocate);
+ FullSnapshotWriter writer(vm_isolate_snapshot_buffer,
+ isolate_snapshot_buffer,
+ ApiReallocate);
writer.WriteFullSnapshot();
- *size = writer.BytesWritten();
+ *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
+ *isolate_snapshot_size = writer.IsolateSnapshotSize();
return Api::Success();
}
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698