faster gc

This commit is contained in:
2026-02-14 16:46:11 -06:00
parent e75596ce30
commit 5fe05c60d3
13 changed files with 7566 additions and 7521 deletions

View File

@@ -39,7 +39,7 @@
[ [
"get", "get",
7, 7,
21, 22,
1, 1,
7, 7,
10 10
@@ -102,7 +102,7 @@
[ [
"get", "get",
3, 3,
16, 17,
1, 1,
21, 21,
15 15
@@ -790,7 +790,7 @@
[ [
"get", "get",
3, 3,
5, 10,
1, 1,
40, 40,
7 7
@@ -813,7 +813,7 @@
[ [
"get", "get",
5, 5,
5, 10,
1, 1,
41, 41,
12 12
@@ -916,7 +916,7 @@
[ [
"get", "get",
14, 14,
17, 18,
1, 1,
42, 42,
16 16
@@ -968,7 +968,7 @@
[ [
"get", "get",
17, 17,
5, 10,
1, 1,
43, 43,
3 3
@@ -1075,13 +1075,13 @@
], ],
[ [
"null", "null",
6, 5,
53, 53,
20 20
], ],
[ [
"null", "null",
5, 6,
54, 54,
19 19
], ],
@@ -1424,7 +1424,7 @@
[ [
"get", "get",
38, 38,
12, 11,
1, 1,
58, 58,
14 14
@@ -1887,7 +1887,7 @@
], ],
[ [
"move", "move",
6, 5,
64, 64,
62, 62,
18 18
@@ -1937,7 +1937,7 @@
"setarg", "setarg",
70, 70,
2, 2,
6, 5,
63, 63,
17 17
], ],
@@ -1950,7 +1950,7 @@
], ],
[ [
"move", "move",
5, 6,
68, 68,
63, 63,
17 17
@@ -1965,7 +1965,7 @@
[ [
"get", "get",
73, 73,
1, 2,
1, 1,
65, 65,
7 7
@@ -2051,7 +2051,7 @@
[ [
"push", "push",
81, 81,
5, 6,
66, 66,
7 7
], ],
@@ -2137,7 +2137,7 @@
"setarg", "setarg",
84, 84,
2, 2,
5, 6,
66, 66,
7 7
], ],
@@ -2194,7 +2194,7 @@
"setarg", "setarg",
87, 87,
1, 1,
5, 6,
68, 68,
12 12
], ],
@@ -4200,7 +4200,7 @@
[ [
"get", "get",
14, 14,
2, 3,
1, 1,
130, 130,
20 20
@@ -4268,7 +4268,7 @@
[ [
"get", "get",
18, 18,
2, 3,
1, 1,
131, 131,
57 57
@@ -4276,7 +4276,7 @@
[ [
"get", "get",
20, 20,
19, 20,
1, 1,
131, 131,
13 13
@@ -6482,7 +6482,7 @@
[ [
"get", "get",
9, 9,
3, 4,
1, 1,
172, 172,
18 18
@@ -6560,7 +6560,7 @@
[ [
"get", "get",
14, 14,
15, 16,
1, 1,
174, 174,
9 9
@@ -6783,7 +6783,7 @@
[ [
"get", "get",
20, 20,
10, 8,
1, 1,
175, 175,
47 47
@@ -6791,7 +6791,7 @@
[ [
"get", "get",
22, 22,
20, 21,
1, 1,
175, 175,
24 24
@@ -6844,7 +6844,7 @@
[ [
"put", "put",
21, 21,
15, 16,
1, 1,
175, 175,
24 24
@@ -6874,7 +6874,7 @@
[ [
"get", "get",
26, 26,
15, 16,
1, 1,
178, 178,
28 28
@@ -6898,7 +6898,7 @@
[ [
"get", "get",
28, 28,
22, 23,
1, 1,
180, 180,
19 19
@@ -6985,7 +6985,7 @@
[ [
"get", "get",
35, 35,
23, 24,
1, 1,
186, 186,
20 20
@@ -7119,7 +7119,7 @@
"call_done_134", "call_done_134",
[ [
"move", "move",
6, 5,
34, 34,
186, 186,
20 20
@@ -7169,7 +7169,7 @@
"setarg", "setarg",
45, 45,
2, 2,
6, 5,
187, 187,
19 19
], ],
@@ -7182,7 +7182,7 @@
], ],
[ [
"move", "move",
5, 6,
43, 43,
187, 187,
19 19
@@ -7224,7 +7224,7 @@
"setarg", "setarg",
49, 49,
1, 1,
5, 6,
188, 188,
10 10
], ],
@@ -7264,7 +7264,7 @@
[ [
"get", "get",
8, 8,
3, 4,
1, 1,
193, 193,
18 18
@@ -7316,7 +7316,7 @@
[ [
"get", "get",
12, 12,
23, 24,
1, 1,
194, 194,
20 20
@@ -7450,7 +7450,7 @@
"call_done_136", "call_done_136",
[ [
"move", "move",
6, 5,
11, 11,
194, 194,
20 20
@@ -7500,7 +7500,7 @@
"setarg", "setarg",
22, 22,
2, 2,
6, 5,
195, 195,
19 19
], ],
@@ -7513,7 +7513,7 @@
], ],
[ [
"move", "move",
5, 6,
20, 20,
195, 195,
19 19
@@ -7555,7 +7555,7 @@
"setarg", "setarg",
26, 26,
1, 1,
5, 6,
196, 196,
10 10
], ],
@@ -7595,7 +7595,7 @@
[ [
"get", "get",
6, 6,
3, 4,
1, 1,
201, 201,
18 18
@@ -7647,7 +7647,7 @@
[ [
"get", "get",
10, 10,
22, 23,
1, 1,
202, 202,
19 19
@@ -7699,7 +7699,7 @@
[ [
"get", "get",
14, 14,
23, 24,
1, 1,
203, 203,
39 39
@@ -8319,7 +8319,7 @@
[ [
"get", "get",
37, 37,
12, 11,
1, 1,
219, 219,
14 14
@@ -8867,7 +8867,7 @@
[ [
"get", "get",
73, 73,
1, 2,
1, 1,
226, 226,
7 7
@@ -9417,7 +9417,7 @@
[ [
"get", "get",
111, 111,
18, 19,
1, 1,
235, 235,
10 10
@@ -9503,7 +9503,7 @@
], ],
[ [
"move", "move",
17, 18,
28, 28,
0, 0,
0 0
@@ -9531,7 +9531,7 @@
], ],
[ [
"move", "move",
12, 11,
30, 30,
0, 0,
0 0
@@ -9545,7 +9545,7 @@
], ],
[ [
"move", "move",
1, 2,
31, 31,
0, 0,
0 0
@@ -9559,7 +9559,7 @@
], ],
[ [
"move", "move",
25, 26,
32, 32,
0, 0,
0 0
@@ -9573,7 +9573,7 @@
], ],
[ [
"move", "move",
20, 21,
33, 33,
0, 0,
0 0
@@ -9615,7 +9615,7 @@
], ],
[ [
"move", "move",
18, 19,
36, 36,
0, 0,
0 0
@@ -9629,7 +9629,7 @@
], ],
[ [
"move", "move",
11, 15,
37, 37,
0, 0,
0 0
@@ -9643,7 +9643,7 @@
], ],
[ [
"move", "move",
26, 1,
38, 38,
0, 0,
0 0
@@ -9657,7 +9657,7 @@
], ],
[ [
"move", "move",
8, 12,
39, 39,
0, 0,
0 0
@@ -9683,7 +9683,7 @@
], ],
[ [
"move", "move",
21, 22,
41, 41,
5, 5,
21 21
@@ -9698,7 +9698,7 @@
[ [
"frame", "frame",
44, 44,
17, 18,
1, 1,
10, 10,
10 10
@@ -9749,7 +9749,7 @@
[ [
"frame", "frame",
48, 48,
17, 18,
1, 1,
11, 11,
12 12
@@ -9785,7 +9785,7 @@
], ],
[ [
"move", "move",
23, 24,
47, 47,
11, 11,
12 12
@@ -9800,7 +9800,7 @@
[ [
"frame", "frame",
52, 52,
17, 18,
1, 1,
12, 12,
14 14
@@ -9836,7 +9836,7 @@
], ],
[ [
"move", "move",
16, 17,
51, 51,
12, 12,
14 14
@@ -9848,7 +9848,7 @@
], ],
[ [
"move", "move",
5, 10,
54, 54,
14, 14,
17 17
@@ -9862,7 +9862,7 @@
], ],
[ [
"store_field", "store_field",
5, 10,
14, 14,
55, 55,
15, 15,
@@ -9888,7 +9888,7 @@
], ],
[ [
"store_field", "store_field",
5, 10,
56, 56,
57, 57,
16, 16,
@@ -9903,8 +9903,8 @@
], ],
[ [
"store_field", "store_field",
5, 10,
23, 24,
58, 58,
17, 17,
11 11
@@ -9918,8 +9918,8 @@
], ],
[ [
"store_field", "store_field",
5, 10,
16, 17,
59, 59,
18, 18,
11 11
@@ -9932,14 +9932,14 @@
[ [
"store_field", "store_field",
60, 60,
25, 26,
"use", "use",
74, 74,
22 22
], ],
[ [
"move", "move",
10, 8,
60, 60,
74, 74,
22 22
@@ -9954,7 +9954,7 @@
[ [
"frame", "frame",
63, 63,
20, 21,
2, 2,
75, 75,
20 20
@@ -9985,7 +9985,7 @@
"setarg", "setarg",
63, 63,
2, 2,
10, 8,
75, 75,
20 20
], ],
@@ -9998,7 +9998,7 @@
], ],
[ [
"move", "move",
2, 3,
62, 62,
75, 75,
20 20
@@ -10013,7 +10013,7 @@
[ [
"frame", "frame",
67, 67,
20, 21,
2, 2,
76, 76,
17 17
@@ -10044,7 +10044,7 @@
"setarg", "setarg",
67, 67,
2, 2,
10, 8,
76, 76,
17 17
], ],
@@ -10057,7 +10057,7 @@
], ],
[ [
"move", "move",
19, 20,
66, 66,
76, 76,
17 17
@@ -10072,7 +10072,7 @@
[ [
"frame", "frame",
71, 71,
20, 21,
2, 2,
77, 77,
16 16
@@ -10103,7 +10103,7 @@
"setarg", "setarg",
71, 71,
2, 2,
10, 8,
77, 77,
16 16
], ],
@@ -10130,8 +10130,8 @@
], ],
[ [
"store_field", "store_field",
5, 10,
2, 3,
73, 73,
78, 78,
11 11
@@ -10145,8 +10145,8 @@
], ],
[ [
"store_field", "store_field",
5, 10,
19, 20,
74, 74,
79, 79,
11 11
@@ -10160,7 +10160,7 @@
], ],
[ [
"store_field", "store_field",
5, 10,
13, 13,
75, 75,
80, 80,
@@ -10176,7 +10176,7 @@
[ [
"frame", "frame",
78, 78,
20, 21,
2, 2,
83, 83,
17 17
@@ -10207,7 +10207,7 @@
"setarg", "setarg",
78, 78,
2, 2,
10, 8,
83, 83,
17 17
], ],
@@ -10220,7 +10220,7 @@
], ],
[ [
"move", "move",
3, 4,
77, 77,
83, 83,
17 17
@@ -10234,15 +10234,15 @@
], ],
[ [
"store_field", "store_field",
5, 10,
3, 4,
80, 80,
84, 84,
11 11
], ],
[ [
"null", "null",
22, 23,
85, 85,
22 22
], ],
@@ -10285,7 +10285,7 @@
[ [
"frame", "frame",
86, 86,
20, 21,
2, 2,
164, 164,
18 18
@@ -10316,7 +10316,7 @@
"setarg", "setarg",
86, 86,
2, 2,
10, 8,
164, 164,
18 18
], ],
@@ -10329,7 +10329,7 @@
], ],
[ [
"move", "move",
22, 23,
85, 85,
164, 164,
18 18
@@ -10343,21 +10343,21 @@
], ],
[ [
"store_field", "store_field",
5, 10,
22, 23,
88, 88,
165, 165,
11 11
], ],
[ [
"null", "null",
15, 16,
168, 168,
22 22
], ],
[ [
"null", "null",
24, 25,
240, 240,
15 15
], ],
@@ -10377,7 +10377,7 @@
], ],
[ [
"access", "access",
4, 5,
0, 0,
242, 242,
10 10
@@ -10649,7 +10649,7 @@
], ],
[ [
"move", "move",
24, 25,
97, 97,
246, 246,
18 18
@@ -10657,7 +10657,7 @@
"_nop_bl_1", "_nop_bl_1",
[ [
"jump_true", "jump_true",
24, 25,
"if_else_168", "if_else_168",
247, 247,
8 8
@@ -10739,7 +10739,7 @@
], ],
[ [
"move", "move",
4, 5,
104, 104,
251, 251,
8 8
@@ -10766,7 +10766,7 @@
[ [
"is_int", "is_int",
108, 108,
4, 5,
252, 252,
22 22
], ],
@@ -10782,7 +10782,7 @@
[ [
"lt_int", "lt_int",
107, 107,
4, 5,
106, 106,
252, 252,
22 22
@@ -10797,7 +10797,7 @@
[ [
"is_num", "is_num",
108, 108,
4, 5,
252, 252,
22 22
], ],
@@ -10813,7 +10813,7 @@
[ [
"lt_float", "lt_float",
107, 107,
4, 5,
106, 106,
252, 252,
22 22
@@ -10828,7 +10828,7 @@
[ [
"is_text", "is_text",
108, 108,
4, 5,
252, 252,
22 22
], ],
@@ -10849,7 +10849,7 @@
[ [
"lt_text", "lt_text",
107, 107,
4, 5,
106, 106,
252, 252,
22 22
@@ -10889,7 +10889,7 @@
"load_dynamic", "load_dynamic",
111, 111,
110, 110,
4, 5,
253, 253,
26 26
], ],
@@ -10937,14 +10937,14 @@
[ [
"add", "add",
114, 114,
4, 5,
113, 113,
254, 254,
15 15
], ],
[ [
"move", "move",
4, 5,
114, 114,
254, 254,
15 15
@@ -11007,7 +11007,7 @@
[ [
"store_field", "store_field",
118, 118,
24, 25,
"program", "program",
259, 259,
21 21
@@ -11069,7 +11069,7 @@
[ [
"store_field", "store_field",
115, 115,
23, 24,
"json", "json",
260, 260,
55 55
@@ -11085,7 +11085,7 @@
[ [
"store_field", "store_field",
115, 115,
18, 19,
"run_ast_fn", "run_ast_fn",
261, 261,
35 35
@@ -11093,7 +11093,7 @@
[ [
"store_field", "store_field",
115, 115,
11, 15,
"run_ast_noopt_fn", "run_ast_noopt_fn",
261, 261,
62 62
@@ -11101,7 +11101,7 @@
[ [
"store_field", "store_field",
115, 115,
5, 10,
"use_cache", "use_cache",
262, 262,
16 16
@@ -11117,7 +11117,7 @@
[ [
"store_field", "store_field",
115, 115,
12, 11,
"cache_path", "cache_path",
263, 263,
45 45
@@ -11125,7 +11125,7 @@
[ [
"store_field", "store_field",
115, 115,
1, 2,
"ensure_build_dir", "ensure_build_dir",
264, 264,
23 23
@@ -11133,7 +11133,7 @@
[ [
"store_field", "store_field",
115, 115,
26, 1,
"compile_to_blob_fn", "compile_to_blob_fn",
264, 264,
61 61
@@ -11141,7 +11141,7 @@
[ [
"frame", "frame",
122, 122,
8, 12,
1, 1,
257, 257,
3 3
@@ -11285,7 +11285,7 @@
[ [
"store_field", "store_field",
124, 124,
23, 24,
"json", "json",
270, 270,
55 55
@@ -11339,7 +11339,7 @@
[ [
"store_field", "store_field",
124, 124,
18, 19,
"run_ast_fn", "run_ast_fn",
271, 271,
35 35
@@ -11347,7 +11347,7 @@
[ [
"store_field", "store_field",
124, 124,
11, 15,
"run_ast_noopt_fn", "run_ast_noopt_fn",
271, 271,
62 62
@@ -11355,7 +11355,7 @@
[ [
"store_field", "store_field",
124, 124,
5, 10,
"use_cache", "use_cache",
272, 272,
16 16
@@ -11371,7 +11371,7 @@
[ [
"store_field", "store_field",
124, 124,
12, 11,
"cache_path", "cache_path",
273, 273,
45 45
@@ -11379,7 +11379,7 @@
[ [
"store_field", "store_field",
124, 124,
1, 2,
"ensure_build_dir", "ensure_build_dir",
274, 274,
23 23
@@ -11387,7 +11387,7 @@
[ [
"store_field", "store_field",
124, 124,
26, 1,
"compile_to_blob_fn", "compile_to_blob_fn",
274, 274,
61 61
@@ -11395,7 +11395,7 @@
[ [
"frame", "frame",
133, 133,
8, 12,
1, 1,
268, 268,
3 3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -165,7 +165,7 @@
[ [
"get", "get",
18, 18,
12, 19,
1, 1,
18, 18,
16 16
@@ -764,7 +764,7 @@
[ [
"get", "get",
42, 42,
16, 18,
1, 1,
35, 35,
50 50
@@ -862,7 +862,7 @@
[ [
"get", "get",
9, 9,
5, 7,
1, 1,
51, 51,
20 20
@@ -930,7 +930,7 @@
[ [
"get", "get",
13, 13,
5, 7,
1, 1,
52, 52,
57 57
@@ -938,7 +938,7 @@
[ [
"get", "get",
15, 15,
17, 14,
1, 1,
52, 52,
13 13
@@ -2234,7 +2234,7 @@
[ [
"get", "get",
77, 77,
2, 4,
1, 1,
68, 68,
10 10
@@ -2297,7 +2297,7 @@
[ [
"get", "get",
8, 8,
10, 8,
1, 1,
72, 72,
18 18
@@ -2349,7 +2349,7 @@
[ [
"get", "get",
12, 12,
13, 16,
1, 1,
73, 73,
19 19
@@ -2820,7 +2820,7 @@
[ [
"get", "get",
23, 23,
12, 19,
1, 1,
89, 89,
12 12
@@ -3297,7 +3297,7 @@
[ [
"get", "get",
56, 56,
8, 12,
1, 1,
99, 99,
54 54
@@ -3970,7 +3970,7 @@
[ [
"get", "get",
103, 103,
7, 11,
1, 1,
110, 110,
11 11
@@ -4035,7 +4035,7 @@
[ [
"get", "get",
107, 107,
8, 12,
1, 1,
111, 111,
39 39
@@ -4051,7 +4051,7 @@
[ [
"get", "get",
109, 109,
9, 13,
1, 1,
111, 111,
14 14
@@ -4256,7 +4256,7 @@
], ],
[ [
"move", "move",
16, 18,
20, 20,
0, 0,
0 0
@@ -4270,7 +4270,7 @@
], ],
[ [
"move", "move",
11, 2,
21, 21,
0, 0,
0 0
@@ -4284,7 +4284,7 @@
], ],
[ [
"move", "move",
7, 11,
22, 22,
0, 0,
0 0
@@ -4298,7 +4298,7 @@
], ],
[ [
"move", "move",
9, 13,
23, 23,
0, 0,
0 0
@@ -4312,7 +4312,7 @@
], ],
[ [
"move", "move",
8, 12,
24, 24,
0, 0,
0 0
@@ -4338,7 +4338,7 @@
], ],
[ [
"move", "move",
12, 19,
26, 26,
7, 7,
21 21
@@ -4353,7 +4353,7 @@
[ [
"frame", "frame",
29, 29,
12, 19,
1, 1,
8, 8,
10 10
@@ -4483,7 +4483,7 @@
[ [
"frame", "frame",
39, 39,
11, 2,
1, 1,
38, 38,
20 20
@@ -4519,7 +4519,7 @@
], ],
[ [
"move", "move",
5, 7,
38, 38,
38, 38,
20 20
@@ -4534,7 +4534,7 @@
[ [
"frame", "frame",
43, 43,
11, 2,
1, 1,
39, 39,
17 17
@@ -4570,7 +4570,7 @@
], ],
[ [
"move", "move",
17, 14,
42, 42,
39, 39,
17 17
@@ -4585,7 +4585,7 @@
[ [
"frame", "frame",
47, 47,
11, 2,
1, 1,
40, 40,
16 16
@@ -4621,7 +4621,7 @@
], ],
[ [
"move", "move",
2, 4,
46, 46,
40, 40,
16 16
@@ -4636,7 +4636,7 @@
[ [
"frame", "frame",
51, 51,
11, 2,
1, 1,
41, 41,
17 17
@@ -4672,7 +4672,7 @@
], ],
[ [
"move", "move",
10, 8,
50, 50,
41, 41,
17 17
@@ -4687,7 +4687,7 @@
[ [
"frame", "frame",
55, 55,
11, 2,
1, 1,
42, 42,
22 22
@@ -4723,7 +4723,7 @@
], ],
[ [
"move", "move",
13, 16,
54, 54,
42, 42,
22 22
@@ -4738,7 +4738,7 @@
[ [
"store_field", "store_field",
1, 1,
5, 7,
57, 57,
44, 44,
11 11
@@ -4753,7 +4753,7 @@
[ [
"store_field", "store_field",
1, 1,
17, 14,
58, 58,
45, 45,
11 11
@@ -4768,7 +4768,7 @@
[ [
"store_field", "store_field",
1, 1,
2, 4,
59, 59,
46, 46,
11 11
@@ -4783,7 +4783,7 @@
[ [
"store_field", "store_field",
1, 1,
10, 8,
60, 60,
47, 47,
11 11
@@ -4798,7 +4798,7 @@
[ [
"store_field", "store_field",
1, 1,
13, 16,
61, 61,
48, 48,
11 11
@@ -4831,7 +4831,7 @@
], ],
[ [
"move", "move",
14, 15,
64, 64,
121, 121,
20 20
@@ -4845,40 +4845,40 @@
], ],
[ [
"move", "move",
18, 6,
65, 65,
122, 122,
17 17
], ],
[ [
"access", "access",
6, 9,
1, 1,
123, 123,
10 10
], ],
[ [
"null", "null",
15, 5,
124, 124,
17 17
], ],
[ [
"null", "null",
4, 10,
125, 125,
14 14
], ],
[ [
"null", "null",
19, 17,
126, 126,
11 11
], ],
"_nop_bl_1", "_nop_bl_1",
[ [
"jump_true", "jump_true",
14, 15,
"if_else_63", "if_else_63",
128, 128,
6 6
@@ -4973,7 +4973,7 @@
[ [
"is_int", "is_int",
75, 75,
6, 9,
133, 133,
20 20
], ],
@@ -4989,7 +4989,7 @@
[ [
"lt_int", "lt_int",
74, 74,
6, 9,
73, 73,
133, 133,
20 20
@@ -5004,7 +5004,7 @@
[ [
"is_num", "is_num",
75, 75,
6, 9,
133, 133,
20 20
], ],
@@ -5020,7 +5020,7 @@
[ [
"lt_float", "lt_float",
74, 74,
6, 9,
73, 73,
133, 133,
20 20
@@ -5035,7 +5035,7 @@
[ [
"is_text", "is_text",
75, 75,
6, 9,
133, 133,
20 20
], ],
@@ -5056,7 +5056,7 @@
[ [
"lt_text", "lt_text",
74, 74,
6, 9,
73, 73,
133, 133,
20 20
@@ -5096,14 +5096,14 @@
"load_dynamic", "load_dynamic",
78, 78,
77, 77,
6, 9,
134, 134,
24 24
], ],
[ [
"is_array", "is_array",
79, 79,
18, 6,
134, 134,
24 24
], ],
@@ -5116,7 +5116,7 @@
], ],
[ [
"push", "push",
18, 6,
78, 78,
134, 134,
24 24
@@ -5144,14 +5144,14 @@
[ [
"add", "add",
81, 81,
6, 9,
80, 80,
135, 135,
13 13
], ],
[ [
"move", "move",
6, 9,
81, 81,
135, 135,
13 13
@@ -5173,14 +5173,14 @@
[ [
"add", "add",
83, 83,
14, 15,
82, 82,
138, 138,
23 23
], ],
[ [
"move", "move",
15, 5,
83, 83,
138, 138,
23 23
@@ -5222,7 +5222,7 @@
[ [
"push", "push",
88, 88,
15, 5,
139, 139,
6 6
], ],
@@ -5300,7 +5300,7 @@
"setarg", "setarg",
91, 91,
1, 1,
15, 5,
139, 139,
6 6
], ],
@@ -5350,7 +5350,7 @@
"add", "add",
96, 96,
95, 95,
14, 15,
140, 140,
33 33
], ],
@@ -5371,7 +5371,7 @@
], ],
[ [
"move", "move",
15, 5,
98, 98,
140, 140,
43 43
@@ -5421,7 +5421,7 @@
[ [
"push", "push",
103, 103,
15, 5,
141, 141,
6 6
], ],
@@ -5499,7 +5499,7 @@
"setarg", "setarg",
106, 106,
1, 1,
15, 5,
141, 141,
6 6
], ],
@@ -5529,14 +5529,14 @@
[ [
"add", "add",
109, 109,
14, 15,
108, 108,
142, 142,
25 25
], ],
[ [
"move", "move",
15, 5,
109, 109,
142, 142,
25 25
@@ -5578,7 +5578,7 @@
[ [
"push", "push",
114, 114,
15, 5,
143, 143,
8 8
], ],
@@ -5656,7 +5656,7 @@
"setarg", "setarg",
117, 117,
1, 1,
15, 5,
143, 143,
8 8
], ],
@@ -5706,7 +5706,7 @@
"add", "add",
122, 122,
121, 121,
14, 15,
144, 144,
35 35
], ],
@@ -5727,7 +5727,7 @@
], ],
[ [
"move", "move",
15, 5,
124, 124,
144, 144,
45 45
@@ -5785,7 +5785,7 @@
[ [
"push", "push",
129, 129,
15, 5,
146, 146,
6 6
], ],
@@ -5863,7 +5863,7 @@
"setarg", "setarg",
132, 132,
1, 1,
15, 5,
146, 146,
6 6
], ],
@@ -5894,7 +5894,7 @@
"add", "add",
135, 135,
134, 134,
14, 15,
147, 147,
39 39
], ],
@@ -6011,7 +6011,7 @@
[ [
"push", "push",
146, 146,
15, 5,
151, 151,
15 15
], ],
@@ -6089,7 +6089,7 @@
"setarg", "setarg",
149, 149,
1, 1,
15, 5,
151, 151,
15 15
], ],
@@ -6151,7 +6151,7 @@
], ],
[ [
"move", "move",
4, 10,
150, 150,
151, 151,
10 10
@@ -6159,7 +6159,7 @@
[ [
"frame", "frame",
155, 155,
7, 11,
2, 2,
152, 152,
7 7
@@ -6182,7 +6182,7 @@
"setarg", "setarg",
155, 155,
1, 1,
4, 10,
152, 152,
7 7
], ],
@@ -6190,7 +6190,7 @@
"setarg", "setarg",
155, 155,
2, 2,
15, 5,
152, 152,
7 7
], ],
@@ -6203,7 +6203,7 @@
], ],
[ [
"move", "move",
19, 17,
154, 154,
152, 152,
7 7
@@ -6216,7 +6216,7 @@
[ [
"store_field", "store_field",
157, 157,
8, 12,
"use", "use",
153, 153,
29 29
@@ -6224,7 +6224,7 @@
[ [
"store_field", "store_field",
157, 157,
18, 6,
"args", "args",
153, 153,
43 43
@@ -6232,7 +6232,7 @@
[ [
"frame", "frame",
159, 159,
9, 13,
3, 3,
153, 153,
1 1
@@ -6255,7 +6255,7 @@
"setarg", "setarg",
159, 159,
1, 1,
14, 15,
153, 153,
1 1
], ],
@@ -6263,7 +6263,7 @@
"setarg", "setarg",
159, 159,
2, 2,
19, 17,
153, 153,
1 1
], ],

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -484,7 +484,7 @@
[ [
"get", "get",
27, 27,
1, 2,
1, 1,
167, 167,
19 19
@@ -1907,13 +1907,13 @@
], ],
[ [
"null", "null",
3, 5,
196, 196,
19 19
], ],
[ [
"null", "null",
5, 3,
197, 197,
16 16
], ],
@@ -2612,7 +2612,7 @@
[ [
"get", "get",
42, 42,
4, 5,
1, 1,
216, 216,
19 19
@@ -2627,7 +2627,7 @@
], ],
[ [
"move", "move",
3, 5,
43, 43,
216, 216,
34 34
@@ -2641,7 +2641,7 @@
[ [
"is_identical", "is_identical",
45, 45,
3, 5,
44, 44,
217, 217,
24 24
@@ -2676,7 +2676,7 @@
[ [
"is_int", "is_int",
46, 46,
3, 5,
217, 217,
24 24
], ],
@@ -2697,7 +2697,7 @@
[ [
"ne_int", "ne_int",
45, 45,
3, 5,
44, 44,
217, 217,
24 24
@@ -2712,7 +2712,7 @@
[ [
"is_num", "is_num",
46, 46,
3, 5,
217, 217,
24 24
], ],
@@ -2733,7 +2733,7 @@
[ [
"ne_float", "ne_float",
45, 45,
3, 5,
44, 44,
217, 217,
24 24
@@ -2748,7 +2748,7 @@
[ [
"is_text", "is_text",
46, 46,
3, 5,
217, 217,
24 24
], ],
@@ -2769,7 +2769,7 @@
[ [
"ne_text", "ne_text",
45, 45,
3, 5,
44, 44,
217, 217,
24 24
@@ -2784,7 +2784,7 @@
[ [
"is_null", "is_null",
46, 46,
3, 5,
217, 217,
24 24
], ],
@@ -2813,7 +2813,7 @@
[ [
"is_bool", "is_bool",
46, 46,
3, 5,
217, 217,
24 24
], ],
@@ -2834,7 +2834,7 @@
[ [
"ne_bool", "ne_bool",
45, 45,
3, 5,
44, 44,
217, 217,
24 24
@@ -2870,7 +2870,7 @@
[ [
"add", "add",
49, 49,
3, 5,
48, 48,
218, 218,
36 36
@@ -2885,7 +2885,7 @@
], ],
[ [
"move", "move",
5, 3,
50, 50,
218, 218,
36 36
@@ -2893,7 +2893,7 @@
[ [
"is_text", "is_text",
51, 51,
5, 3,
219, 219,
21 21
], ],
@@ -2915,7 +2915,7 @@
"load_dynamic", "load_dynamic",
53, 53,
2, 2,
5, 3,
219, 219,
39 39
], ],
@@ -3227,7 +3227,7 @@
[ [
"push", "push",
62, 62,
5, 3,
1, 1,
1 1
], ],
@@ -14364,7 +14364,7 @@
[ [
"get", "get",
409, 409,
7, 1,
1, 1,
348, 348,
9 9
@@ -15506,7 +15506,7 @@
], ],
[ [
"move", "move",
4, 5,
10, 10,
367, 367,
22 22
@@ -15552,13 +15552,13 @@
], ],
[ [
"null", "null",
5, 6,
372, 372,
12 12
], ],
[ [
"null", "null",
6, 4,
373, 373,
19 19
], ],
@@ -15577,7 +15577,7 @@
[ [
"is_identical", "is_identical",
14, 14,
4, 5,
13, 13,
376, 376,
23 23
@@ -15592,7 +15592,7 @@
[ [
"is_int", "is_int",
15, 15,
4, 5,
376, 376,
23 23
], ],
@@ -15613,7 +15613,7 @@
[ [
"eq_int", "eq_int",
14, 14,
4, 5,
13, 13,
376, 376,
23 23
@@ -15628,7 +15628,7 @@
[ [
"is_num", "is_num",
15, 15,
4, 5,
376, 376,
23 23
], ],
@@ -15649,7 +15649,7 @@
[ [
"eq_float", "eq_float",
14, 14,
4, 5,
13, 13,
376, 376,
23 23
@@ -15664,7 +15664,7 @@
[ [
"is_text", "is_text",
15, 15,
4, 5,
376, 376,
23 23
], ],
@@ -15685,7 +15685,7 @@
[ [
"eq_text", "eq_text",
14, 14,
4, 5,
13, 13,
376, 376,
23 23
@@ -15700,7 +15700,7 @@
[ [
"is_null", "is_null",
15, 15,
4, 5,
376, 376,
23 23
], ],
@@ -15729,7 +15729,7 @@
[ [
"is_bool", "is_bool",
15, 15,
4, 5,
376, 376,
23 23
], ],
@@ -15750,7 +15750,7 @@
[ [
"eq_bool", "eq_bool",
14, 14,
4, 5,
13, 13,
376, 376,
23 23
@@ -15789,7 +15789,7 @@
[ [
"length", "length",
17, 17,
4, 5,
379, 379,
21 21
], ],
@@ -15907,7 +15907,7 @@
[ [
"load_dynamic", "load_dynamic",
21, 21,
4, 5,
8, 8,
380, 380,
26 26
@@ -16087,7 +16087,7 @@
[ [
"length", "length",
33, 33,
4, 5,
389, 389,
21 21
], ],
@@ -16205,7 +16205,7 @@
[ [
"load_dynamic", "load_dynamic",
37, 37,
4, 5,
8, 8,
390, 390,
26 26
@@ -16248,7 +16248,7 @@
], ],
[ [
"move", "move",
5, 6,
40, 40,
392, 392,
18 18
@@ -16256,7 +16256,7 @@
[ [
"get", "get",
41, 41,
4, 5,
1, 1,
393, 393,
19 19
@@ -16265,13 +16265,13 @@
"load_dynamic", "load_dynamic",
42, 42,
41, 41,
5, 6,
393, 393,
34 34
], ],
[ [
"move", "move",
6, 4,
42, 42,
393, 393,
34 34
@@ -16285,7 +16285,7 @@
[ [
"is_identical", "is_identical",
44, 44,
6, 4,
43, 43,
394, 394,
24 24
@@ -16320,7 +16320,7 @@
[ [
"is_int", "is_int",
45, 45,
6, 4,
394, 394,
24 24
], ],
@@ -16341,7 +16341,7 @@
[ [
"ne_int", "ne_int",
44, 44,
6, 4,
43, 43,
394, 394,
24 24
@@ -16356,7 +16356,7 @@
[ [
"is_num", "is_num",
45, 45,
6, 4,
394, 394,
24 24
], ],
@@ -16377,7 +16377,7 @@
[ [
"ne_float", "ne_float",
44, 44,
6, 4,
43, 43,
394, 394,
24 24
@@ -16392,7 +16392,7 @@
[ [
"is_text", "is_text",
45, 45,
6, 4,
394, 394,
24 24
], ],
@@ -16413,7 +16413,7 @@
[ [
"ne_text", "ne_text",
44, 44,
6, 4,
43, 43,
394, 394,
24 24
@@ -16428,7 +16428,7 @@
[ [
"is_null", "is_null",
45, 45,
6, 4,
394, 394,
24 24
], ],
@@ -16457,7 +16457,7 @@
[ [
"is_bool", "is_bool",
45, 45,
6, 4,
394, 394,
24 24
], ],
@@ -16478,7 +16478,7 @@
[ [
"ne_bool", "ne_bool",
44, 44,
6, 4,
43, 43,
394, 394,
24 24
@@ -16514,7 +16514,7 @@
[ [
"add", "add",
48, 48,
6, 4,
47, 47,
395, 395,
36 36
@@ -16844,7 +16844,7 @@
[ [
"push", "push",
61, 61,
5, 6,
1, 1,
1 1
], ],
@@ -17612,7 +17612,7 @@
[ [
"get", "get",
26, 26,
5, 3,
1, 1,
415, 415,
18 18
@@ -17959,7 +17959,7 @@
[ [
"get", "get",
45, 45,
2, 4,
1, 1,
422, 422,
18 18
@@ -18306,7 +18306,7 @@
[ [
"get", "get",
64, 64,
3, 6,
1, 1,
429, 429,
18 18
@@ -18653,7 +18653,7 @@
[ [
"get", "get",
83, 83,
6, 7,
1, 1,
436, 436,
18 18
@@ -23255,7 +23255,7 @@
], ],
[ [
"move", "move",
1, 2,
9, 9,
108, 108,
15 15
@@ -24317,7 +24317,7 @@
], ],
[ [
"move", "move",
7, 1,
306, 306,
133, 133,
16 16
@@ -24389,7 +24389,7 @@
], ],
[ [
"move", "move",
4, 5,
382, 382,
144, 144,
18 18
@@ -24403,7 +24403,7 @@
], ],
[ [
"move", "move",
5, 3,
387, 387,
149, 149,
25 25
@@ -24417,7 +24417,7 @@
], ],
[ [
"move", "move",
2, 4,
388, 388,
189, 189,
26 26
@@ -24431,7 +24431,7 @@
], ],
[ [
"move", "move",
3, 6,
389, 389,
231, 231,
30 30
@@ -24445,7 +24445,7 @@
], ],
[ [
"move", "move",
6, 7,
390, 390,
366, 366,
29 29
@@ -24480,7 +24480,7 @@
[ [
"store_field", "store_field",
392, 392,
5, 3,
"check_slot_bounds", "check_slot_bounds",
448, 448,
22 22
@@ -24488,7 +24488,7 @@
[ [
"store_field", "store_field",
392, 392,
2, 4,
"check_jump_targets", "check_jump_targets",
449, 449,
23 23
@@ -24496,7 +24496,7 @@
[ [
"store_field", "store_field",
392, 392,
3, 6,
"check_type_consistency", "check_type_consistency",
450, 450,
27 27
@@ -24504,7 +24504,7 @@
[ [
"store_field", "store_field",
392, 392,
6, 7,
"check_nop_consistency", "check_nop_consistency",
451, 451,
26 26

View File

@@ -1082,6 +1082,11 @@ struct JSContext {
uint8_t *heap_end; /* end of block */ uint8_t *heap_end; /* end of block */
size_t current_block_size; /* current block size (64KB initially) */ size_t current_block_size; /* current block size (64KB initially) */
size_t next_block_size; /* doubles if <10% recovered after GC */ size_t next_block_size; /* doubles if <10% recovered after GC */
int gc_poor_streak; /* consecutive poor-recovery GC cycles */
/* GC stats (lightweight, always on) */
uint64_t gc_count; /* number of GC cycles */
uint64_t gc_bytes_copied; /* total bytes copied across all GCs */
/* Constant text pool — compilation constants */ /* Constant text pool — compilation constants */
uint8_t *ct_base; /* pool base */ uint8_t *ct_base; /* pool base */

View File

@@ -1678,6 +1678,10 @@ int ctx_gc (JSContext *ctx, int allow_grow, size_t alloc_size) {
/* Update context with new block */ /* Update context with new block */
size_t new_used = to_free - to_base; size_t new_used = to_free - to_base;
/* Update GC stats */
ctx->gc_count++;
ctx->gc_bytes_copied += new_used;
size_t recovered = old_used > new_used ? old_used - new_used : 0; size_t recovered = old_used > new_used ? old_used - new_used : 0;
ctx->heap_base = to_base; ctx->heap_base = to_base;
@@ -1697,19 +1701,23 @@ int ctx_gc (JSContext *ctx, int allow_grow, size_t alloc_size) {
} }
#endif #endif
/* If <20% recovered, double next block size for future allocations /* If <40% recovered, grow next block size for future allocations.
But only if allow_grow is set (i.e., GC was triggered due to low space) */ First poor recovery: double. Consecutive poor: quadruple. */
#ifdef DUMP_GC #ifdef DUMP_GC
int will_grow = 0; int will_grow = 0;
#endif #endif
if (allow_grow && recovered > 0 && old_used > 0 && recovered < old_used / 5) { if (allow_grow && recovered > 0 && old_used > 0 && recovered < old_used * 2 / 5) {
size_t doubled = new_size * 2; size_t factor = ctx->gc_poor_streak >= 1 ? 4 : 2;
if (doubled <= buddy_max_block(&ctx->rt->buddy)) { size_t grown = new_size * factor;
ctx->next_block_size = doubled; if (grown <= buddy_max_block(&ctx->rt->buddy)) {
ctx->next_block_size = grown;
#ifdef DUMP_GC #ifdef DUMP_GC
will_grow = 1; will_grow = 1;
#endif #endif
} }
ctx->gc_poor_streak++;
} else {
ctx->gc_poor_streak = 0;
} }
#ifdef DUMP_GC #ifdef DUMP_GC
@@ -1855,6 +1863,20 @@ JSContext *JS_NewContextRawWithHeapSize (JSRuntime *rt, size_t heap_size) {
/* Initialize per-context execution state (moved from JSRuntime) */ /* Initialize per-context execution state (moved from JSRuntime) */
ctx->current_exception = JS_NULL; ctx->current_exception = JS_NULL;
/* Initialize constant text pool (avoids overflow pages for common case) */
{
size_t ct_pool_size = 64 * 1024; /* 64KB initial CT pool */
ctx->ct_base = js_malloc_rt (ct_pool_size);
if (!ctx->ct_base) {
js_free_rt (ctx->class_array);
js_free_rt (ctx->class_proto);
js_free_rt (ctx);
return NULL;
}
ctx->ct_free = ctx->ct_base;
ctx->ct_end = ctx->ct_base + ct_pool_size;
}
/* Initialize constant text intern table */ /* Initialize constant text intern table */
ctx->ct_pages = NULL; ctx->ct_pages = NULL;
ctx->ct_array = NULL; ctx->ct_array = NULL;
@@ -1944,6 +1966,7 @@ void JS_FreeContext (JSContext *ctx) {
/* Free constant text pool and intern table */ /* Free constant text pool and intern table */
ct_free_all (ctx); ct_free_all (ctx);
if (ctx->ct_base) js_free_rt (ctx->ct_base);
js_free_rt (ctx->ct_hash); js_free_rt (ctx->ct_hash);
js_free_rt (ctx->ct_array); js_free_rt (ctx->ct_array);
@@ -9757,6 +9780,22 @@ static JSValue js_mach_dump_mcode (JSContext *ctx, JSValue this_val, int argc, J
return JS_NULL; return JS_NULL;
} }
/* gc_stats() — return {count, bytes_copied, heap_size, ct_pages} and reset counters */
static JSValue js_gc_stats (JSContext *ctx, JSValue this_val, int argc, JSValue *argv) {
JSValue obj = JS_NewObject (ctx);
if (JS_IsException (obj)) return obj;
JS_SetPropertyStr (ctx, obj, "count", JS_NewInt64 (ctx, (int64_t)ctx->gc_count));
JS_SetPropertyStr (ctx, obj, "bytes_copied", JS_NewInt64 (ctx, (int64_t)ctx->gc_bytes_copied));
JS_SetPropertyStr (ctx, obj, "heap_size", JS_NewInt64 (ctx, (int64_t)ctx->current_block_size));
/* Count CT overflow pages */
int ct_page_count = 0;
for (CTPage *p = (CTPage *)ctx->ct_pages; p; p = p->next) ct_page_count++;
JS_SetPropertyStr (ctx, obj, "ct_pages", JS_NewInt32 (ctx, ct_page_count));
ctx->gc_count = 0;
ctx->gc_bytes_copied = 0;
return obj;
}
/* mach_compile_mcode_bin(name, mcode_json) - compile mcode IR to serialized binary blob */ /* mach_compile_mcode_bin(name, mcode_json) - compile mcode IR to serialized binary blob */
static JSValue js_mach_compile_mcode_bin (JSContext *ctx, JSValue this_val, int argc, JSValue *argv) { static JSValue js_mach_compile_mcode_bin (JSContext *ctx, JSValue this_val, int argc, JSValue *argv) {
if (argc < 2 || !JS_IsText (argv[0]) || !JS_IsText (argv[1])) if (argc < 2 || !JS_IsText (argv[0]) || !JS_IsText (argv[1]))
@@ -10849,6 +10888,7 @@ static void JS_AddIntrinsicBaseObjects (JSContext *ctx) {
js_set_global_cfunc(ctx, "mach_eval_mcode", js_mach_eval_mcode, 3); js_set_global_cfunc(ctx, "mach_eval_mcode", js_mach_eval_mcode, 3);
js_set_global_cfunc(ctx, "mach_dump_mcode", js_mach_dump_mcode, 3); js_set_global_cfunc(ctx, "mach_dump_mcode", js_mach_dump_mcode, 3);
js_set_global_cfunc(ctx, "mach_compile_mcode_bin", js_mach_compile_mcode_bin, 2); js_set_global_cfunc(ctx, "mach_compile_mcode_bin", js_mach_compile_mcode_bin, 2);
js_set_global_cfunc(ctx, "gc_stats", js_gc_stats, 0);
js_set_global_cfunc(ctx, "stone", js_cell_stone, 1); js_set_global_cfunc(ctx, "stone", js_cell_stone, 1);
js_set_global_cfunc(ctx, "length", js_cell_length, 1); js_set_global_cfunc(ctx, "length", js_cell_length, 1);
js_set_global_cfunc(ctx, "call", js_cell_call, 3); js_set_global_cfunc(ctx, "call", js_cell_call, 3);