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

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

Issue 429013002: Make Dart_LoadLibrary and Dart_LoadSource take line and column offsets like Dart_LoadScript. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/unit_test.cc » ('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_debugger_api.h" 7 #include "include/dart_debugger_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 } 1198 }
1199 1199
1200 { 1200 {
1201 // Create an Isolate using the full snapshot, load a script and create 1201 // Create an Isolate using the full snapshot, load a script and create
1202 // a script snapshot of the script. 1202 // a script snapshot of the script.
1203 TestCase::CreateTestIsolateFromSnapshot(full_snapshot); 1203 TestCase::CreateTestIsolateFromSnapshot(full_snapshot);
1204 Dart_EnterScope(); // Start a Dart API scope for invoking API functions. 1204 Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
1205 1205
1206 // Load the library. 1206 // Load the library.
1207 Dart_Handle import_lib = Dart_LoadLibrary(NewString("dart_import_lib"), 1207 Dart_Handle import_lib = Dart_LoadLibrary(NewString("dart_import_lib"),
1208 NewString(kLibScriptChars)); 1208 NewString(kLibScriptChars),
1209 0, 0);
1209 EXPECT_VALID(import_lib); 1210 EXPECT_VALID(import_lib);
1210 1211
1211 // Create a test library and Load up a test script in it. 1212 // Create a test library and Load up a test script in it.
1212 TestCase::LoadTestScript(kScriptChars, NULL); 1213 TestCase::LoadTestScript(kScriptChars, NULL);
1213 1214
1214 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(), 1215 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(),
1215 import_lib, 1216 import_lib,
1216 Dart_Null())); 1217 Dart_Null()));
1217 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(Isolate::Current())); 1218 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(Isolate::Current()));
1218 1219
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 } 1369 }
1369 1370
1370 { 1371 {
1371 // Create an Isolate using the full snapshot, load a script and create 1372 // Create an Isolate using the full snapshot, load a script and create
1372 // a script snapshot of the script. 1373 // a script snapshot of the script.
1373 TestCase::CreateTestIsolateFromSnapshot(full_snapshot); 1374 TestCase::CreateTestIsolateFromSnapshot(full_snapshot);
1374 Dart_EnterScope(); // Start a Dart API scope for invoking API functions. 1375 Dart_EnterScope(); // Start a Dart API scope for invoking API functions.
1375 1376
1376 // Load the library. 1377 // Load the library.
1377 Dart_Handle import_lib = Dart_LoadLibrary(NewString("dart_import_lib"), 1378 Dart_Handle import_lib = Dart_LoadLibrary(NewString("dart_import_lib"),
1378 NewString(kLibScriptChars)); 1379 NewString(kLibScriptChars),
1380 0, 0);
1379 EXPECT_VALID(import_lib); 1381 EXPECT_VALID(import_lib);
1380 1382
1381 // Create a test library and Load up a test script in it. 1383 // Create a test library and Load up a test script in it.
1382 TestCase::LoadTestScript(kScriptChars, NULL); 1384 TestCase::LoadTestScript(kScriptChars, NULL);
1383 1385
1384 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(), 1386 EXPECT_VALID(Dart_LibraryImportLibrary(TestCase::lib(),
1385 import_lib, 1387 import_lib,
1386 Dart_Null())); 1388 Dart_Null()));
1387 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(Isolate::Current())); 1389 EXPECT_VALID(Api::CheckAndFinalizePendingClasses(Isolate::Current()));
1388 1390
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after
2722 StackZone zone(Isolate::Current()); 2724 StackZone zone(Isolate::Current());
2723 uint8_t* buffer; 2725 uint8_t* buffer;
2724 MessageWriter writer(&buffer, &zone_allocator); 2726 MessageWriter writer(&buffer, &zone_allocator);
2725 writer.WriteInlinedObjectHeader(kOmittedObjectId); 2727 writer.WriteInlinedObjectHeader(kOmittedObjectId);
2726 // For performance, we'd like single-byte headers when ids are omitted. 2728 // For performance, we'd like single-byte headers when ids are omitted.
2727 // If this starts failing, consider renumbering the snapshot ids. 2729 // If this starts failing, consider renumbering the snapshot ids.
2728 EXPECT_EQ(1, writer.BytesWritten()); 2730 EXPECT_EQ(1, writer.BytesWritten());
2729 } 2731 }
2730 2732
2731 } // namespace dart 2733 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698