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

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

Issue 1915853004: Option to output precompiled instructions as a blob for use with mmap instead of assembly for use i… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | tools/testing/dart/compiler_configuration.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "include/dart_tools_api.h" 7 #include "include/dart_tools_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 // Create a test library and Load up a test script in it. 1179 // Create a test library and Load up a test script in it.
1180 TestCase::LoadTestScript(kScriptChars, NULL); 1180 TestCase::LoadTestScript(kScriptChars, NULL);
1181 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(thread)); 1181 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(thread));
1182 timer1.Stop(); 1182 timer1.Stop();
1183 OS::PrintErr("Without Snapshot: %" Pd64 "us\n", timer1.TotalElapsedTime()); 1183 OS::PrintErr("Without Snapshot: %" Pd64 "us\n", timer1.TotalElapsedTime());
1184 1184
1185 // Write snapshot with object content. 1185 // Write snapshot with object content.
1186 { 1186 {
1187 FullSnapshotWriter writer(NULL, 1187 FullSnapshotWriter writer(NULL,
1188 &isolate_snapshot_buffer, 1188 &isolate_snapshot_buffer,
1189 NULL, /* instructions_snapshot_buffer */
1190 &malloc_allocator, 1189 &malloc_allocator,
1190 NULL, /* instructions_writer */
1191 false, /* snapshot_code */ 1191 false, /* snapshot_code */
1192 true); 1192 true);
1193 writer.WriteFullSnapshot(); 1193 writer.WriteFullSnapshot();
1194 } 1194 }
1195 } 1195 }
1196 1196
1197 // Now Create another isolate using the snapshot and execute a method 1197 // Now Create another isolate using the snapshot and execute a method
1198 // from the script. 1198 // from the script.
1199 Timer timer2(true, "Snapshot_test"); 1199 Timer timer2(true, "Snapshot_test");
1200 timer2.Start(); 1200 timer2.Start();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 // Create a test library and Load up a test script in it. 1240 // Create a test library and Load up a test script in it.
1241 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); 1241 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
1242 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(thread)); 1242 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(thread));
1243 timer1.Stop(); 1243 timer1.Stop();
1244 OS::PrintErr("Without Snapshot: %" Pd64 "us\n", timer1.TotalElapsedTime()); 1244 OS::PrintErr("Without Snapshot: %" Pd64 "us\n", timer1.TotalElapsedTime());
1245 1245
1246 // Write snapshot with object content. 1246 // Write snapshot with object content.
1247 { 1247 {
1248 FullSnapshotWriter writer(NULL, 1248 FullSnapshotWriter writer(NULL,
1249 &isolate_snapshot_buffer, 1249 &isolate_snapshot_buffer,
1250 NULL, /* instructions_snapshot_buffer */
1251 &malloc_allocator, 1250 &malloc_allocator,
1251 NULL, /* instructions_writer */
1252 false, /* snapshot_code */ 1252 false, /* snapshot_code */
1253 true /* vm_isolate_is_symbolic */); 1253 true /* vm_isolate_is_symbolic */);
1254 writer.WriteFullSnapshot(); 1254 writer.WriteFullSnapshot();
1255 } 1255 }
1256 1256
1257 // Invoke a function which returns an object. 1257 // Invoke a function which returns an object.
1258 Dart_Handle cls = Dart_GetClass(lib, NewString("FieldsTest")); 1258 Dart_Handle cls = Dart_GetClass(lib, NewString("FieldsTest"));
1259 Dart_Handle result = Dart_Invoke(cls, NewString("testMain"), 0, NULL); 1259 Dart_Handle result = Dart_Invoke(cls, NewString("testMain"), 0, NULL);
1260 EXPECT_VALID(result); 1260 EXPECT_VALID(result);
1261 } 1261 }
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after
3009 StackZone zone(Thread::Current()); 3009 StackZone zone(Thread::Current());
3010 uint8_t* buffer; 3010 uint8_t* buffer;
3011 MessageWriter writer(&buffer, &zone_allocator, true); 3011 MessageWriter writer(&buffer, &zone_allocator, true);
3012 writer.WriteInlinedObjectHeader(kOmittedObjectId); 3012 writer.WriteInlinedObjectHeader(kOmittedObjectId);
3013 // For performance, we'd like single-byte headers when ids are omitted. 3013 // For performance, we'd like single-byte headers when ids are omitted.
3014 // If this starts failing, consider renumbering the snapshot ids. 3014 // If this starts failing, consider renumbering the snapshot ids.
3015 EXPECT_EQ(1, writer.BytesWritten()); 3015 EXPECT_EQ(1, writer.BytesWritten());
3016 } 3016 }
3017 3017
3018 } // namespace dart 3018 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/snapshot.cc ('k') | tools/testing/dart/compiler_configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698