@@ -23,7 +23,7 @@ import { intrinsics, natives as builtinNatives } from "./natives/index.ts";
2323import { invokePolymorphic , linkCallSite , resolveConstant } from "./indy.ts" ;
2424import { hostNative , jniNames } from "./hostnatives.ts" ;
2525import { Library } from "./library.ts" ;
26- import { dumpVM , restoreVM , snapshotKey } from "./snapshot.ts" ;
26+ import { dumpVM , restoreVM , snapshotKey , SNAPSHOT_FORMAT } from "./snapshot.ts" ;
2727import type { SnapshotImage , WarmSnapshotImage } from "./snapshot.ts" ;
2828import type { SavedJit } from "./jit.ts" ;
2929import type { LibraryRequest } from "./library.ts" ;
@@ -1262,7 +1262,7 @@ export class JVM {
12621262 const build = snaps . build ;
12631263 this . warmKey = JSON . stringify ( [ snapshotKey ( this , build ) , this . opts . classpath ?? [ ] , this . opts . cwd ?? "/" , this . props . get ( "sun.java.command" ) ?? null ] ) ;
12641264 const useWarm = ( image : WarmSnapshotImage | null ) => {
1265- if ( ! image ) return false ;
1265+ if ( image ?. format !== SNAPSHOT_FORMAT ) return false ;
12661266 let mismatch : string | null ;
12671267 try {
12681268 mismatch = image . warmKey === this . warmKey && image . key === snapshotKey ( this , build ) ? this . fs . warmTraceMismatch ( image . trace ) : "key changed" ;
@@ -1305,7 +1305,7 @@ export class JVM {
13051305 const key = snapshotKey ( this , snaps . build ) ;
13061306 const done = ( image : SnapshotImage | null ) => {
13071307 // an async load can finish after the VM was halted
1308- if ( image ?. key !== key || this . exitCode !== null ) return start ( false ) ;
1308+ if ( image ?. format !== SNAPSHOT_FORMAT || image . key !== key || this . exitCode !== null ) return start ( false ) ;
13091309 try {
13101310 restoreVM ( this , image , t ) ;
13111311 } catch ( e ) {
0 commit comments