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

Unified Diff: runtime/vm/benchmark_test.cc

Issue 2622053002: Refactor snapshots pieces to include a section for loading instructions into the heap of a regular … (Closed)
Patch Set: . Created 3 years, 11 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/benchmark_test.h ('k') | runtime/vm/clustered_snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/benchmark_test.cc
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index efe1223e82132d0ba46e666154bae3b4acc910a0..4b34e20abcbb564c5b5f1a1b890bbe99bf0e245f 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -95,9 +95,11 @@ void Benchmark::RunAll(const char* executable) {
}
-Dart_Isolate Benchmark::CreateIsolate(const uint8_t* buffer) {
+Dart_Isolate Benchmark::CreateIsolate(const uint8_t* snapshot_data,
+ const uint8_t* snapshot_instructions) {
char* err = NULL;
- isolate_ = Dart_CreateIsolate(NULL, NULL, buffer, NULL, NULL, &err);
+ isolate_ = Dart_CreateIsolate(NULL, NULL, snapshot_data,
+ snapshot_instructions, NULL, NULL, &err);
EXPECT(isolate_ != NULL);
free(err);
return isolate_;
@@ -509,24 +511,25 @@ BENCHMARK_SIZE(CoreSnapshotSize) {
"\n";
// Start an Isolate, load a script and create a full snapshot.
- uint8_t* vm_isolate_snapshot_buffer;
- uint8_t* isolate_snapshot_buffer;
+ uint8_t* vm_snapshot_data_buffer;
+ uint8_t* isolate_snapshot_data_buffer;
// Need to load the script into the dart: core library due to
// the import of dart:_internal.
TestCase::LoadCoreTestScript(kScriptChars, NULL);
Api::CheckAndFinalizePendingClasses(thread);
// Write snapshot with object content.
- FullSnapshotWriter writer(Snapshot::kCore, &vm_isolate_snapshot_buffer,
- &isolate_snapshot_buffer, &malloc_allocator,
- NULL /* instructions_writer */);
+ FullSnapshotWriter writer(Snapshot::kCore, &vm_snapshot_data_buffer,
+ &isolate_snapshot_data_buffer, &malloc_allocator,
+ NULL, NULL /* instructions_writer */);
writer.WriteFullSnapshot();
- const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer);
+ const Snapshot* snapshot =
+ Snapshot::SetupFromBuffer(isolate_snapshot_data_buffer);
ASSERT(snapshot->kind() == Snapshot::kCore);
benchmark->set_score(snapshot->length());
- free(vm_isolate_snapshot_buffer);
- free(isolate_snapshot_buffer);
+ free(vm_snapshot_data_buffer);
+ free(isolate_snapshot_data_buffer);
}
@@ -546,24 +549,25 @@ BENCHMARK_SIZE(StandaloneSnapshotSize) {
"\n";
// Start an Isolate, load a script and create a full snapshot.
- uint8_t* vm_isolate_snapshot_buffer;
- uint8_t* isolate_snapshot_buffer;
+ uint8_t* vm_snapshot_data_buffer;
+ uint8_t* isolate_snapshot_data_buffer;
// Need to load the script into the dart: core library due to
// the import of dart:_internal.
TestCase::LoadCoreTestScript(kScriptChars, NULL);
Api::CheckAndFinalizePendingClasses(thread);
// Write snapshot with object content.
- FullSnapshotWriter writer(Snapshot::kCore, &vm_isolate_snapshot_buffer,
- &isolate_snapshot_buffer, &malloc_allocator,
- NULL /* instructions_writer */);
+ FullSnapshotWriter writer(Snapshot::kCore, &vm_snapshot_data_buffer,
+ &isolate_snapshot_data_buffer, &malloc_allocator,
+ NULL, NULL /* instructions_writer */);
writer.WriteFullSnapshot();
- const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer);
+ const Snapshot* snapshot =
+ Snapshot::SetupFromBuffer(isolate_snapshot_data_buffer);
ASSERT(snapshot->kind() == Snapshot::kCore);
benchmark->set_score(snapshot->length());
- free(vm_isolate_snapshot_buffer);
- free(isolate_snapshot_buffer);
+ free(vm_snapshot_data_buffer);
+ free(isolate_snapshot_data_buffer);
}
« no previous file with comments | « runtime/vm/benchmark_test.h ('k') | runtime/vm/clustered_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698