@@ -48,7 +48,6 @@ class DummySnapshot : public AppSnapshot {
4848
4949 private:
5050};
51- #endif // !defined(DART_PRECOMPILED_RUNTIME)
5251
5352class MappedAppSnapshot : public AppSnapshot {
5453 public:
@@ -143,6 +142,7 @@ static AppSnapshot* TryReadAppSnapshotBlobs(const char* script_name,
143142 nullptr , nullptr , isolate_data_mapping, isolate_instr_mapping);
144143 return app_snapshot;
145144}
145+ #endif // !defined(DART_PRECOMPILED_RUNTIME)
146146
147147#if defined(DART_PRECOMPILED_RUNTIME)
148148class ElfAppSnapshot : public AppSnapshot {
@@ -594,10 +594,6 @@ AppSnapshot* Snapshot::TryReadAppSnapshot(const char* script_uri,
594594 }
595595 DartUtils::MagicNumber magic_number =
596596 DartUtils::SniffForMagicNumber (header, sizeof (header));
597- if (magic_number == DartUtils::kAppJITMagicNumber ) {
598- // Return the JIT snapshot.
599- return TryReadAppSnapshotBlobs (script_name, file);
600- }
601597#if defined(DART_PRECOMPILED_RUNTIME)
602598 if (!DartUtils::IsAotMagicNumber (magic_number)) {
603599 return nullptr ;
@@ -623,6 +619,10 @@ AppSnapshot* Snapshot::TryReadAppSnapshot(const char* script_uri,
623619 return TryReadAppSnapshotElf (script_name, /* file_offset=*/ 0 ,
624620 force_load_elf_from_memory);
625621#else
622+ if (magic_number == DartUtils::kAppJITMagicNumber ) {
623+ // Return the JIT snapshot.
624+ return TryReadAppSnapshotBlobs (script_name, file);
625+ }
626626 // We create a dummy snapshot object just to remember the type which
627627 // has already been identified by sniffing the magic number.
628628 return new DummySnapshot (magic_number);
0 commit comments