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

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

Issue 2638173002: Compact the symbol table when creating core snapshots or JIT app snapshots. (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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/isolate.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 return state; 1570 return state;
1571 } 1571 }
1572 I->StopBackgroundCompiler(); 1572 I->StopBackgroundCompiler();
1573 1573
1574 #if defined(DEBUG) 1574 #if defined(DEBUG)
1575 I->heap()->CollectAllGarbage(); 1575 I->heap()->CollectAllGarbage();
1576 CheckFunctionTypesVisitor check_canonical(T); 1576 CheckFunctionTypesVisitor check_canonical(T);
1577 I->heap()->IterateObjects(&check_canonical); 1577 I->heap()->IterateObjects(&check_canonical);
1578 #endif // #if defined(DEBUG) 1578 #endif // #if defined(DEBUG)
1579 1579
1580 Symbols::Compact(I);
1581
1580 FullSnapshotWriter writer(Snapshot::kCore, vm_isolate_snapshot_buffer, 1582 FullSnapshotWriter writer(Snapshot::kCore, vm_isolate_snapshot_buffer,
1581 isolate_snapshot_buffer, ApiReallocate, 1583 isolate_snapshot_buffer, ApiReallocate,
1582 NULL /* instructions_writer */); 1584 NULL /* instructions_writer */);
1583 writer.WriteFullSnapshot(); 1585 writer.WriteFullSnapshot();
1584 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize(); 1586 *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
1585 *isolate_snapshot_size = writer.IsolateSnapshotSize(); 1587 *isolate_snapshot_size = writer.IsolateSnapshotSize();
1586 return Api::Success(); 1588 return Api::Success();
1587 } 1589 }
1588 1590
1589 1591
(...skipping 5168 matching lines...) Expand 10 before | Expand all | Expand 10 after
6758 if (rodata_blob_size == NULL) { 6760 if (rodata_blob_size == NULL) {
6759 RETURN_NULL_ERROR(instructions_blob_size); 6761 RETURN_NULL_ERROR(instructions_blob_size);
6760 } 6762 }
6761 // Finalize all classes if needed. 6763 // Finalize all classes if needed.
6762 Dart_Handle state = Api::CheckAndFinalizePendingClasses(T); 6764 Dart_Handle state = Api::CheckAndFinalizePendingClasses(T);
6763 if (::Dart_IsError(state)) { 6765 if (::Dart_IsError(state)) {
6764 return state; 6766 return state;
6765 } 6767 }
6766 I->StopBackgroundCompiler(); 6768 I->StopBackgroundCompiler();
6767 6769
6770 Symbols::Compact(I);
6771
6768 NOT_IN_PRODUCT(TimelineDurationScope tds2(T, Timeline::GetIsolateStream(), 6772 NOT_IN_PRODUCT(TimelineDurationScope tds2(T, Timeline::GetIsolateStream(),
6769 "WriteAppJITSnapshot")); 6773 "WriteAppJITSnapshot"));
6770 BlobInstructionsWriter instructions_writer(instructions_blob_buffer, 6774 BlobInstructionsWriter instructions_writer(instructions_blob_buffer,
6771 rodata_blob_buffer, ApiReallocate, 6775 rodata_blob_buffer, ApiReallocate,
6772 2 * MB /* initial_size */); 6776 2 * MB /* initial_size */);
6773 FullSnapshotWriter writer(Snapshot::kAppJIT, NULL, isolate_snapshot_buffer, 6777 FullSnapshotWriter writer(Snapshot::kAppJIT, NULL, isolate_snapshot_buffer,
6774 ApiReallocate, &instructions_writer); 6778 ApiReallocate, &instructions_writer);
6775 writer.WriteFullSnapshot(); 6779 writer.WriteFullSnapshot();
6776 *isolate_snapshot_size = writer.IsolateSnapshotSize(); 6780 *isolate_snapshot_size = writer.IsolateSnapshotSize();
6777 *instructions_blob_size = instructions_writer.InstructionsBlobSize(); 6781 *instructions_blob_size = instructions_writer.InstructionsBlobSize();
(...skipping 13 matching lines...) Expand all
6791 } 6795 }
6792 6796
6793 6797
6794 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6798 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6795 #ifndef PRODUCT 6799 #ifndef PRODUCT
6796 Profiler::DumpStackTrace(context); 6800 Profiler::DumpStackTrace(context);
6797 #endif 6801 #endif
6798 } 6802 }
6799 6803
6800 } // namespace dart 6804 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698