Commit 966b700
sea: support code cache for ESM entrypoint in SEA
The initial support for ESM entrypoint in SEA didn't support
code cache. This patch implements that by following a path
similar to how code cache in CJS SEA entrypoint is supported:
at build time we generate the code cache from C++ and put it
into the sea blob, and at runtime we consume it via a special
case in compilation routines - for CJS this was
CompileFunctionForCJSLoader, in the case of SourceTextModule,
it's in Module::New.
PR-URL: #62158
Refs: #61813
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent f0eea0f commit 966b700Copy full SHA for 966b700
6 files changed
+159-45Lines changed: 159 additions & 45 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- doc/api
- src
- test
- fixtures/sea/esm-code-cache
- sea
Expand file treeCollapse file tree
Open diff view settings
Collapse file
doc/api/single-executable-applications.md
Copy file name to clipboardExpand all lines: doc/api/single-executable-applications.md+1-2Lines changed: 1 addition & 2 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
395 | 395 | |
396 | 396 | |
397 | 397 | |
398 | | - |
399 | | - |
| 398 | + |
400 | 399 | |
401 | 400 | |
402 | 401 | |
|
Collapse file
+36-6Lines changed: 36 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
| 3 | + |
3 | 4 | |
4 | 5 | |
5 | 6 | |
6 | 7 | |
7 | 8 | |
8 | 9 | |
9 | 10 | |
| 11 | + |
10 | 12 | |
11 | 13 | |
12 | 14 | |
| ||
365 | 367 | |
366 | 368 | |
367 | 369 | |
| 370 | + |
| 371 | + |
| 372 | + |
| 373 | + |
| 374 | + |
| 375 | + |
| 376 | + |
| 377 | + |
| 378 | + |
| 379 | + |
| 380 | + |
| 381 | + |
| 382 | + |
| 383 | + |
368 | 384 | |
369 | 385 | |
370 | 386 | |
| ||
389 | 405 | |
390 | 406 | |
391 | 407 | |
392 | | - |
393 | | - |
394 | | - |
395 | | - |
396 | | - |
397 | | - |
| 408 | + |
| 409 | + |
| 410 | + |
| 411 | + |
| 412 | + |
| 413 | + |
| 414 | + |
| 415 | + |
| 416 | + |
| 417 | + |
| 418 | + |
| 419 | + |
| 420 | + |
| 421 | + |
| 422 | + |
| 423 | + |
| 424 | + |
| 425 | + |
| 426 | + |
| 427 | + |
398 | 428 | |
399 | 429 | |
400 | 430 | |
|
Collapse file
+61-37Lines changed: 61 additions & 37 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
24 | 24 | |
25 | 25 | |
26 | 26 | |
| 27 | + |
27 | 28 | |
28 | 29 | |
29 | 30 | |
30 | 31 | |
31 | 32 | |
32 | 33 | |
33 | 34 | |
| 35 | + |
34 | 36 | |
35 | 37 | |
36 | 38 | |
37 | 39 | |
38 | 40 | |
| 41 | + |
39 | 42 | |
40 | 43 | |
41 | 44 | |
| ||
542 | 545 | |
543 | 546 | |
544 | 547 | |
545 | | - |
| 548 | + |
546 | 549 | |
547 | 550 | |
548 | 551 | |
| ||
551 | 554 | |
552 | 555 | |
553 | 556 | |
554 | | - |
555 | | - |
556 | | - |
557 | | - |
558 | | - |
559 | | - |
560 | | - |
561 | | - |
562 | 557 | |
563 | 558 | |
564 | 559 | |
| ||
616 | 611 | |
617 | 612 | |
618 | 613 | |
619 | | - |
| 614 | + |
| 615 | + |
620 | 616 | |
621 | 617 | |
622 | 618 | |
| ||
647 | 643 | |
648 | 644 | |
649 | 645 | |
650 | | - |
651 | | - |
652 | | - |
653 | | - |
654 | | - |
655 | | - |
656 | | - |
657 | | - |
658 | | - |
659 | | - |
660 | | - |
661 | | - |
662 | | - |
663 | | - |
664 | | - |
665 | | - |
666 | | - |
667 | | - |
668 | | - |
669 | | - |
670 | | - |
| 646 | + |
| 647 | + |
| 648 | + |
| 649 | + |
| 650 | + |
| 651 | + |
| 652 | + |
| 653 | + |
| 654 | + |
| 655 | + |
| 656 | + |
| 657 | + |
| 658 | + |
| 659 | + |
| 660 | + |
| 661 | + |
| 662 | + |
| 663 | + |
| 664 | + |
| 665 | + |
| 666 | + |
| 667 | + |
| 668 | + |
| 669 | + |
| 670 | + |
| 671 | + |
| 672 | + |
| 673 | + |
| 674 | + |
| 675 | + |
| 676 | + |
| 677 | + |
| 678 | + |
| 679 | + |
| 680 | + |
| 681 | + |
| 682 | + |
| 683 | + |
| 684 | + |
| 685 | + |
| 686 | + |
| 687 | + |
| 688 | + |
| 689 | + |
| 690 | + |
| 691 | + |
| 692 | + |
| 693 | + |
| 694 | + |
| 695 | + |
| 696 | + |
671 | 697 | |
672 | 698 | |
673 | | - |
674 | | - |
675 | | - |
676 | | - |
677 | | - |
| 699 | + |
| 700 | + |
| 701 | + |
678 | 702 | |
679 | 703 | |
680 | 704 | |
| ||
728 | 752 | |
729 | 753 | |
730 | 754 | |
731 | | - |
| 755 | + |
732 | 756 | |
733 | 757 | |
734 | 758 | |
|
Collapse file
test/fixtures/sea/esm-code-cache/sea-config.json
Copy file name to clipboard+7Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
Collapse file
test/fixtures/sea/esm-code-cache/sea.mjs
Copy file name to clipboard+20Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
Collapse file
test/sea/test-single-executable-application-esm-code-cache.js
Copy file name to clipboard+34Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
0 commit comments