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

Unified Diff: vm/dart.cc

Issue 8334031: - Fix the snapshot generation python script to return an error code when snapshot generation fail... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: vm/dart.cc
===================================================================
--- vm/dart.cc (revision 1129)
+++ vm/dart.cc (working copy)
@@ -9,6 +9,7 @@
#include "vm/handles.h"
#include "vm/heap.h"
#include "vm/isolate.h"
+#include "vm/longjump.h"
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/port.h"
@@ -51,10 +52,18 @@
}
-Isolate* Dart::CreateIsolate(const Dart_Snapshot* snapshot_buffer,
- void* data) {
+Isolate* Dart::CreateIsolate() {
// Create and initialize a new isolate.
Isolate* isolate = Isolate::Init();
+ ASSERT(isolate != NULL);
+ return isolate;
+}
+
+
+void Dart::InitializeIsolate(const Dart_Snapshot* snapshot_buffer, void* data) {
+ // Initialize the new isolate.
+ Isolate* isolate = Isolate::Current();
+ ASSERT(isolate != NULL);
Zone zone;
HandleScope handle_scope;
Heap::Init(isolate);
@@ -67,7 +76,9 @@
// of Object::Init(..) in a regular isolate creation path.
Object::InitFromSnapshot(isolate);
const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer);
- SnapshotReader reader(snapshot, isolate->heap(), isolate->object_store());
+ SnapshotReader reader(snapshot,
+ isolate->heap(),
+ isolate->object_store());
reader.ReadFullSnapshot();
}
@@ -75,12 +86,10 @@
CodeIndexTable::Init(isolate);
// Give the embedder a shot at setting up this isolate.
- // Isolates spawned from within this isolate will be given the callback data
- // returned by the callback.
+ // Isolates spawned from within this isolate will be given the
+ // callback data returned by the callback.
data = Isolate::InitCallback()(data);
- // TODO(iposva): Shutdown the isolate on failure.
isolate->set_init_callback_data(data);
- return isolate;
}

Powered by Google App Engine
This is Rietveld 408576698