[vm] Rename clustered_snapshot.h/cc to app_snapshot.h/cc.

Since bbefc0574887c1e00e00d07d7cb8a2b5acd249d6, both serialization formats in the VM are based on clustering. The distinguishing feature of the older clustered serializer is that it represents apps/programs rather than messages.

TEST=ci
Change-Id: If3185c21c6aadeec61a940b12ba23d17f2752761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211501
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
diff --git a/runtime/docs/index.md b/runtime/docs/index.md
index 934ea63..4a63f9e 100644
--- a/runtime/docs/index.md
+++ b/runtime/docs/index.md
@@ -266,7 +266,7 @@
 ![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 @@
 ## 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 45b2690..21399b7 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/app_snapshot.cc
@@ -5,7 +5,7 @@
 #include <memory>
 #include <utility>
 
-#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 d80cb7453..da96ab4 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 @@
 
 }  // 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 45da2e8..3c2345e 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 35dcb71..fbe3e61 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 @@
   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 @@
       (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 b3e65ad..da37d86 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 @@
   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 @@
 
   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 81c4cac..573add6 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 @@
   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 @@
                    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 fda1251..cd3ca635 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 94c0f77..7504a27 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 d877734..c76665a 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -951,7 +951,7 @@
   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 d42c2da..1fb886c 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 90576ec..1cb2a07 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 2f21ac1..f17cc64 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 @@
   "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 bf2c9c5..79ac27f 100755
--- a/tools/make_version.py
+++ b/tools/make_version.py
@@ -17,7 +17,7 @@
 # backwards-compatible.
 VM_SNAPSHOT_FILES = [
     # Header files.
-    'clustered_snapshot.h',
+    'app_snapshot.h',
     'datastream.h',
     'image_snapshot.h',
     'object.h',
@@ -25,7 +25,7 @@
     'snapshot.h',
     'symbols.h',
     # Source files.
-    'clustered_snapshot.cc',
+    'app_snapshot.cc',
     'dart.cc',
     'dart_api_impl.cc',
     'image_snapshot.cc',