()
| 3403 | this.resolvedVirtualCache = Object.create(null); |
| 3404 | }, |
| 3405 | start() { |
| 3406 | if (!this.mainClass || !this.mainMethod) { |
| 3407 | vmLifecycle("start-failed-no-main"); |
| 3408 | throw new Error("No main class configured for javascript backend"); |
| 3409 | } |
| 3410 | vmLifecycle("start:mainClass=" + this.mainClass); |
| 3411 | vmDiag("LIFECYCLE_START", "mainClass", this.mainClass); |
| 3412 | this.applyNativeOverrides(); |
| 3413 | ensureSystemPrintStreams(); |
| 3414 | vmTrace("runtime.start.before-main-generator"); |
| 3415 | const mainArgs = this.newArray(0, "java_lang_String", 1); |
| 3416 | const mainThreadObject = this.newObject("java_lang_Thread"); |
| 3417 | mainThreadObject[CN1_THREAD_ALIVE] = 1; |
| 3418 | mainThreadObject[CN1_THREAD_NAME] = this.createStringLiteral("main"); |
| 3419 | this.mainThreadObject = mainThreadObject; |
| 3420 | vmLifecycle("start:invoking-main-method=" + this.mainMethod); |
| 3421 | const mainGenerator = global[this.mainMethod](mainArgs); |
| 3422 | vmLifecycle("start:main-method-returned=" + (mainGenerator != null && typeof mainGenerator.next === "function" ? "generator" : "sync")); |
| 3423 | vmTrace("runtime.start.after-main-generator"); |
| 3424 | const mainThread = this.spawn(mainThreadObject, mainGenerator); |
| 3425 | // Stash the main thread + object so the drain loop can identify |
| 3426 | // when the main bytecode completes vs when an auxiliary thread |
| 3427 | // (e.g. a CN1SS test runner Thread or worker callback) finishes. |
| 3428 | this.mainThread = mainThread; |
| 3429 | vmTrace("runtime.start.after-spawn"); |
| 3430 | this.currentThread = mainThread; |
| 3431 | vmTrace("runtime.start.before-drain"); |
| 3432 | this.drain(); |
| 3433 | vmTrace("runtime.start.after-drain"); |
| 3434 | vmLifecycle("start:drain-returned threads=" + this.threads.length); |
| 3435 | }, |
| 3436 | describeProtocol() { |
| 3437 | return { |
| 3438 | type: this.protocol.messages.PROTOCOL, |
nothing calls this directly
no test coverage detected