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

Unified Diff: vm/snapshot_test.cc

Issue 8673002: - Refactor the isolate callback mechanism to also include creation of the (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
« no previous file with comments | « vm/isolate_win.cc ('k') | vm/thread_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/snapshot_test.cc
===================================================================
--- vm/snapshot_test.cc (revision 1955)
+++ vm/snapshot_test.cc (working copy)
@@ -332,9 +332,8 @@
// Start an Isolate, load a script and create a full snapshot.
Timer timer1(true, "Snapshot_test");
timer1.Start();
- Dart_CreateIsolate(NULL, NULL);
{
- Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
+ TestIsolateScope __test_isolate__;
// Create a test library and Load up a test script in it.
TestCase::LoadTestScript(kScriptChars, NULL);
@@ -347,16 +346,13 @@
HandleScope scope(isolate);
SnapshotWriter writer(true, &buffer, &allocator);
writer.WriteFullSnapshot();
-
- Dart_ExitScope(); // Exit the Dart API scope.
}
- Dart_ShutdownIsolate();
// Now Create another isolate using the snapshot and execute a method
// from the script.
Timer timer2(true, "Snapshot_test");
timer2.Start();
- Dart_CreateIsolate(buffer, NULL);
+ TestCase::CreateTestIsolateFromSnapshot(buffer);
{
Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
timer2.Stop();
@@ -369,11 +365,9 @@
0,
NULL);
EXPECT_VALID(result);
-
- Dart_ExitScope(); // Exit the Dart API scope.
+ Dart_ExitScope();
}
Dart_ShutdownIsolate();
-
free(buffer);
}
@@ -392,9 +386,9 @@
// Start an Isolate, load a script and create a full snapshot.
Timer timer1(true, "Snapshot_test");
timer1.Start();
- Dart_CreateIsolate(NULL, NULL);
{
- Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
+ TestIsolateScope __test_isolate__;
+
Isolate* isolate = Isolate::Current();
Zone zone(isolate);
HandleScope scope(isolate);
@@ -416,16 +410,13 @@
0,
NULL);
EXPECT_VALID(result);
-
- Dart_ExitScope(); // Exit the Dart API scope.
}
- Dart_ShutdownIsolate();
// Now Create another isolate using the snapshot and execute a method
// from the script.
Timer timer2(true, "Snapshot_test");
timer2.Start();
- Dart_CreateIsolate(buffer, NULL);
+ TestCase::CreateTestIsolateFromSnapshot(buffer);
{
Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
timer2.Stop();
@@ -442,11 +433,9 @@
fprintf(stderr, "%s\n", Dart_GetError(result));
}
EXPECT_VALID(result);
-
- Dart_ExitScope(); // Exit the Dart API scope.
+ Dart_ExitScope();
}
Dart_ShutdownIsolate();
-
free(buffer);
}
#endif // TARGET_ARCH_IA32.
« no previous file with comments | « vm/isolate_win.cc ('k') | vm/thread_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698