diff --git a/runtime/docs/index.md b/runtime/docs/index.md index 934ea63c751..4a63f9eec8d 100644 --- a/runtime/docs/index.md +++ b/runtime/docs/index.md @@ -266,7 +266,7 @@ Snapshots-with-code work almost in the same way as normal snapshots with a minor ![Snapshots](images/snapshot-with-code.png) !!! sourcecode "Source to read" - @{runtime/vm/clustered_snapshot.cc} handles serialization and deserialization of snapshots. A family of API functions `Dart_CreateXyzSnapshot[AsAssembly]` are responsible for writing out snapshots of the heap (e.g. @{Dart_CreateAppJITSnapshotAsBlobs} and @{Dart_CreateAppAOTSnapshotAsAssembly}). On the other hand @{Dart_CreateIsolateGroup} optionally takes snapshot data to start an isolate from. + @{runtime/vm/app_snapshot.cc} handles serialization and deserialization of snapshots. A family of API functions `Dart_CreateXyzSnapshot[AsAssembly]` are responsible for writing out snapshots of the heap (e.g. @{Dart_CreateAppJITSnapshotAsBlobs} and @{Dart_CreateAppAOTSnapshotAsAssembly}). On the other hand @{Dart_CreateIsolateGroup} optionally takes snapshot data to start an isolate from. ### Running from AppJIT snapshots @@ -390,4 +390,4 @@ Finally if the number of checks in the linear array grows past threshold the cal ## TODO 1. Document the difference between CoreJIT and AppJIT snapshots. -2. Document that switchable calls are used in the unoptimized code as well. \ No newline at end of file +2. Document that switchable calls are used in the unoptimized code as well. diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/app_snapshot.cc similarity index 99% rename from runtime/vm/clustered_snapshot.cc rename to runtime/vm/app_snapshot.cc index 45b26906fd3..21399b73534 100644 --- a/runtime/vm/clustered_snapshot.cc +++ b/runtime/vm/app_snapshot.cc @@ -5,7 +5,7 @@ #include #include -#include "vm/clustered_snapshot.h" +#include "vm/app_snapshot.h" #include "platform/assert.h" #include "vm/bootstrap.h" diff --git a/runtime/vm/clustered_snapshot.h b/runtime/vm/app_snapshot.h similarity index 99% rename from runtime/vm/clustered_snapshot.h rename to runtime/vm/app_snapshot.h index d80cb745361..da96ab40290 100644 --- a/runtime/vm/clustered_snapshot.h +++ b/runtime/vm/app_snapshot.h @@ -2,8 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -#ifndef RUNTIME_VM_CLUSTERED_SNAPSHOT_H_ -#define RUNTIME_VM_CLUSTERED_SNAPSHOT_H_ +#ifndef RUNTIME_VM_APP_SNAPSHOT_H_ +#define RUNTIME_VM_APP_SNAPSHOT_H_ #include "platform/assert.h" #include "vm/allocation.h" @@ -820,4 +820,4 @@ class FullSnapshotReader { } // namespace dart -#endif // RUNTIME_VM_CLUSTERED_SNAPSHOT_H_ +#endif // RUNTIME_VM_APP_SNAPSHOT_H_ diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc index 45da2e88bb6..3c2345e29a3 100644 --- a/runtime/vm/benchmark_test.cc +++ b/runtime/vm/benchmark_test.cc @@ -15,7 +15,7 @@ #include "platform/globals.h" #include "platform/utils.h" -#include "vm/clustered_snapshot.h" +#include "vm/app_snapshot.h" #include "vm/dart_api_impl.h" #include "vm/datastream.h" #include "vm/message_snapshot.h" diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc index 35dcb713f85..fbe3e6127b8 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc @@ -582,7 +582,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( if (FLAG_precompiled_mode) { if (FLAG_use_bare_instructions) { // The AOT runtime will replace the slot in the object pool with the - // entrypoint address - see clustered_snapshot.cc. + // entrypoint address - see app_snapshot.cc. CLOBBERS_LR(__ LoadUniqueObject(LR, StubCode::MegamorphicCall())); } else { __ LoadUniqueObject(CODE_REG, StubCode::MegamorphicCall()); @@ -643,7 +643,7 @@ void FlowGraphCompiler::EmitInstanceCallAOT(const ICData& ic_data, (ic_data.SizeWithoutTypeArgs() - 1) * compiler::target::kWordSize); if (FLAG_precompiled_mode && FLAG_use_bare_instructions) { // The AOT runtime will replace the slot in the object pool with the - // entrypoint address - see clustered_snapshot.cc. + // entrypoint address - see app_snapshot.cc. CLOBBERS_LR(__ LoadUniqueObject(LR, initial_stub)); } else { __ LoadUniqueObject(CODE_REG, initial_stub); diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc index b3e65ad9ada..da37d866250 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc @@ -578,7 +578,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( ASSERT((data_index + 1) == stub_index); if (FLAG_precompiled_mode && FLAG_use_bare_instructions) { // The AOT runtime will replace the slot in the object pool with the - // entrypoint address - see clustered_snapshot.cc. + // entrypoint address - see app_snapshot.cc. CLOBBERS_LR(__ LoadDoubleWordFromPoolIndex(R5, LR, data_index)); } else { __ LoadDoubleWordFromPoolIndex(R5, CODE_REG, data_index); @@ -638,7 +638,7 @@ void FlowGraphCompiler::EmitInstanceCallAOT(const ICData& ic_data, if (FLAG_precompiled_mode && FLAG_use_bare_instructions) { // The AOT runtime will replace the slot in the object pool with the - // entrypoint address - see clustered_snapshot.cc. + // entrypoint address - see app_snapshot.cc. CLOBBERS_LR(__ LoadDoubleWordFromPoolIndex(R5, LR, data_index)); } else { __ LoadDoubleWordFromPoolIndex(R5, CODE_REG, data_index); diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc index 81c4cac7d1b..573add6f8d6 100644 --- a/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc +++ b/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc @@ -581,7 +581,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( if (FLAG_precompiled_mode) { if (FLAG_use_bare_instructions) { // The AOT runtime will replace the slot in the object pool with the - // entrypoint address - see clustered_snapshot.cc. + // entrypoint address - see app_snapshot.cc. __ LoadUniqueObject(RCX, StubCode::MegamorphicCall()); } else { __ LoadUniqueObject(CODE_REG, StubCode::MegamorphicCall()); @@ -639,7 +639,7 @@ void FlowGraphCompiler::EmitInstanceCallAOT(const ICData& ic_data, RSP, (ic_data.SizeWithoutTypeArgs() - 1) * kWordSize)); if (FLAG_precompiled_mode && FLAG_use_bare_instructions) { // The AOT runtime will replace the slot in the object pool with the - // entrypoint address - see clustered_snapshot.cc. + // entrypoint address - see app_snapshot.cc. __ LoadUniqueObject(RCX, initial_stub); } else { const intptr_t entry_point_offset = diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc index fda12511203..cd3ca635e32 100644 --- a/runtime/vm/dart.cc +++ b/runtime/vm/dart.cc @@ -7,7 +7,7 @@ #include "vm/dart.h" -#include "vm/clustered_snapshot.h" +#include "vm/app_snapshot.h" #include "vm/code_observers.h" #include "vm/compiler/runtime_offsets_extracted.h" #include "vm/compiler/runtime_offsets_list.h" diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index 94c0f77ca3c..7504a27c4b8 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -11,8 +11,8 @@ #include "lib/stacktrace.h" #include "platform/assert.h" #include "platform/unicode.h" +#include "vm/app_snapshot.h" #include "vm/class_finalizer.h" -#include "vm/clustered_snapshot.h" #include "vm/compiler/jit/compiler.h" #include "vm/dart.h" #include "vm/dart_api_impl.h" diff --git a/runtime/vm/object.h b/runtime/vm/object.h index d87773408f3..c76665a7677 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h @@ -951,7 +951,7 @@ enum class Nullability : uint8_t { kNullable = 0, kNonNullable = 1, kLegacy = 2, - // Adjust kNullabilityBitSize in clustered_snapshot.cc if adding new values. + // Adjust kNullabilityBitSize in app_snapshot.cc if adding new values. }; // Equality kind between types. diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc index d42c2da56f8..1fb886cdab3 100644 --- a/runtime/vm/snapshot_test.cc +++ b/runtime/vm/snapshot_test.cc @@ -7,8 +7,8 @@ #include "include/dart_tools_api.h" #include "platform/assert.h" #include "platform/unicode.h" +#include "vm/app_snapshot.h" #include "vm/class_finalizer.h" -#include "vm/clustered_snapshot.h" #include "vm/dart_api_impl.h" #include "vm/dart_api_message.h" #include "vm/dart_api_state.h" diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc index 90576ec4c14..1cb2a0738f1 100644 --- a/runtime/vm/stub_code.cc +++ b/runtime/vm/stub_code.cc @@ -6,7 +6,7 @@ #include "platform/assert.h" #include "platform/globals.h" -#include "vm/clustered_snapshot.h" +#include "vm/app_snapshot.h" #include "vm/compiler/assembler/disassembler.h" #include "vm/flags.h" #include "vm/heap/safepoint.h" diff --git a/runtime/vm/vm_sources.gni b/runtime/vm/vm_sources.gni index 2f21ac1f213..f17cc64a11e 100644 --- a/runtime/vm/vm_sources.gni +++ b/runtime/vm/vm_sources.gni @@ -7,6 +7,8 @@ vm_sources = [ "allocation.cc", "allocation.h", + "app_snapshot.cc", + "app_snapshot.h", "base64.cc", "base64.h", "base_isolate.h", @@ -30,8 +32,6 @@ vm_sources = [ "class_table.h", "closure_functions_cache.cc", "closure_functions_cache.h", - "clustered_snapshot.cc", - "clustered_snapshot.h", "code_comments.cc", "code_comments.h", "code_descriptors.cc", diff --git a/tools/make_version.py b/tools/make_version.py index bf2c9c57146..79ac27f0ac7 100755 --- a/tools/make_version.py +++ b/tools/make_version.py @@ -17,7 +17,7 @@ import utils # backwards-compatible. VM_SNAPSHOT_FILES = [ # Header files. - 'clustered_snapshot.h', + 'app_snapshot.h', 'datastream.h', 'image_snapshot.h', 'object.h', @@ -25,7 +25,7 @@ VM_SNAPSHOT_FILES = [ 'snapshot.h', 'symbols.h', # Source files. - 'clustered_snapshot.cc', + 'app_snapshot.cc', 'dart.cc', 'dart_api_impl.cc', 'image_snapshot.cc',