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",
7,
21,
22,
1,
7,
10
@@ -102,7 +102,7 @@
[
"get",
3,
16,
17,
1,
21,
15
@@ -790,7 +790,7 @@
[
"get",
3,
5,
10,
1,
40,
7
@@ -813,7 +813,7 @@
[
"get",
5,
5,
10,
1,
41,
12
@@ -916,7 +916,7 @@
[
"get",
14,
17,
18,
1,
42,
16
@@ -968,7 +968,7 @@
[
"get",
17,
5,
10,
1,
43,
3
@@ -1075,13 +1075,13 @@
],
[
"null",
6,
5,
53,
20
],
[
"null",
5,
6,
54,
19
],
@@ -1424,7 +1424,7 @@
[
"get",
38,
12,
11,
1,
58,
14
@@ -1887,7 +1887,7 @@
],
[
"move",
6,
5,
64,
62,
18
@@ -1937,7 +1937,7 @@
"setarg",
70,
2,
6,
5,
63,
17
],
@@ -1950,7 +1950,7 @@
],
[
"move",
5,
6,
68,
63,
17
@@ -1965,7 +1965,7 @@
[
"get",
73,
1,
2,
1,
65,
7
@@ -2051,7 +2051,7 @@
[
"push",
81,
5,
6,
66,
7
],
@@ -2137,7 +2137,7 @@
"setarg",
84,
2,
5,
6,
66,
7
],
@@ -2194,7 +2194,7 @@
"setarg",
87,
1,
5,
6,
68,
12
],
@@ -4200,7 +4200,7 @@
[
"get",
14,
2,
3,
1,
130,
20
@@ -4268,7 +4268,7 @@
[
"get",
18,
2,
3,
1,
131,
57
@@ -4276,7 +4276,7 @@
[
"get",
20,
19,
20,
1,
131,
13
@@ -6482,7 +6482,7 @@
[
"get",
9,
3,
4,
1,
172,
18
@@ -6560,7 +6560,7 @@
[
"get",
14,
15,
16,
1,
174,
9
@@ -6783,7 +6783,7 @@
[
"get",
20,
10,
8,
1,
175,
47
@@ -6791,7 +6791,7 @@
[
"get",
22,
20,
21,
1,
175,
24
@@ -6844,7 +6844,7 @@
[
"put",
21,
15,
16,
1,
175,
24
@@ -6874,7 +6874,7 @@
[
"get",
26,
15,
16,
1,
178,
28
@@ -6898,7 +6898,7 @@
[
"get",
28,
22,
23,
1,
180,
19
@@ -6985,7 +6985,7 @@
[
"get",
35,
23,
24,
1,
186,
20
@@ -7119,7 +7119,7 @@
"call_done_134",
[
"move",
6,
5,
34,
186,
20
@@ -7169,7 +7169,7 @@
"setarg",
45,
2,
6,
5,
187,
19
],
@@ -7182,7 +7182,7 @@
],
[
"move",
5,
6,
43,
187,
19
@@ -7224,7 +7224,7 @@
"setarg",
49,
1,
5,
6,
188,
10
],
@@ -7264,7 +7264,7 @@
[
"get",
8,
3,
4,
1,
193,
18
@@ -7316,7 +7316,7 @@
[
"get",
12,
23,
24,
1,
194,
20
@@ -7450,7 +7450,7 @@
"call_done_136",
[
"move",
6,
5,
11,
194,
20
@@ -7500,7 +7500,7 @@
"setarg",
22,
2,
6,
5,
195,
19
],
@@ -7513,7 +7513,7 @@
],
[
"move",
5,
6,
20,
195,
19
@@ -7555,7 +7555,7 @@
"setarg",
26,
1,
5,
6,
196,
10
],
@@ -7595,7 +7595,7 @@
[
"get",
6,
3,
4,
1,
201,
18
@@ -7647,7 +7647,7 @@
[
"get",
10,
22,
23,
1,
202,
19
@@ -7699,7 +7699,7 @@
[
"get",
14,
23,
24,
1,
203,
39
@@ -8319,7 +8319,7 @@
[
"get",
37,
12,
11,
1,
219,
14
@@ -8867,7 +8867,7 @@
[
"get",
73,
1,
2,
1,
226,
7
@@ -9417,7 +9417,7 @@
[
"get",
111,
18,
19,
1,
235,
10
@@ -9503,7 +9503,7 @@
],
[
"move",
17,
18,
28,
0,
0
@@ -9531,7 +9531,7 @@
],
[
"move",
12,
11,
30,
0,
0
@@ -9545,7 +9545,7 @@
],
[
"move",
1,
2,
31,
0,
0
@@ -9559,7 +9559,7 @@
],
[
"move",
25,
26,
32,
0,
0
@@ -9573,7 +9573,7 @@
],
[
"move",
20,
21,
33,
0,
0
@@ -9615,7 +9615,7 @@
],
[
"move",
18,
19,
36,
0,
0
@@ -9629,7 +9629,7 @@
],
[
"move",
11,
15,
37,
0,
0
@@ -9643,7 +9643,7 @@
],
[
"move",
26,
1,
38,
0,
0
@@ -9657,7 +9657,7 @@
],
[
"move",
8,
12,
39,
0,
0
@@ -9683,7 +9683,7 @@
],
[
"move",
21,
22,
41,
5,
21
@@ -9698,7 +9698,7 @@
[
"frame",
44,
17,
18,
1,
10,
10
@@ -9749,7 +9749,7 @@
[
"frame",
48,
17,
18,
1,
11,
12
@@ -9785,7 +9785,7 @@
],
[
"move",
23,
24,
47,
11,
12
@@ -9800,7 +9800,7 @@
[
"frame",
52,
17,
18,
1,
12,
14
@@ -9836,7 +9836,7 @@
],
[
"move",
16,
17,
51,
12,
14
@@ -9848,7 +9848,7 @@
],
[
"move",
5,
10,
54,
14,
17
@@ -9862,7 +9862,7 @@
],
[
"store_field",
5,
10,
14,
55,
15,
@@ -9888,7 +9888,7 @@
],
[
"store_field",
5,
10,
56,
57,
16,
@@ -9903,8 +9903,8 @@
],
[
"store_field",
5,
23,
10,
24,
58,
17,
11
@@ -9918,8 +9918,8 @@
],
[
"store_field",
5,
16,
10,
17,
59,
18,
11
@@ -9932,14 +9932,14 @@
[
"store_field",
60,
25,
26,
"use",
74,
22
],
[
"move",
10,
8,
60,
74,
22
@@ -9954,7 +9954,7 @@
[
"frame",
63,
20,
21,
2,
75,
20
@@ -9985,7 +9985,7 @@
"setarg",
63,
2,
10,
8,
75,
20
],
@@ -9998,7 +9998,7 @@
],
[
"move",
2,
3,
62,
75,
20
@@ -10013,7 +10013,7 @@
[
"frame",
67,
20,
21,
2,
76,
17
@@ -10044,7 +10044,7 @@
"setarg",
67,
2,
10,
8,
76,
17
],
@@ -10057,7 +10057,7 @@
],
[
"move",
19,
20,
66,
76,
17
@@ -10072,7 +10072,7 @@
[
"frame",
71,
20,
21,
2,
77,
16
@@ -10103,7 +10103,7 @@
"setarg",
71,
2,
10,
8,
77,
16
],
@@ -10130,8 +10130,8 @@
],
[
"store_field",
5,
2,
10,
3,
73,
78,
11
@@ -10145,8 +10145,8 @@
],
[
"store_field",
5,
19,
10,
20,
74,
79,
11
@@ -10160,7 +10160,7 @@
],
[
"store_field",
5,
10,
13,
75,
80,
@@ -10176,7 +10176,7 @@
[
"frame",
78,
20,
21,
2,
83,
17
@@ -10207,7 +10207,7 @@
"setarg",
78,
2,
10,
8,
83,
17
],
@@ -10220,7 +10220,7 @@
],
[
"move",
3,
4,
77,
83,
17
@@ -10234,15 +10234,15 @@
],
[
"store_field",
5,
3,
10,
4,
80,
84,
11
],
[
"null",
22,
23,
85,
22
],
@@ -10285,7 +10285,7 @@
[
"frame",
86,
20,
21,
2,
164,
18
@@ -10316,7 +10316,7 @@
"setarg",
86,
2,
10,
8,
164,
18
],
@@ -10329,7 +10329,7 @@
],
[
"move",
22,
23,
85,
164,
18
@@ -10343,21 +10343,21 @@
],
[
"store_field",
5,
22,
10,
23,
88,
165,
11
],
[
"null",
15,
16,
168,
22
],
[
"null",
24,
25,
240,
15
],
@@ -10377,7 +10377,7 @@
],
[
"access",
4,
5,
0,
242,
10
@@ -10649,7 +10649,7 @@
],
[
"move",
24,
25,
97,
246,
18
@@ -10657,7 +10657,7 @@
"_nop_bl_1",
[
"jump_true",
24,
25,
"if_else_168",
247,
8
@@ -10739,7 +10739,7 @@
],
[
"move",
4,
5,
104,
251,
8
@@ -10766,7 +10766,7 @@
[
"is_int",
108,
4,
5,
252,
22
],
@@ -10782,7 +10782,7 @@
[
"lt_int",
107,
4,
5,
106,
252,
22
@@ -10797,7 +10797,7 @@
[
"is_num",
108,
4,
5,
252,
22
],
@@ -10813,7 +10813,7 @@
[
"lt_float",
107,
4,
5,
106,
252,
22
@@ -10828,7 +10828,7 @@
[
"is_text",
108,
4,
5,
252,
22
],
@@ -10849,7 +10849,7 @@
[
"lt_text",
107,
4,
5,
106,
252,
22
@@ -10889,7 +10889,7 @@
"load_dynamic",
111,
110,
4,
5,
253,
26
],
@@ -10937,14 +10937,14 @@
[
"add",
114,
4,
5,
113,
254,
15
],
[
"move",
4,
5,
114,
254,
15
@@ -11007,7 +11007,7 @@
[
"store_field",
118,
24,
25,
"program",
259,
21
@@ -11069,7 +11069,7 @@
[
"store_field",
115,
23,
24,
"json",
260,
55
@@ -11085,7 +11085,7 @@
[
"store_field",
115,
18,
19,
"run_ast_fn",
261,
35
@@ -11093,7 +11093,7 @@
[
"store_field",
115,
11,
15,
"run_ast_noopt_fn",
261,
62
@@ -11101,7 +11101,7 @@
[
"store_field",
115,
5,
10,
"use_cache",
262,
16
@@ -11117,7 +11117,7 @@
[
"store_field",
115,
12,
11,
"cache_path",
263,
45
@@ -11125,7 +11125,7 @@
[
"store_field",
115,
1,
2,
"ensure_build_dir",
264,
23
@@ -11133,7 +11133,7 @@
[
"store_field",
115,
26,
1,
"compile_to_blob_fn",
264,
61
@@ -11141,7 +11141,7 @@
[
"frame",
122,
8,
12,
1,
257,
3
@@ -11285,7 +11285,7 @@
[
"store_field",
124,
23,
24,
"json",
270,
55
@@ -11339,7 +11339,7 @@
[
"store_field",
124,
18,
19,
"run_ast_fn",
271,
35
@@ -11347,7 +11347,7 @@
[
"store_field",
124,
11,
15,
"run_ast_noopt_fn",
271,
62
@@ -11355,7 +11355,7 @@
[
"store_field",
124,
5,
10,
"use_cache",
272,
16
@@ -11371,7 +11371,7 @@
[
"store_field",
124,
12,
11,
"cache_path",
273,
45
@@ -11379,7 +11379,7 @@
[
"store_field",
124,
1,
2,
"ensure_build_dir",
274,
23
@@ -11387,7 +11387,7 @@
[
"store_field",
124,
26,
1,
"compile_to_blob_fn",
274,
61
@@ -11395,7 +11395,7 @@
[
"frame",
133,
8,
12,
1,
268,
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",
18,
12,
19,
1,
18,
16
@@ -764,7 +764,7 @@
[
"get",
42,
16,
18,
1,
35,
50
@@ -862,7 +862,7 @@
[
"get",
9,
5,
7,
1,
51,
20
@@ -930,7 +930,7 @@
[
"get",
13,
5,
7,
1,
52,
57
@@ -938,7 +938,7 @@
[
"get",
15,
17,
14,
1,
52,
13
@@ -2234,7 +2234,7 @@
[
"get",
77,
2,
4,
1,
68,
10
@@ -2297,7 +2297,7 @@
[
"get",
8,
10,
8,
1,
72,
18
@@ -2349,7 +2349,7 @@
[
"get",
12,
13,
16,
1,
73,
19
@@ -2820,7 +2820,7 @@
[
"get",
23,
12,
19,
1,
89,
12
@@ -3297,7 +3297,7 @@
[
"get",
56,
8,
12,
1,
99,
54
@@ -3970,7 +3970,7 @@
[
"get",
103,
7,
11,
1,
110,
11
@@ -4035,7 +4035,7 @@
[
"get",
107,
8,
12,
1,
111,
39
@@ -4051,7 +4051,7 @@
[
"get",
109,
9,
13,
1,
111,
14
@@ -4256,7 +4256,7 @@
],
[
"move",
16,
18,
20,
0,
0
@@ -4270,7 +4270,7 @@
],
[
"move",
11,
2,
21,
0,
0
@@ -4284,7 +4284,7 @@
],
[
"move",
7,
11,
22,
0,
0
@@ -4298,7 +4298,7 @@
],
[
"move",
9,
13,
23,
0,
0
@@ -4312,7 +4312,7 @@
],
[
"move",
8,
12,
24,
0,
0
@@ -4338,7 +4338,7 @@
],
[
"move",
12,
19,
26,
7,
21
@@ -4353,7 +4353,7 @@
[
"frame",
29,
12,
19,
1,
8,
10
@@ -4483,7 +4483,7 @@
[
"frame",
39,
11,
2,
1,
38,
20
@@ -4519,7 +4519,7 @@
],
[
"move",
5,
7,
38,
38,
20
@@ -4534,7 +4534,7 @@
[
"frame",
43,
11,
2,
1,
39,
17
@@ -4570,7 +4570,7 @@
],
[
"move",
17,
14,
42,
39,
17
@@ -4585,7 +4585,7 @@
[
"frame",
47,
11,
2,
1,
40,
16
@@ -4621,7 +4621,7 @@
],
[
"move",
2,
4,
46,
40,
16
@@ -4636,7 +4636,7 @@
[
"frame",
51,
11,
2,
1,
41,
17
@@ -4672,7 +4672,7 @@
],
[
"move",
10,
8,
50,
41,
17
@@ -4687,7 +4687,7 @@
[
"frame",
55,
11,
2,
1,
42,
22
@@ -4723,7 +4723,7 @@
],
[
"move",
13,
16,
54,
42,
22
@@ -4738,7 +4738,7 @@
[
"store_field",
1,
5,
7,
57,
44,
11
@@ -4753,7 +4753,7 @@
[
"store_field",
1,
17,
14,
58,
45,
11
@@ -4768,7 +4768,7 @@
[
"store_field",
1,
2,
4,
59,
46,
11
@@ -4783,7 +4783,7 @@
[
"store_field",
1,
10,
8,
60,
47,
11
@@ -4798,7 +4798,7 @@
[
"store_field",
1,
13,
16,
61,
48,
11
@@ -4831,7 +4831,7 @@
],
[
"move",
14,
15,
64,
121,
20
@@ -4845,40 +4845,40 @@
],
[
"move",
18,
6,
65,
122,
17
],
[
"access",
6,
9,
1,
123,
10
],
[
"null",
15,
5,
124,
17
],
[
"null",
4,
10,
125,
14
],
[
"null",
19,
17,
126,
11
],
"_nop_bl_1",
[
"jump_true",
14,
15,
"if_else_63",
128,
6
@@ -4973,7 +4973,7 @@
[
"is_int",
75,
6,
9,
133,
20
],
@@ -4989,7 +4989,7 @@
[
"lt_int",
74,
6,
9,
73,
133,
20
@@ -5004,7 +5004,7 @@
[
"is_num",
75,
6,
9,
133,
20
],
@@ -5020,7 +5020,7 @@
[
"lt_float",
74,
6,
9,
73,
133,
20
@@ -5035,7 +5035,7 @@
[
"is_text",
75,
6,
9,
133,
20
],
@@ -5056,7 +5056,7 @@
[
"lt_text",
74,
6,
9,
73,
133,
20
@@ -5096,14 +5096,14 @@
"load_dynamic",
78,
77,
6,
9,
134,
24
],
[
"is_array",
79,
18,
6,
134,
24
],
@@ -5116,7 +5116,7 @@
],
[
"push",
18,
6,
78,
134,
24
@@ -5144,14 +5144,14 @@
[
"add",
81,
6,
9,
80,
135,
13
],
[
"move",
6,
9,
81,
135,
13
@@ -5173,14 +5173,14 @@
[
"add",
83,
14,
15,
82,
138,
23
],
[
"move",
15,
5,
83,
138,
23
@@ -5222,7 +5222,7 @@
[
"push",
88,
15,
5,
139,
6
],
@@ -5300,7 +5300,7 @@
"setarg",
91,
1,
15,
5,
139,
6
],
@@ -5350,7 +5350,7 @@
"add",
96,
95,
14,
15,
140,
33
],
@@ -5371,7 +5371,7 @@
],
[
"move",
15,
5,
98,
140,
43
@@ -5421,7 +5421,7 @@
[
"push",
103,
15,
5,
141,
6
],
@@ -5499,7 +5499,7 @@
"setarg",
106,
1,
15,
5,
141,
6
],
@@ -5529,14 +5529,14 @@
[
"add",
109,
14,
15,
108,
142,
25
],
[
"move",
15,
5,
109,
142,
25
@@ -5578,7 +5578,7 @@
[
"push",
114,
15,
5,
143,
8
],
@@ -5656,7 +5656,7 @@
"setarg",
117,
1,
15,
5,
143,
8
],
@@ -5706,7 +5706,7 @@
"add",
122,
121,
14,
15,
144,
35
],
@@ -5727,7 +5727,7 @@
],
[
"move",
15,
5,
124,
144,
45
@@ -5785,7 +5785,7 @@
[
"push",
129,
15,
5,
146,
6
],
@@ -5863,7 +5863,7 @@
"setarg",
132,
1,
15,
5,
146,
6
],
@@ -5894,7 +5894,7 @@
"add",
135,
134,
14,
15,
147,
39
],
@@ -6011,7 +6011,7 @@
[
"push",
146,
15,
5,
151,
15
],
@@ -6089,7 +6089,7 @@
"setarg",
149,
1,
15,
5,
151,
15
],
@@ -6151,7 +6151,7 @@
],
[
"move",
4,
10,
150,
151,
10
@@ -6159,7 +6159,7 @@
[
"frame",
155,
7,
11,
2,
152,
7
@@ -6182,7 +6182,7 @@
"setarg",
155,
1,
4,
10,
152,
7
],
@@ -6190,7 +6190,7 @@
"setarg",
155,
2,
15,
5,
152,
7
],
@@ -6203,7 +6203,7 @@
],
[
"move",
19,
17,
154,
152,
7
@@ -6216,7 +6216,7 @@
[
"store_field",
157,
8,
12,
"use",
153,
29
@@ -6224,7 +6224,7 @@
[
"store_field",
157,
18,
6,
"args",
153,
43
@@ -6232,7 +6232,7 @@
[
"frame",
159,
9,
13,
3,
153,
1
@@ -6255,7 +6255,7 @@
"setarg",
159,
1,
14,
15,
153,
1
],
@@ -6263,7 +6263,7 @@
"setarg",
159,
2,
19,
17,
153,
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",
27,
1,
2,
1,
167,
19
@@ -1907,13 +1907,13 @@
],
[
"null",
3,
5,
196,
19
],
[
"null",
5,
3,
197,
16
],
@@ -2612,7 +2612,7 @@
[
"get",
42,
4,
5,
1,
216,
19
@@ -2627,7 +2627,7 @@
],
[
"move",
3,
5,
43,
216,
34
@@ -2641,7 +2641,7 @@
[
"is_identical",
45,
3,
5,
44,
217,
24
@@ -2676,7 +2676,7 @@
[
"is_int",
46,
3,
5,
217,
24
],
@@ -2697,7 +2697,7 @@
[
"ne_int",
45,
3,
5,
44,
217,
24
@@ -2712,7 +2712,7 @@
[
"is_num",
46,
3,
5,
217,
24
],
@@ -2733,7 +2733,7 @@
[
"ne_float",
45,
3,
5,
44,
217,
24
@@ -2748,7 +2748,7 @@
[
"is_text",
46,
3,
5,
217,
24
],
@@ -2769,7 +2769,7 @@
[
"ne_text",
45,
3,
5,
44,
217,
24
@@ -2784,7 +2784,7 @@
[
"is_null",
46,
3,
5,
217,
24
],
@@ -2813,7 +2813,7 @@
[
"is_bool",
46,
3,
5,
217,
24
],
@@ -2834,7 +2834,7 @@
[
"ne_bool",
45,
3,
5,
44,
217,
24
@@ -2870,7 +2870,7 @@
[
"add",
49,
3,
5,
48,
218,
36
@@ -2885,7 +2885,7 @@
],
[
"move",
5,
3,
50,
218,
36
@@ -2893,7 +2893,7 @@
[
"is_text",
51,
5,
3,
219,
21
],
@@ -2915,7 +2915,7 @@
"load_dynamic",
53,
2,
5,
3,
219,
39
],
@@ -3227,7 +3227,7 @@
[
"push",
62,
5,
3,
1,
1
],
@@ -14364,7 +14364,7 @@
[
"get",
409,
7,
1,
1,
348,
9
@@ -15506,7 +15506,7 @@
],
[
"move",
4,
5,
10,
367,
22
@@ -15552,13 +15552,13 @@
],
[
"null",
5,
6,
372,
12
],
[
"null",
6,
4,
373,
19
],
@@ -15577,7 +15577,7 @@
[
"is_identical",
14,
4,
5,
13,
376,
23
@@ -15592,7 +15592,7 @@
[
"is_int",
15,
4,
5,
376,
23
],
@@ -15613,7 +15613,7 @@
[
"eq_int",
14,
4,
5,
13,
376,
23
@@ -15628,7 +15628,7 @@
[
"is_num",
15,
4,
5,
376,
23
],
@@ -15649,7 +15649,7 @@
[
"eq_float",
14,
4,
5,
13,
376,
23
@@ -15664,7 +15664,7 @@
[
"is_text",
15,
4,
5,
376,
23
],
@@ -15685,7 +15685,7 @@
[
"eq_text",
14,
4,
5,
13,
376,
23
@@ -15700,7 +15700,7 @@
[
"is_null",
15,
4,
5,
376,
23
],
@@ -15729,7 +15729,7 @@
[
"is_bool",
15,
4,
5,
376,
23
],
@@ -15750,7 +15750,7 @@
[
"eq_bool",
14,
4,
5,
13,
376,
23
@@ -15789,7 +15789,7 @@
[
"length",
17,
4,
5,
379,
21
],
@@ -15907,7 +15907,7 @@
[
"load_dynamic",
21,
4,
5,
8,
380,
26
@@ -16087,7 +16087,7 @@
[
"length",
33,
4,
5,
389,
21
],
@@ -16205,7 +16205,7 @@
[
"load_dynamic",
37,
4,
5,
8,
390,
26
@@ -16248,7 +16248,7 @@
],
[
"move",
5,
6,
40,
392,
18
@@ -16256,7 +16256,7 @@
[
"get",
41,
4,
5,
1,
393,
19
@@ -16265,13 +16265,13 @@
"load_dynamic",
42,
41,
5,
6,
393,
34
],
[
"move",
6,
4,
42,
393,
34
@@ -16285,7 +16285,7 @@
[
"is_identical",
44,
6,
4,
43,
394,
24
@@ -16320,7 +16320,7 @@
[
"is_int",
45,
6,
4,
394,
24
],
@@ -16341,7 +16341,7 @@
[
"ne_int",
44,
6,
4,
43,
394,
24
@@ -16356,7 +16356,7 @@
[
"is_num",
45,
6,
4,
394,
24
],
@@ -16377,7 +16377,7 @@
[
"ne_float",
44,
6,
4,
43,
394,
24
@@ -16392,7 +16392,7 @@
[
"is_text",
45,
6,
4,
394,
24
],
@@ -16413,7 +16413,7 @@
[
"ne_text",
44,
6,
4,
43,
394,
24
@@ -16428,7 +16428,7 @@
[
"is_null",
45,
6,
4,
394,
24
],
@@ -16457,7 +16457,7 @@
[
"is_bool",
45,
6,
4,
394,
24
],
@@ -16478,7 +16478,7 @@
[
"ne_bool",
44,
6,
4,
43,
394,
24
@@ -16514,7 +16514,7 @@
[
"add",
48,
6,
4,
47,
395,
36
@@ -16844,7 +16844,7 @@
[
"push",
61,
5,
6,
1,
1
],
@@ -17612,7 +17612,7 @@
[
"get",
26,
5,
3,
1,
415,
18
@@ -17959,7 +17959,7 @@
[
"get",
45,
2,
4,
1,
422,
18
@@ -18306,7 +18306,7 @@
[
"get",
64,
3,
6,
1,
429,
18
@@ -18653,7 +18653,7 @@
[
"get",
83,
6,
7,
1,
436,
18
@@ -23255,7 +23255,7 @@
],
[
"move",
1,
2,
9,
108,
15
@@ -24317,7 +24317,7 @@
],
[
"move",
7,
1,
306,
133,
16
@@ -24389,7 +24389,7 @@
],
[
"move",
4,
5,
382,
144,
18
@@ -24403,7 +24403,7 @@
],
[
"move",
5,
3,
387,
149,
25
@@ -24417,7 +24417,7 @@
],
[
"move",
2,
4,
388,
189,
26
@@ -24431,7 +24431,7 @@
],
[
"move",
3,
6,
389,
231,
30
@@ -24445,7 +24445,7 @@
],
[
"move",
6,
7,
390,
366,
29
@@ -24480,7 +24480,7 @@
[
"store_field",
392,
5,
3,
"check_slot_bounds",
448,
22
@@ -24488,7 +24488,7 @@
[
"store_field",
392,
2,
4,
"check_jump_targets",
449,
23
@@ -24496,7 +24496,7 @@
[
"store_field",
392,
3,
6,
"check_type_consistency",
450,
27
@@ -24504,7 +24504,7 @@
[
"store_field",
392,
6,
7,
"check_nop_consistency",
451,
26

View File

@@ -1082,6 +1082,11 @@ struct JSContext {
uint8_t *heap_end; /* end of block */
size_t current_block_size; /* current block size (64KB initially) */
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 */
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 */
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;
ctx->heap_base = to_base;
@@ -1697,19 +1701,23 @@ int ctx_gc (JSContext *ctx, int allow_grow, size_t alloc_size) {
}
#endif
/* If <20% recovered, double next block size for future allocations
But only if allow_grow is set (i.e., GC was triggered due to low space) */
/* If <40% recovered, grow next block size for future allocations.
First poor recovery: double. Consecutive poor: quadruple. */
#ifdef DUMP_GC
int will_grow = 0;
#endif
if (allow_grow && recovered > 0 && old_used > 0 && recovered < old_used / 5) {
size_t doubled = new_size * 2;
if (doubled <= buddy_max_block(&ctx->rt->buddy)) {
ctx->next_block_size = doubled;
if (allow_grow && recovered > 0 && old_used > 0 && recovered < old_used * 2 / 5) {
size_t factor = ctx->gc_poor_streak >= 1 ? 4 : 2;
size_t grown = new_size * factor;
if (grown <= buddy_max_block(&ctx->rt->buddy)) {
ctx->next_block_size = grown;
#ifdef DUMP_GC
will_grow = 1;
#endif
}
ctx->gc_poor_streak++;
} else {
ctx->gc_poor_streak = 0;
}
#ifdef DUMP_GC
@@ -1855,6 +1863,20 @@ JSContext *JS_NewContextRawWithHeapSize (JSRuntime *rt, size_t heap_size) {
/* Initialize per-context execution state (moved from JSRuntime) */
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 */
ctx->ct_pages = NULL;
ctx->ct_array = NULL;
@@ -1944,6 +1966,7 @@ void JS_FreeContext (JSContext *ctx) {
/* Free constant text pool and intern table */
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_array);
@@ -9757,6 +9780,22 @@ static JSValue js_mach_dump_mcode (JSContext *ctx, JSValue this_val, int argc, J
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 */
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]))
@@ -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_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, "gc_stats", js_gc_stats, 0);
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, "call", js_cell_call, 3);