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

Side by Side Diff: src/vm/session.cc

Issue 2067483002: More compact snapshots. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Feedback Created 4 years, 6 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 | « src/vm/program.cc ('k') | src/vm/snapshot.h » ('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) 2014, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dartino 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #ifdef DARTINO_ENABLE_DEBUGGING 5 #ifdef DARTINO_ENABLE_DEBUGGING
6 6
7 #include "src/vm/session.h" 7 #include "src/vm/session.h"
8 8
9 #include "src/shared/bytecodes.h" 9 #include "src/shared/bytecodes.h"
10 #include "src/shared/connection.h" 10 #include "src/shared/connection.h"
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 const char* path, 1523 const char* path,
1524 FunctionOffsetsType* function_offsets, 1524 FunctionOffsetsType* function_offsets,
1525 ClassOffsetsType* class_offsets) { 1525 ClassOffsetsType* class_offsets) {
1526 // Make sure that the program is in the compact form before 1526 // Make sure that the program is in the compact form before
1527 // snapshotting. 1527 // snapshotting.
1528 if (!program()->is_optimized()) { 1528 if (!program()->is_optimized()) {
1529 ProgramFolder program_folder(program()); 1529 ProgramFolder program_folder(program());
1530 program_folder.Fold(); 1530 program_folder.Fold();
1531 } 1531 }
1532 1532
1533 program()->VerifyObjectPlacements();
1534
1533 SnapshotWriter writer(function_offsets, class_offsets); 1535 SnapshotWriter writer(function_offsets, class_offsets);
1534 List<uint8> snapshot = writer.WriteProgram(program()); 1536 List<uint8> snapshot = writer.WriteProgram(program());
1535 bool success = writeToDisk 1537 bool success = writeToDisk
1536 ? Platform::StoreFile(path, snapshot) 1538 ? Platform::StoreFile(path, snapshot)
1537 : true; 1539 : true;
1538 snapshot.Delete(); 1540 snapshot.Delete();
1539 return success; 1541 return success;
1540 } 1542 }
1541 1543
1542 void Session::NewMap(int map_index) { 1544 void Session::NewMap(int map_index) {
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 if (program()->was_loaded_from_snapshot()) { 2254 if (program()->was_loaded_from_snapshot()) {
2253 return program()->OffsetOf(HeapObject::cast(klass)); 2255 return program()->OffsetOf(HeapObject::cast(klass));
2254 } else { 2256 } else {
2255 return MapLookupByObject(class_map_id_, klass); 2257 return MapLookupByObject(class_map_id_, klass);
2256 } 2258 }
2257 } 2259 }
2258 2260
2259 } // namespace dartino 2261 } // namespace dartino
2260 2262
2261 #endif // DARTINO_ENABLE_DEBUGGING 2263 #endif // DARTINO_ENABLE_DEBUGGING
OLDNEW
« no previous file with comments | « src/vm/program.cc ('k') | src/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698