no more special case for core C

This commit is contained in:
2026-02-14 22:00:12 -06:00
parent 86609c27f8
commit eee06009b9
38 changed files with 14471 additions and 14967 deletions

View File

@@ -103,6 +103,10 @@ var v = a[] // pop: v is 3, a is [1, 2]
- Most files don't have headers; files in a package are not shared between packages
- No undefined in C API: use `JS_IsNull` and `JS_NULL` only
- A C file with correct macros (`CELL_USE_FUNCS` etc) is loaded as a module by its name (e.g., `png.c` in a package → `use('<package>/png')`)
- C symbol naming: `js_<pkg>_<file>_use` (e.g., `js_core_math_radians_use` for `core/math/radians`)
- Core is the `core` package — its symbols follow the same `js_core_<name>_use` pattern as all other packages
- Package directories should contain only source files (no `.mach`/`.mcode` alongside source)
- Build cache files in `build/` are bare hashes (no extensions)
## Project Layout

View File

@@ -379,7 +379,7 @@ static const JSCFunctionListEntry js_reader_funcs[] = {
JS_CFUNC_DEF("count", 0, js_reader_count),
};
JSValue js_miniz_use(JSContext *js)
JSValue js_core_miniz_use(JSContext *js)
{
JS_NewClassID(&js_reader_class_id);
JS_NewClass(js, js_reader_class_id, &js_reader_class);

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

@@ -447,7 +447,7 @@
"nr_slots": 11,
"nr_close_slots": 0,
"instructions": [
["get", 3, 16, 1, 1, 1],
["get", 3, 66, 1, 1, 1],
["array", 4, 0, 1, 1],
["push", 4, 1, 1, 1],
["push", 4, 2, 1, 1],
@@ -507,7 +507,7 @@
"nr_slots": 11,
"nr_close_slots": 0,
"instructions": [
["get", 3, 16, 1, 1, 1],
["get", 3, 66, 1, 1, 1],
["array", 4, 0, 1, 1],
["push", 4, 1, 1, 1],
["push", 4, 2, 1, 1],
@@ -702,8 +702,8 @@
"nr_slots": 14,
"nr_close_slots": 0,
"instructions": [
["get", 5, 52, 1, 1, 1],
["get", 6, 4, 1, 1, 1],
["get", 5, 42, 1, 1, 1],
["get", 6, 13, 1, 1, 1],
["array", 7, 0, 1, 1],
["push", 7, 1, 1, 1],
["push", 7, 1, 1, 1],
@@ -815,8 +815,8 @@
"nr_slots": 14,
"nr_close_slots": 0,
"instructions": [
["get", 5, 52, 1, 1, 1],
["get", 6, 4, 1, 1, 1],
["get", 5, 42, 1, 1, 1],
["get", 6, 13, 1, 1, 1],
["array", 7, 0, 1, 1],
["push", 7, 1, 1, 1],
["push", 7, 1, 1, 1],
@@ -911,8 +911,8 @@
"nr_slots": 14,
"nr_close_slots": 0,
"instructions": [
["get", 5, 52, 1, 1, 1],
["get", 6, 4, 1, 1, 1],
["get", 5, 42, 1, 1, 1],
["get", 6, 13, 1, 1, 1],
["array", 7, 0, 1, 1],
["push", 7, 1, 1, 1],
["push", 7, 1, 1, 1],
@@ -1211,12 +1211,12 @@
["move", 8, 11, 408, 20],
["get", 12, 23, 1, 409, 25],
["load_field", 13, 12, "float_id", 409, 25],
["move", 7, 13, 409, 25],
["move", 6, 13, 409, 25],
["access", 9, 0, 410, 17],
["get", 14, 45, 1, 411, 22],
["move", 5, 14, 411, 22],
["get", 15, 45, 1, 412, 18],
["move", 6, 15, 412, 18],
["move", 7, 15, 412, 18],
["get", 16, 23, 1, 413, 7],
["load_field", 17, 16, "is_eq", 413, 7],
["move", 18, 17, 413, 7],
@@ -1234,7 +1234,7 @@
["get", 22, 23, 1, 416, 7],
["load_field", 23, 22, "is_ne", 416, 7],
["jump_false", 23, "if_else_3", 416, 7],
["get", 24, 64, 1, 417, 20],
["get", 24, 65, 1, 417, 20],
["move", 5, 24, 417, 20],
["jump", "if_end_4", 417, 20],
"if_else_3",
@@ -1242,8 +1242,8 @@
["get", 25, 23, 1, 419, 7],
["load_field", 26, 25, "null_true", 419, 7],
["jump_false", 26, "if_else_5", 419, 7],
["get", 27, 64, 1, 420, 16],
["move", 6, 27, 420, 16],
["get", 27, 65, 1, 420, 16],
["move", 7, 27, 420, 16],
["jump", "if_end_6", 420, 16],
"if_else_5",
"if_end_6",
@@ -1296,7 +1296,7 @@
["push", 28, 1, 1, 1],
["push", 28, 1, 1, 1],
["push", 28, 1, 1, 1],
["push", 28, 6, 1, 1],
["push", 28, 7, 1, 1],
["push", 28, 1, 1, 1],
["push", 28, 1, 1, 1],
["push", 28, 1, 1, 1],
@@ -1343,7 +1343,7 @@
["push", 28, 1, 1, 1],
["push", 28, 1, 1, 1],
["push", 28, 2, 1, 1],
["push", 28, 7, 1, 1],
["push", 28, 6, 1, 1],
["push", 28, 3, 1, 1],
["push", 28, 4, 1, 1],
["push", 28, 1, 1, 1],
@@ -1609,7 +1609,7 @@
"nr_slots": 12,
"nr_close_slots": 0,
"instructions": [
["get", 4, 52, 1, 1, 1],
["get", 4, 42, 1, 1, 1],
["array", 5, 0, 1, 1],
["push", 5, 1, 1, 1],
["push", 5, 1, 1, 1],
@@ -1683,7 +1683,7 @@
"nr_slots": 12,
"nr_close_slots": 0,
"instructions": [
["get", 4, 4, 1, 1, 1],
["get", 4, 13, 1, 1, 1],
["array", 5, 0, 1, 1],
["push", 5, 1, 1, 1],
["push", 5, 1, 1, 1],
@@ -1757,7 +1757,7 @@
"nr_slots": 12,
"nr_close_slots": 0,
"instructions": [
["get", 4, 52, 1, 1, 1],
["get", 4, 42, 1, 1, 1],
["array", 5, 0, 1, 1],
["push", 5, 1, 1, 1],
["push", 5, 1, 1, 1],
@@ -2167,7 +2167,7 @@
"instructions": [
["access", 5, "shl", 716, 10],
["put", 5, 48, 1, 716, 10],
["get", 7, 37, 1, 717, 10],
["get", 7, 36, 1, 717, 10],
["frame", 8, 7, 4, 717, 10],
["null", 9, 717, 10],
["setarg", 8, 0, 9, 717, 10],
@@ -2191,7 +2191,7 @@
"instructions": [
["access", 5, "sar", 721, 10],
["put", 5, 48, 1, 721, 10],
["get", 7, 37, 1, 722, 10],
["get", 7, 36, 1, 722, 10],
["frame", 8, 7, 4, 722, 10],
["null", 9, 722, 10],
["setarg", 8, 0, 9, 722, 10],
@@ -2215,7 +2215,7 @@
"instructions": [
["access", 5, "shr", 726, 10],
["put", 5, 48, 1, 726, 10],
["get", 7, 37, 1, 727, 10],
["get", 7, 36, 1, 727, 10],
["frame", 8, 7, 4, 727, 10],
["null", 9, 727, 10],
["setarg", 8, 0, 9, 727, 10],
@@ -2508,7 +2508,7 @@
"instructions": [
["access", 5, 0, 772, 48],
["put", 5, 48, 1, 772, 48],
["get", 7, 30, 1, 772, 58],
["get", 7, 29, 1, 772, 58],
["frame", 8, 7, 4, 772, 58],
["null", 9, 772, 58],
["setarg", 8, 0, 9, 772, 58],
@@ -2532,7 +2532,7 @@
"instructions": [
["access", 5, 1, 773, 48],
["put", 5, 48, 1, 773, 48],
["get", 7, 30, 1, 773, 58],
["get", 7, 29, 1, 773, 58],
["frame", 8, 7, 4, 773, 58],
["null", 9, 773, 58],
["setarg", 8, 0, 9, 773, 58],
@@ -2556,7 +2556,7 @@
"instructions": [
["access", 5, 2, 774, 48],
["put", 5, 48, 1, 774, 48],
["get", 7, 30, 1, 774, 58],
["get", 7, 29, 1, 774, 58],
["frame", 8, 7, 4, 774, 58],
["null", 9, 774, 58],
["setarg", 8, 0, 9, 774, 58],
@@ -2580,7 +2580,7 @@
"instructions": [
["access", 5, 3, 775, 48],
["put", 5, 48, 1, 775, 48],
["get", 7, 30, 1, 775, 58],
["get", 7, 29, 1, 775, 58],
["frame", 8, 7, 4, 775, 58],
["null", 9, 775, 58],
["setarg", 8, 0, 9, 775, 58],
@@ -2604,7 +2604,7 @@
"instructions": [
["access", 5, 4, 776, 48],
["put", 5, 48, 1, 776, 48],
["get", 7, 30, 1, 776, 58],
["get", 7, 29, 1, 776, 58],
["frame", 8, 7, 4, 776, 58],
["null", 9, 776, 58],
["setarg", 8, 0, 9, 776, 58],
@@ -2628,7 +2628,7 @@
"instructions": [
["access", 5, 5, 777, 48],
["put", 5, 48, 1, 777, 48],
["get", 7, 30, 1, 777, 58],
["get", 7, 29, 1, 777, 58],
["frame", 8, 7, 4, 777, 58],
["null", 9, 777, 58],
["setarg", 8, 0, 9, 777, 58],
@@ -2652,7 +2652,7 @@
"instructions": [
["get", 7, 48, 1, 782, 16],
["move", 5, 7, 782, 16],
["get", 8, 34, 1, 783, 17],
["get", 8, 33, 1, 783, 17],
["move", 6, 8, 783, 17],
["array", 9, 0, 1, 1],
["push", 9, 1, 1, 1],
@@ -2703,8 +2703,8 @@
["access", 5, "ceqw", 792, 47],
["put", 5, 48, 1, 792, 47],
["access", 6, 1, 792, 63],
["put", 6, 34, 1, 792, 63],
["get", 8, 9, 1, 792, 73],
["put", 6, 33, 1, 792, 63],
["get", 8, 7, 1, 792, 73],
["frame", 9, 8, 4, 792, 73],
["null", 10, 792, 73],
["setarg", 9, 0, 10, 792, 73],
@@ -2729,8 +2729,8 @@
["access", 5, "cnew", 793, 47],
["put", 5, 48, 1, 793, 47],
["access", 6, 1, 793, 63],
["put", 6, 34, 1, 793, 63],
["get", 8, 9, 1, 793, 73],
["put", 6, 33, 1, 793, 63],
["get", 8, 7, 1, 793, 73],
["frame", 9, 8, 4, 793, 73],
["null", 10, 793, 73],
["setarg", 9, 0, 10, 793, 73],
@@ -2755,8 +2755,8 @@
["access", 5, "csltw", 794, 47],
["put", 5, 48, 1, 794, 47],
["access", 6, 0, 794, 64],
["put", 6, 34, 1, 794, 64],
["get", 8, 9, 1, 794, 74],
["put", 6, 33, 1, 794, 64],
["get", 8, 7, 1, 794, 74],
["frame", 9, 8, 4, 794, 74],
["null", 10, 794, 74],
["setarg", 9, 0, 10, 794, 74],
@@ -2781,8 +2781,8 @@
["access", 5, "cslew", 795, 47],
["put", 5, 48, 1, 795, 47],
["access", 6, 0, 795, 64],
["put", 6, 34, 1, 795, 64],
["get", 8, 9, 1, 795, 74],
["put", 6, 33, 1, 795, 64],
["get", 8, 7, 1, 795, 74],
["frame", 9, 8, 4, 795, 74],
["null", 10, 795, 74],
["setarg", 9, 0, 10, 795, 74],
@@ -2807,8 +2807,8 @@
["access", 5, "csgtw", 796, 47],
["put", 5, 48, 1, 796, 47],
["access", 6, 0, 796, 64],
["put", 6, 34, 1, 796, 64],
["get", 8, 9, 1, 796, 74],
["put", 6, 33, 1, 796, 64],
["get", 8, 7, 1, 796, 74],
["frame", 9, 8, 4, 796, 74],
["null", 10, 796, 74],
["setarg", 9, 0, 10, 796, 74],
@@ -2833,8 +2833,8 @@
["access", 5, "csgew", 797, 47],
["put", 5, 48, 1, 797, 47],
["access", 6, 0, 797, 64],
["put", 6, 34, 1, 797, 64],
["get", 8, 9, 1, 797, 74],
["put", 6, 33, 1, 797, 64],
["get", 8, 7, 1, 797, 74],
["frame", 9, 8, 4, 797, 74],
["null", 10, 797, 74],
["setarg", 9, 0, 10, 797, 74],
@@ -2982,29 +2982,29 @@
"instructions": [
["access", 10, 7, 10, 15],
["access", 45, 3, 11, 16],
["access", 64, 35, 12, 15],
["access", 46, 15, 13, 20],
["access", 47, 27, 14, 21],
["access", 65, 35, 12, 15],
["access", 47, 15, 13, 20],
["access", 16, 27, 14, 21],
["null", 48, 17, 12],
["null", 34, 18, 13],
["null", 33, 18, 13],
["null", 23, 19, 15],
["access", 52, -2147483648, 21, 17],
["access", 4, 2147483647, 22, 17],
["access", 16, 4503599627370495, 23, 21],
["access", 42, -2147483648, 21, 17],
["access", 13, 2147483647, 22, 17],
["access", 66, 4503599627370495, 23, 21],
["function", 78, 0, 29, 14],
["move", 76, 78, 29, 14],
["function", 79, 1, 35, 17],
["move", 14, 79, 35, 17],
["move", 53, 79, 35, 17],
["function", 80, 2, 44, 15],
["move", 58, 80, 44, 15],
["function", 81, 3, 50, 15],
["move", 35, 81, 50, 15],
["move", 34, 81, 50, 15],
["function", 82, 4, 56, 20],
["move", 53, 82, 56, 20],
["move", 52, 82, 56, 20],
["function", 83, 5, 62, 14],
["move", 25, 83, 62, 14],
["function", 84, 6, 68, 19],
["move", 27, 84, 68, 19],
["move", 31, 84, 68, 19],
["function", 85, 7, 74, 15],
["move", 15, 85, 74, 15],
["function", 86, 8, 110, 15],
@@ -3012,25 +3012,25 @@
["function", 87, 9, 117, 16],
["move", 72, 87, 117, 16],
["function", 88, 10, 124, 15],
["move", 13, 88, 124, 15],
["move", 14, 88, 124, 15],
["function", 89, 11, 131, 19],
["move", 65, 89, 131, 19],
["move", 62, 89, 131, 19],
["function", 90, 12, 149, 18],
["move", 75, 90, 149, 18],
["function", 91, 13, 186, 15],
["move", 44, 91, 186, 15],
["move", 43, 91, 186, 15],
["function", 92, 14, 193, 16],
["move", 66, 92, 193, 16],
["move", 67, 92, 193, 16],
["function", 93, 15, 201, 19],
["move", 70, 93, 201, 19],
["move", 8, 93, 201, 19],
["function", 94, 16, 212, 11],
["move", 41, 94, 212, 11],
["move", 40, 94, 212, 11],
["function", 95, 17, 254, 11],
["move", 5, 95, 254, 11],
["function", 96, 18, 288, 11],
["move", 1, 96, 288, 11],
["function", 97, 19, 322, 11],
["move", 55, 97, 322, 11],
["move", 54, 97, 322, 11],
["function", 98, 20, 366, 11],
["move", 2, 98, 366, 11],
["function", 99, 21, 407, 11],
@@ -3038,43 +3038,43 @@
["function", 100, 22, 494, 10],
["move", 71, 100, 494, 10],
["function", 101, 23, 499, 10],
["move", 67, 101, 499, 10],
["move", 68, 101, 499, 10],
["function", 102, 24, 504, 10],
["move", 49, 102, 504, 10],
["function", 103, 25, 509, 10],
["move", 42, 103, 509, 10],
["move", 41, 103, 509, 10],
["function", 104, 26, 514, 10],
["move", 68, 104, 514, 10],
["move", 69, 104, 514, 10],
["function", 105, 27, 519, 10],
["move", 69, 105, 519, 10],
["move", 70, 105, 519, 10],
["function", 106, 28, 528, 11],
["move", 56, 106, 528, 11],
["move", 55, 106, 528, 11],
["function", 107, 29, 555, 11],
["move", 26, 107, 555, 11],
["function", 108, 30, 582, 11],
["move", 29, 108, 582, 11],
["move", 28, 108, 582, 11],
["function", 109, 31, 609, 12],
["move", 36, 109, 609, 12],
["move", 35, 109, 609, 12],
["function", 110, 32, 619, 12],
["move", 59, 110, 619, 12],
["function", 111, 33, 643, 18],
["move", 6, 111, 643, 18],
["function", 112, 34, 670, 12],
["move", 31, 112, 670, 12],
["move", 30, 112, 670, 12],
["function", 113, 35, 675, 11],
["move", 61, 113, 675, 11],
["function", 114, 36, 680, 12],
["move", 51, 114, 680, 12],
["function", 115, 37, 687, 16],
["move", 37, 115, 687, 16],
["move", 36, 115, 687, 16],
["function", 116, 38, 715, 11],
["move", 57, 116, 715, 11],
["move", 56, 116, 715, 11],
["function", 117, 39, 720, 11],
["move", 73, 117, 720, 11],
["function", 118, 40, 725, 12],
["move", 3, 118, 725, 12],
["function", 119, 41, 736, 14],
["move", 7, 119, 736, 14],
["move", 4, 119, 736, 14],
["function", 120, 42, 742, 15],
["move", 19, 120, 742, 15],
["function", 121, 43, 754, 14],
@@ -3084,112 +3084,112 @@
["function", 123, 45, 756, 14],
["move", 22, 123, 756, 14],
["function", 124, 46, 757, 14],
["move", 28, 124, 757, 14],
["move", 27, 124, 757, 14],
["function", 125, 47, 758, 14],
["move", 74, 125, 758, 14],
["function", 126, 48, 759, 14],
["move", 8, 126, 759, 14],
["move", 9, 126, 759, 14],
["function", 127, 49, 763, 17],
["move", 30, 127, 763, 17],
["move", 29, 127, 763, 17],
["function", 128, 50, 772, 16],
["move", 77, 128, 772, 16],
["function", 129, 51, 773, 16],
["move", 38, 129, 773, 16],
["move", 37, 129, 773, 16],
["function", 130, 52, 774, 16],
["move", 39, 130, 774, 16],
["move", 38, 130, 774, 16],
["function", 131, 53, 775, 16],
["move", 62, 131, 775, 16],
["move", 63, 131, 775, 16],
["function", 132, 54, 776, 16],
["move", 40, 132, 776, 16],
["move", 39, 132, 776, 16],
["function", 133, 55, 777, 16],
["move", 50, 133, 777, 16],
["function", 134, 56, 781, 16],
["move", 9, 134, 781, 16],
["move", 7, 134, 781, 16],
["function", 135, 57, 792, 15],
["move", 20, 135, 792, 15],
["function", 136, 58, 793, 15],
["move", 33, 136, 793, 15],
["move", 44, 136, 793, 15],
["function", 137, 59, 794, 15],
["move", 21, 137, 794, 15],
["function", 138, 60, 795, 15],
["move", 17, 138, 795, 15],
["function", 139, 61, 796, 15],
["move", 43, 139, 796, 15],
["move", 46, 139, 796, 15],
["function", 140, 62, 797, 15],
["move", 12, 140, 797, 15],
["function", 141, 63, 800, 15],
["move", 60, 141, 800, 15],
["function", 142, 64, 808, 15],
["move", 54, 142, 808, 15],
["move", 57, 142, 808, 15],
["function", 143, 65, 817, 20],
["move", 63, 143, 817, 20],
["move", 64, 143, 817, 20],
["record", 144, 0],
["store_field", 144, 10, "js_null", 831, 12],
["store_field", 144, 45, "js_false", 832, 13],
["store_field", 144, 64, "js_true", 833, 12],
["store_field", 144, 65, "js_true", 833, 12],
["access", 145, 15, 834, 17],
["store_field", 144, 145, "js_exception", 834, 17],
["store_field", 144, 47, "js_empty_text", 835, 18],
["store_field", 144, 16, "js_empty_text", 835, 18],
["store_field", 144, 76, "is_int", 837, 11],
["store_field", 144, 14, "is_number", 838, 14],
["store_field", 144, 53, "is_number", 838, 14],
["store_field", 144, 58, "is_null", 839, 12],
["store_field", 144, 35, "is_bool", 840, 12],
["store_field", 144, 53, "is_exception", 841, 17],
["store_field", 144, 34, "is_bool", 840, 12],
["store_field", 144, 52, "is_exception", 841, 17],
["store_field", 144, 25, "is_ptr", 842, 11],
["store_field", 144, 27, "is_imm_text", 843, 16],
["store_field", 144, 31, "is_imm_text", 843, 16],
["store_field", 144, 15, "is_text", 844, 12],
["store_field", 144, 11, "get_int", 846, 12],
["store_field", 144, 72, "get_bool", 847, 13],
["store_field", 144, 13, "get_ptr", 848, 12],
["store_field", 144, 65, "get_float64", 849, 16],
["store_field", 144, 14, "get_ptr", 848, 12],
["store_field", 144, 62, "get_float64", 849, 16],
["store_field", 144, 75, "to_float64", 850, 15],
["store_field", 144, 44, "new_int", 852, 12],
["store_field", 144, 66, "new_bool", 853, 13],
["store_field", 144, 70, "new_float64", 854, 16],
["store_field", 144, 41, "add", 856, 8],
["store_field", 144, 43, "new_int", 852, 12],
["store_field", 144, 67, "new_bool", 853, 13],
["store_field", 144, 8, "new_float64", 854, 16],
["store_field", 144, 40, "add", 856, 8],
["store_field", 144, 5, "sub", 857, 8],
["store_field", 144, 1, "mul", 858, 8],
["store_field", 144, 55, "div", 859, 8],
["store_field", 144, 54, "div", 859, 8],
["store_field", 144, 2, "mod", 860, 8],
["store_field", 144, 71, "eq", 862, 7],
["store_field", 144, 67, "ne", 863, 7],
["store_field", 144, 68, "ne", 863, 7],
["store_field", 144, 49, "lt", 864, 7],
["store_field", 144, 42, "le", 865, 7],
["store_field", 144, 68, "gt", 866, 7],
["store_field", 144, 69, "ge", 867, 7],
["store_field", 144, 56, "neg", 869, 8],
["store_field", 144, 41, "le", 865, 7],
["store_field", 144, 69, "gt", 866, 7],
["store_field", 144, 70, "ge", 867, 7],
["store_field", 144, 55, "neg", 869, 8],
["store_field", 144, 26, "inc", 870, 8],
["store_field", 144, 29, "dec", 871, 8],
["store_field", 144, 36, "lnot", 872, 9],
["store_field", 144, 28, "dec", 871, 8],
["store_field", 144, 35, "lnot", 872, 9],
["store_field", 144, 59, "bnot", 873, 9],
["store_field", 144, 31, "band", 875, 9],
["store_field", 144, 30, "band", 875, 9],
["store_field", 144, 61, "bor", 876, 8],
["store_field", 144, 51, "bxor", 877, 9],
["store_field", 144, 57, "shl", 878, 8],
["store_field", 144, 56, "shl", 878, 8],
["store_field", 144, 73, "shr", 879, 8],
["store_field", 144, 3, "ushr", 880, 9],
["store_field", 144, 7, "concat", 882, 11],
["store_field", 144, 4, "concat", 882, 11],
["store_field", 144, 24, "eq_int", 884, 11],
["store_field", 144, 18, "ne_int", 885, 11],
["store_field", 144, 22, "lt_int", 886, 11],
["store_field", 144, 28, "le_int", 887, 11],
["store_field", 144, 27, "le_int", 887, 11],
["store_field", 144, 74, "gt_int", 888, 11],
["store_field", 144, 8, "ge_int", 889, 11],
["store_field", 144, 9, "ge_int", 889, 11],
["store_field", 144, 77, "eq_float", 891, 13],
["store_field", 144, 38, "ne_float", 892, 13],
["store_field", 144, 39, "lt_float", 893, 13],
["store_field", 144, 62, "le_float", 894, 13],
["store_field", 144, 40, "gt_float", 895, 13],
["store_field", 144, 37, "ne_float", 892, 13],
["store_field", 144, 38, "lt_float", 893, 13],
["store_field", 144, 63, "le_float", 894, 13],
["store_field", 144, 39, "gt_float", 895, 13],
["store_field", 144, 50, "ge_float", 896, 13],
["store_field", 144, 20, "eq_text", 898, 12],
["store_field", 144, 33, "ne_text", 899, 12],
["store_field", 144, 44, "ne_text", 899, 12],
["store_field", 144, 21, "lt_text", 900, 12],
["store_field", 144, 17, "le_text", 901, 12],
["store_field", 144, 43, "gt_text", 902, 12],
["store_field", 144, 46, "gt_text", 902, 12],
["store_field", 144, 12, "ge_text", 903, 12],
["store_field", 144, 60, "eq_bool", 905, 12],
["store_field", 144, 54, "ne_bool", 906, 12],
["store_field", 144, 63, "is_identical", 908, 17],
["store_field", 144, 57, "ne_bool", 906, 12],
["store_field", 144, 64, "is_identical", 908, 17],
["return", 144, 908, 17],
"_nop_ur_1",
"_nop_ur_2"

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
// Hidden env: os, core_path, shop_path, args, json
var load_internal = os.load_internal
var fd = load_internal("js_fd_use")
var fd = load_internal("js_core_internal_fd_use")
var use_cache = {}
use_cache['fd'] = fd
@@ -15,7 +15,7 @@ use_cache['json'] = json
function use_basic(path) {
if (use_cache[path])
return use_cache[path]
var result = load_internal("js_" + replace(path, '/', '_') + "_use")
var result = load_internal("js_core_" + replace(path, '/', '_') + "_use")
if (result) {
use_cache[path] = result
return result
@@ -86,7 +86,7 @@ function use_fn(path) {
return use_cache[path]
// Try C embed
result = load_internal("js_" + replace(path, '/', '_') + "_use")
result = load_internal("js_core_" + replace(path, '/', '_') + "_use")
if (result) {
use_cache[path] = result
return result

View File

@@ -15,9 +15,9 @@
"_nop_ur_1",
"if_else_0",
"if_end_1",
["access", 7, "js_", 18, 30],
["access", 8, "/", 18, 52],
["access", 9, "_", 18, 57],
["access", 7, "js_core_", 18, 30],
["access", 8, "/", 18, 57],
["access", 9, "_", 18, 62],
[
"access",
11,
@@ -27,19 +27,19 @@
"make": "intrinsic"
},
18,
38
43
],
["frame", 12, 11, 3, 18, 38],
["null", 13, 18, 38],
["setarg", 12, 0, 13, 18, 38],
["setarg", 12, 1, 1, 18, 38],
["setarg", 12, 2, 8, 18, 38],
["setarg", 12, 3, 9, 18, 38],
["invoke", 12, 10, 18, 38],
["add", 14, 7, 10, 18, 38],
["access", 15, "_use", 18, 64],
["add", 16, 14, 15, 18, 64],
["get", 18, 9, 1, 18, 16],
["frame", 12, 11, 3, 18, 43],
["null", 13, 18, 43],
["setarg", 12, 0, 13, 18, 43],
["setarg", 12, 1, 1, 18, 43],
["setarg", 12, 2, 8, 18, 43],
["setarg", 12, 3, 9, 18, 43],
["invoke", 12, 10, 18, 43],
["add", 14, 7, 10, 18, 43],
["access", 15, "_use", 18, 69],
["add", 16, 14, 15, 18, 69],
["get", 18, 15, 1, 18, 16],
["frame", 19, 18, 1, 18, 16],
["null", 20, 18, 16],
["setarg", 19, 0, 20, 18, 16],
@@ -85,7 +85,7 @@
["add", 9, 7, 8, 28, 50],
["move", 2, 9, 28, 50],
["null", 3, 29, 20],
["get", 11, 4, 1, 30, 8],
["get", 11, 3, 1, 30, 8],
["is_proxy", 12, 11, 30, 8],
["jump_false", 12, "record_path_6", 30, 8],
["null", 13, 30, 8],
@@ -131,7 +131,7 @@
["jump", "if_end_5", 32, 5],
"if_else_4",
"if_end_5",
["get", 29, 4, 1, 34, 21],
["get", 29, 3, 1, 34, 21],
["is_proxy", 30, 29, 34, 21],
["jump_false", 30, "record_path_8", 34, 21],
["null", 31, 34, 21],
@@ -169,7 +169,7 @@
["invoke", 39, 37, 34, 16],
["move", 3, 37, 34, 16],
["record", 41, 0],
["get", 42, 3, 1, 35, 50],
["get", 42, 19, 1, 35, 50],
["store_field", 41, 42, "use", 35, 50],
[
"access",
@@ -212,7 +212,7 @@
["move", 3, 8, 51, 20],
["load_field", 12, 3, "tokens", 52, 23],
["get", 13, 6, 1, 52, 57],
["get", 15, 17, 1, 52, 13],
["get", 15, 13, 1, 52, 13],
["frame", 16, 15, 4, 52, 13],
["null", 17, 52, 13],
["setarg", 16, 0, 17, 52, 13],
@@ -522,7 +522,7 @@
"nr_slots": 29,
"nr_close_slots": 0,
"instructions": [
["get", 8, 14, 1, 72, 18],
["get", 8, 9, 1, 72, 18],
["frame", 9, 8, 1, 72, 18],
["null", 10, 72, 18],
["setarg", 9, 0, 10, 72, 18],
@@ -535,7 +535,7 @@
["setarg", 13, 0, 14, 73, 19],
["setarg", 13, 1, 4, 73, 19],
["invoke", 13, 11, 73, 19],
["move", 6, 11, 73, 19],
["move", 5, 11, 73, 19],
[
"access",
16,
@@ -552,7 +552,7 @@
["null", 18, 74, 20],
["access", 19, "encode", 74, 20],
["array", 20, 0, 74, 20],
["push", 20, 6, 74, 20],
["push", 20, 5, 74, 20],
["frame", 21, 16, 2, 74, 20],
["setarg", 21, 0, 18, 74, 20],
["setarg", 21, 1, 19, 74, 20],
@@ -563,10 +563,10 @@
["load_field", 22, 16, "encode", 74, 20],
["frame", 23, 22, 1, 74, 20],
["setarg", 23, 0, 16, 74, 20],
["setarg", 23, 1, 6, 74, 20],
["setarg", 23, 1, 5, 74, 20],
["invoke", 23, 15, 74, 20],
"call_done_42",
["move", 5, 15, 74, 20],
["move", 6, 15, 74, 20],
[
"access",
25,
@@ -582,7 +582,7 @@
["null", 27, 75, 10],
["setarg", 26, 0, 27, 75, 10],
["setarg", 26, 1, 1, 75, 10],
["setarg", 26, 2, 5, 75, 10],
["setarg", 26, 2, 6, 75, 10],
["setarg", 26, 3, 3, 75, 10],
["tail_invoke", 26, 24, 75, 10],
["return", 24, 75, 10],
@@ -599,9 +599,9 @@
"nr_close_slots": 0,
"instructions": [
["null", 2, 79, 16],
["null", 4, 80, 19],
["null", 6, 80, 19],
["null", 3, 81, 16],
["null", 6, 82, 13],
["null", 4, 82, 13],
["null", 7, 83, 20],
["null", 5, 84, 20],
["get", 8, 1, 1, 85, 7],
@@ -613,9 +613,9 @@
"_nop_ur_1",
"if_else_43",
"if_end_44",
["access", 12, "js_", 89, 26],
["access", 13, "/", 89, 48],
["access", 14, "_", 89, 53],
["access", 12, "js_core_", 89, 26],
["access", 13, "/", 89, 53],
["access", 14, "_", 89, 58],
[
"access",
16,
@@ -625,19 +625,19 @@
"make": "intrinsic"
},
89,
34
39
],
["frame", 17, 16, 3, 89, 34],
["null", 18, 89, 34],
["setarg", 17, 0, 18, 89, 34],
["setarg", 17, 1, 1, 89, 34],
["setarg", 17, 2, 13, 89, 34],
["setarg", 17, 3, 14, 89, 34],
["invoke", 17, 15, 89, 34],
["add", 19, 12, 15, 89, 34],
["access", 20, "_use", 89, 60],
["add", 21, 19, 20, 89, 60],
["get", 23, 9, 1, 89, 12],
["frame", 17, 16, 3, 89, 39],
["null", 18, 89, 39],
["setarg", 17, 0, 18, 89, 39],
["setarg", 17, 1, 1, 89, 39],
["setarg", 17, 2, 13, 89, 39],
["setarg", 17, 3, 14, 89, 39],
["invoke", 17, 15, 89, 39],
["add", 19, 12, 15, 89, 39],
["access", 20, "_use", 89, 65],
["add", 21, 19, 20, 89, 65],
["get", 23, 15, 1, 89, 12],
["frame", 24, 23, 1, 89, 12],
["null", 25, 89, 12],
["setarg", 24, 0, 25, 89, 12],
@@ -668,7 +668,7 @@
["access", 31, ".cm.mcode", 96, 46],
["add", 32, 30, 31, 96, 46],
["move", 7, 32, 96, 46],
["get", 34, 4, 1, 97, 7],
["get", 34, 3, 1, 97, 7],
["is_proxy", 35, 34, 97, 7],
["jump_false", 35, "record_path_49", 97, 7],
["null", 36, 97, 7],
@@ -689,7 +689,7 @@
["invoke", 41, 33, 97, 7],
"call_done_50",
["jump_false", 33, "if_else_47", 97, 7],
["get", 43, 4, 1, 98, 23],
["get", 43, 3, 1, 98, 23],
["is_proxy", 44, 43, 98, 23],
["jump_false", 44, "record_path_51", 98, 23],
["null", 45, 98, 23],
@@ -727,7 +727,7 @@
["invoke", 53, 51, 98, 18],
["move", 5, 51, 98, 18],
["record", 55, 0],
["get", 56, 12, 1, 99, 54],
["get", 56, 11, 1, 99, 54],
["store_field", 55, 56, "use", 99, 54],
[
"access",
@@ -756,14 +756,14 @@
"if_end_48",
["access", 62, ".cm", 105, 22],
["add", 63, 1, 62, 105, 22],
["move", 4, 63, 105, 22],
["get", 65, 4, 1, 106, 8],
["move", 6, 63, 105, 22],
["get", 65, 3, 1, 106, 8],
["is_proxy", 66, 65, 106, 8],
["jump_false", 66, "record_path_55", 106, 8],
["null", 67, 106, 8],
["access", 68, "is_file", 106, 8],
["array", 69, 0, 106, 8],
["push", 69, 4, 106, 8],
["push", 69, 6, 106, 8],
["frame", 70, 65, 2, 106, 8],
["setarg", 70, 0, 67, 106, 8],
["setarg", 70, 1, 68, 106, 8],
@@ -774,7 +774,7 @@
["load_field", 71, 65, "is_file", 106, 8],
["frame", 72, 71, 1, 106, 8],
["setarg", 72, 0, 65, 106, 8],
["setarg", 72, 1, 4, 106, 8],
["setarg", 72, 1, 6, 106, 8],
["invoke", 72, 64, 106, 8],
"call_done_56",
"_nop_bl_1",
@@ -795,17 +795,17 @@
["add", 77, 76, 1, 107, 35],
["access", 78, ".cm", 107, 42],
["add", 79, 77, 78, 107, 42],
["move", 4, 79, 107, 42],
["move", 6, 79, 107, 42],
["jump", "if_end_54", 107, 42],
"if_else_53",
"if_end_54",
["get", 81, 4, 1, 108, 7],
["get", 81, 3, 1, 108, 7],
["is_proxy", 82, 81, 108, 7],
["jump_false", 82, "record_path_59", 108, 7],
["null", 83, 108, 7],
["access", 84, "is_file", 108, 7],
["array", 85, 0, 108, 7],
["push", 85, 4, 108, 7],
["push", 85, 6, 108, 7],
["frame", 86, 81, 2, 108, 7],
["setarg", 86, 0, 83, 108, 7],
["setarg", 86, 1, 84, 108, 7],
@@ -816,17 +816,17 @@
["load_field", 87, 81, "is_file", 108, 7],
["frame", 88, 87, 1, 108, 7],
["setarg", 88, 0, 81, 108, 7],
["setarg", 88, 1, 4, 108, 7],
["setarg", 88, 1, 6, 108, 7],
["invoke", 88, 80, 108, 7],
"call_done_60",
["jump_false", 80, "if_else_57", 108, 7],
["get", 90, 4, 1, 109, 19],
["get", 90, 3, 1, 109, 19],
["is_proxy", 91, 90, 109, 19],
["jump_false", 91, "record_path_61", 109, 19],
["null", 92, 109, 19],
["access", 93, "slurp", 109, 19],
["array", 94, 0, 109, 19],
["push", 94, 4, 109, 19],
["push", 94, 6, 109, 19],
["frame", 95, 90, 2, 109, 19],
["setarg", 95, 0, 92, 109, 19],
["setarg", 95, 1, 93, 109, 19],
@@ -837,7 +837,7 @@
["load_field", 96, 90, "slurp", 109, 19],
["frame", 97, 96, 1, 109, 19],
["setarg", 97, 0, 90, 109, 19],
["setarg", 97, 1, 4, 109, 19],
["setarg", 97, 1, 6, 109, 19],
["invoke", 97, 89, 109, 19],
"call_done_62",
[
@@ -857,23 +857,23 @@
["setarg", 100, 1, 89, 109, 14],
["invoke", 100, 98, 109, 14],
["move", 3, 98, 109, 14],
["get", 103, 11, 1, 110, 11],
["get", 103, 10, 1, 110, 11],
["frame", 104, 103, 2, 110, 11],
["null", 105, 110, 11],
["setarg", 104, 0, 105, 110, 11],
["setarg", 104, 1, 3, 110, 11],
["setarg", 104, 2, 4, 110, 11],
["setarg", 104, 2, 6, 110, 11],
["invoke", 104, 102, 110, 11],
["move", 6, 102, 110, 11],
["move", 4, 102, 110, 11],
["record", 106, 0],
["get", 107, 12, 1, 111, 39],
["get", 107, 11, 1, 111, 39],
["store_field", 106, 107, "use", 111, 39],
["get", 109, 13, 1, 111, 14],
["get", 109, 12, 1, 111, 14],
["frame", 110, 109, 3, 111, 14],
["null", 111, 111, 14],
["setarg", 110, 0, 111, 111, 14],
["setarg", 110, 1, 1, 111, 14],
["setarg", 110, 2, 6, 111, 14],
["setarg", 110, 2, 4, 111, 14],
["setarg", 110, 3, 106, 111, 14],
["invoke", 110, 108, 111, 14],
["move", 2, 108, 111, 14],
@@ -918,15 +918,15 @@
"nr_slots": 161,
"instructions": [
["function", 20, 0, 0, 0],
["move", 3, 20, 0, 0],
["move", 19, 20, 0, 0],
["function", 21, 1, 0, 0],
["move", 10, 21, 0, 0],
["move", 14, 21, 0, 0],
["function", 22, 2, 0, 0],
["move", 11, 22, 0, 0],
["move", 10, 22, 0, 0],
["function", 23, 3, 0, 0],
["move", 13, 23, 0, 0],
["move", 12, 23, 0, 0],
["function", 24, 4, 0, 0],
["move", 12, 24, 0, 0],
["move", 11, 24, 0, 0],
[
"access",
25,
@@ -939,18 +939,18 @@
21
],
["load_field", 26, 25, "load_internal", 7, 21],
["move", 9, 26, 7, 21],
["access", 27, "js_fd_use", 8, 24],
["frame", 29, 9, 1, 8, 10],
["move", 15, 26, 7, 21],
["access", 27, "js_core_internal_fd_use", 8, 24],
["frame", 29, 15, 1, 8, 10],
["null", 30, 8, 10],
["setarg", 29, 0, 30, 8, 10],
["setarg", 29, 1, 27, 8, 10],
["invoke", 29, 28, 8, 10],
["move", 4, 28, 8, 10],
["move", 3, 28, 8, 10],
["record", 31, 0],
["move", 1, 31, 10, 17],
["access", 32, "fd", 11, 11],
["store_field", 1, 4, 32, 11, 11],
["store_field", 1, 3, 32, 11, 11],
[
"access",
33,
@@ -978,35 +978,35 @@
["access", 36, "json", 13, 11],
["store_field", 1, 35, 36, 13, 11],
["access", 37, "tokenize", 38, 30],
["frame", 39, 10, 1, 38, 20],
["frame", 39, 14, 1, 38, 20],
["null", 40, 38, 20],
["setarg", 39, 0, 40, 38, 20],
["setarg", 39, 1, 37, 38, 20],
["invoke", 39, 38, 38, 20],
["move", 6, 38, 38, 20],
["access", 41, "parse", 39, 27],
["frame", 43, 10, 1, 39, 17],
["frame", 43, 14, 1, 39, 17],
["null", 44, 39, 17],
["setarg", 43, 0, 44, 39, 17],
["setarg", 43, 1, 41, 39, 17],
["invoke", 43, 42, 39, 17],
["move", 17, 42, 39, 17],
["move", 13, 42, 39, 17],
["access", 45, "fold", 40, 26],
["frame", 47, 10, 1, 40, 16],
["frame", 47, 14, 1, 40, 16],
["null", 48, 40, 16],
["setarg", 47, 0, 48, 40, 16],
["setarg", 47, 1, 45, 40, 16],
["invoke", 47, 46, 40, 16],
["move", 2, 46, 40, 16],
["access", 49, "mcode", 41, 27],
["frame", 51, 10, 1, 41, 17],
["frame", 51, 14, 1, 41, 17],
["null", 52, 41, 17],
["setarg", 51, 0, 52, 41, 17],
["setarg", 51, 1, 49, 41, 17],
["invoke", 51, 50, 41, 17],
["move", 14, 50, 41, 17],
["move", 9, 50, 41, 17],
["access", 53, "streamline", 42, 32],
["frame", 55, 10, 1, 42, 22],
["frame", 55, 14, 1, 42, 22],
["null", 56, 42, 22],
["setarg", 55, 0, 56, 42, 22],
["setarg", 55, 1, 53, 42, 22],
@@ -1015,11 +1015,11 @@
["access", 57, "tokenize", 44, 11],
["store_field", 1, 6, 57, 44, 11],
["access", 58, "parse", 45, 11],
["store_field", 1, 17, 58, 45, 11],
["store_field", 1, 13, 58, 45, 11],
["access", 59, "fold", 46, 11],
["store_field", 1, 2, 59, 46, 11],
["access", 60, "mcode", 47, 11],
["store_field", 1, 14, 60, 47, 11],
["store_field", 1, 9, 60, 47, 11],
["access", 61, "streamline", 48, 11],
["store_field", 1, 16, 61, 48, 11],
[
@@ -1035,15 +1035,15 @@
],
["access", 63, 0, 121, 20],
["load_index", 64, 62, 63, 121, 20],
["move", 15, 64, 121, 20],
["move", 17, 64, 121, 20],
["array", 65, 0, 122, 17],
["move", 7, 65, 122, 17],
["access", 8, 1, 123, 10],
["null", 18, 124, 17],
["null", 5, 125, 14],
["null", 19, 126, 11],
["move", 5, 65, 122, 17],
["access", 7, 1, 123, 10],
["null", 4, 124, 17],
["null", 8, 125, 14],
["null", 18, 126, 11],
"_nop_bl_1",
["jump_true", 15, "if_else_63", 128, 6],
["jump_true", 17, "if_else_63", 128, 6],
["access", 67, "seed: no program specified\n", 129, 9],
[
"access",
@@ -1078,25 +1078,25 @@
20
],
["length", 73, 72, 133, 20],
["is_int", 75, 8, 133, 20],
["is_int", 75, 7, 133, 20],
["jump_false", 75, "rel_ni_67", 133, 20],
"_nop_tc_1",
"_nop_tc_2",
["lt_int", 74, 8, 73, 133, 20],
["lt_int", 74, 7, 73, 133, 20],
["jump", "rel_done_69", 133, 20],
"rel_ni_67",
["is_num", 75, 8, 133, 20],
["is_num", 75, 7, 133, 20],
["jump_false", 75, "rel_nn_68", 133, 20],
"_nop_tc_3",
"_nop_tc_4",
["lt_float", 74, 8, 73, 133, 20],
["lt_float", 74, 7, 73, 133, 20],
["jump", "rel_done_69", 133, 20],
"rel_nn_68",
["is_text", 75, 8, 133, 20],
["is_text", 75, 7, 133, 20],
["jump_false", 75, "rel_err_70", 133, 20],
"_nop_tc_5",
["jump", "rel_err_70", 133, 20],
["lt_text", 74, 8, 73, 133, 20],
["lt_text", 74, 7, 73, 133, 20],
["jump", "rel_done_69", 133, 20],
"rel_err_70",
["disrupt", 133, 20],
@@ -1113,39 +1113,39 @@
134,
19
],
["load_dynamic", 78, 77, 8, 134, 24],
["is_array", 79, 7, 134, 24],
["load_dynamic", 78, 77, 7, 134, 24],
["is_array", 79, 5, 134, 24],
["jump_false", 79, "push_err_71", 134, 24],
["push", 7, 78, 134, 24],
["push", 5, 78, 134, 24],
["jump", "push_done_72", 134, 24],
"push_err_71",
["disrupt", 134, 24],
"push_done_72",
["access", 80, 1, 135, 13],
["add", 81, 8, 80, 135, 13],
["move", 8, 81, 135, 13],
["add", 81, 7, 80, 135, 13],
["move", 7, 81, 135, 13],
["jump", "while_start_65", 135, 13],
"while_end_66",
["access", 82, ".ce", 138, 23],
["add", 83, 15, 82, 138, 23],
["move", 18, 83, 138, 23],
["is_proxy", 85, 4, 139, 6],
["add", 83, 17, 82, 138, 23],
["move", 4, 83, 138, 23],
["is_proxy", 85, 3, 139, 6],
["jump_false", 85, "record_path_75", 139, 6],
["null", 86, 139, 6],
["access", 87, "is_file", 139, 6],
["array", 88, 0, 139, 6],
["push", 88, 18, 139, 6],
["frame", 89, 4, 2, 139, 6],
["push", 88, 4, 139, 6],
["frame", 89, 3, 2, 139, 6],
["setarg", 89, 0, 86, 139, 6],
["setarg", 89, 1, 87, 139, 6],
["setarg", 89, 2, 88, 139, 6],
["invoke", 89, 84, 139, 6],
["jump", "call_done_76", 139, 6],
"record_path_75",
["load_field", 90, 4, "is_file", 139, 6],
["load_field", 90, 3, "is_file", 139, 6],
["frame", 91, 90, 1, 139, 6],
["setarg", 91, 0, 4, 139, 6],
["setarg", 91, 1, 18, 139, 6],
["setarg", 91, 0, 3, 139, 6],
["setarg", 91, 1, 4, 139, 6],
["invoke", 91, 84, 139, 6],
"call_done_76",
"_nop_bl_2",
@@ -1163,54 +1163,54 @@
],
["access", 94, "/", 140, 27],
["add", 95, 93, 94, 140, 27],
["add", 96, 95, 15, 140, 33],
["add", 96, 95, 17, 140, 33],
["access", 97, ".ce", 140, 43],
["add", 98, 96, 97, 140, 43],
["move", 18, 98, 140, 43],
["move", 4, 98, 140, 43],
["jump", "if_end_74", 140, 43],
"if_else_73",
"if_end_74",
["is_proxy", 100, 4, 141, 6],
["is_proxy", 100, 3, 141, 6],
["jump_false", 100, "record_path_79", 141, 6],
["null", 101, 141, 6],
["access", 102, "is_file", 141, 6],
["array", 103, 0, 141, 6],
["push", 103, 18, 141, 6],
["frame", 104, 4, 2, 141, 6],
["push", 103, 4, 141, 6],
["frame", 104, 3, 2, 141, 6],
["setarg", 104, 0, 101, 141, 6],
["setarg", 104, 1, 102, 141, 6],
["setarg", 104, 2, 103, 141, 6],
["invoke", 104, 99, 141, 6],
["jump", "call_done_80", 141, 6],
"record_path_79",
["load_field", 105, 4, "is_file", 141, 6],
["load_field", 105, 3, "is_file", 141, 6],
["frame", 106, 105, 1, 141, 6],
["setarg", 106, 0, 4, 141, 6],
["setarg", 106, 1, 18, 141, 6],
["setarg", 106, 0, 3, 141, 6],
["setarg", 106, 1, 4, 141, 6],
["invoke", 106, 99, 141, 6],
"call_done_80",
"_nop_bl_3",
["jump_true", 99, "if_else_77", 141, 6],
["access", 108, ".cm", 142, 25],
["add", 109, 15, 108, 142, 25],
["move", 18, 109, 142, 25],
["is_proxy", 111, 4, 143, 8],
["add", 109, 17, 108, 142, 25],
["move", 4, 109, 142, 25],
["is_proxy", 111, 3, 143, 8],
["jump_false", 111, "record_path_83", 143, 8],
["null", 112, 143, 8],
["access", 113, "is_file", 143, 8],
["array", 114, 0, 143, 8],
["push", 114, 18, 143, 8],
["frame", 115, 4, 2, 143, 8],
["push", 114, 4, 143, 8],
["frame", 115, 3, 2, 143, 8],
["setarg", 115, 0, 112, 143, 8],
["setarg", 115, 1, 113, 143, 8],
["setarg", 115, 2, 114, 143, 8],
["invoke", 115, 110, 143, 8],
["jump", "call_done_84", 143, 8],
"record_path_83",
["load_field", 116, 4, "is_file", 143, 8],
["load_field", 116, 3, "is_file", 143, 8],
["frame", 117, 116, 1, 143, 8],
["setarg", 117, 0, 4, 143, 8],
["setarg", 117, 1, 18, 143, 8],
["setarg", 117, 0, 3, 143, 8],
["setarg", 117, 1, 4, 143, 8],
["invoke", 117, 110, 143, 8],
"call_done_84",
"_nop_bl_4",
@@ -1228,39 +1228,39 @@
],
["access", 120, "/", 144, 29],
["add", 121, 119, 120, 144, 29],
["add", 122, 121, 15, 144, 35],
["add", 122, 121, 17, 144, 35],
["access", 123, ".cm", 144, 45],
["add", 124, 122, 123, 144, 45],
["move", 18, 124, 144, 45],
["move", 4, 124, 144, 45],
["jump", "if_end_82", 144, 45],
"if_else_81",
"if_end_82",
["jump", "if_end_78", 144, 45],
"if_else_77",
"if_end_78",
["is_proxy", 126, 4, 146, 6],
["is_proxy", 126, 3, 146, 6],
["jump_false", 126, "record_path_87", 146, 6],
["null", 127, 146, 6],
["access", 128, "is_file", 146, 6],
["array", 129, 0, 146, 6],
["push", 129, 18, 146, 6],
["frame", 130, 4, 2, 146, 6],
["push", 129, 4, 146, 6],
["frame", 130, 3, 2, 146, 6],
["setarg", 130, 0, 127, 146, 6],
["setarg", 130, 1, 128, 146, 6],
["setarg", 130, 2, 129, 146, 6],
["invoke", 130, 125, 146, 6],
["jump", "call_done_88", 146, 6],
"record_path_87",
["load_field", 131, 4, "is_file", 146, 6],
["load_field", 131, 3, "is_file", 146, 6],
["frame", 132, 131, 1, 146, 6],
["setarg", 132, 0, 4, 146, 6],
["setarg", 132, 1, 18, 146, 6],
["setarg", 132, 0, 3, 146, 6],
["setarg", 132, 1, 4, 146, 6],
["invoke", 132, 125, 146, 6],
"call_done_88",
"_nop_bl_5",
["jump_true", 125, "if_else_85", 146, 6],
["access", 134, "seed: program not found: ", 147, 9],
["add", 135, 134, 15, 147, 39],
["add", 135, 134, 17, 147, 39],
["access", 136, "\n", 147, 49],
["add", 137, 135, 136, 147, 49],
[
@@ -1283,23 +1283,23 @@
["jump", "if_end_86", 148, 3],
"if_else_85",
"if_end_86",
["is_proxy", 143, 4, 151, 15],
["is_proxy", 143, 3, 151, 15],
["jump_false", 143, "record_path_89", 151, 15],
["null", 144, 151, 15],
["access", 145, "slurp", 151, 15],
["array", 146, 0, 151, 15],
["push", 146, 18, 151, 15],
["frame", 147, 4, 2, 151, 15],
["push", 146, 4, 151, 15],
["frame", 147, 3, 2, 151, 15],
["setarg", 147, 0, 144, 151, 15],
["setarg", 147, 1, 145, 151, 15],
["setarg", 147, 2, 146, 151, 15],
["invoke", 147, 142, 151, 15],
["jump", "call_done_90", 151, 15],
"record_path_89",
["load_field", 148, 4, "slurp", 151, 15],
["load_field", 148, 3, "slurp", 151, 15],
["frame", 149, 148, 1, 151, 15],
["setarg", 149, 0, 4, 151, 15],
["setarg", 149, 1, 18, 151, 15],
["setarg", 149, 0, 3, 151, 15],
["setarg", 149, 1, 4, 151, 15],
["invoke", 149, 142, 151, 15],
"call_done_90",
[
@@ -1318,22 +1318,22 @@
["setarg", 152, 0, 153, 151, 10],
["setarg", 152, 1, 142, 151, 10],
["invoke", 152, 150, 151, 10],
["move", 5, 150, 151, 10],
["frame", 155, 11, 2, 152, 7],
["move", 8, 150, 151, 10],
["frame", 155, 10, 2, 152, 7],
["null", 156, 152, 7],
["setarg", 155, 0, 156, 152, 7],
["setarg", 155, 1, 5, 152, 7],
["setarg", 155, 2, 18, 152, 7],
["setarg", 155, 1, 8, 152, 7],
["setarg", 155, 2, 4, 152, 7],
["invoke", 155, 154, 152, 7],
["move", 19, 154, 152, 7],
["move", 18, 154, 152, 7],
["record", 157, 0],
["store_field", 157, 12, "use", 153, 29],
["store_field", 157, 7, "args", 153, 43],
["frame", 159, 13, 3, 153, 1],
["store_field", 157, 11, "use", 153, 29],
["store_field", 157, 5, "args", 153, 43],
["frame", 159, 12, 3, 153, 1],
["null", 160, 153, 1],
["setarg", 159, 0, 160, 153, 1],
["setarg", 159, 1, 15, 153, 1],
["setarg", 159, 2, 19, 153, 1],
["setarg", 159, 1, 17, 153, 1],
["setarg", 159, 2, 18, 153, 1],
["setarg", 159, 3, 157, 153, 1],
["invoke", 159, 158, 153, 1],
["return", 158, 153, 1]

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

@@ -238,7 +238,7 @@ static const JSCFunctionListEntry js_crypto_funcs[] = {
JS_CFUNC_DEF("unlock", 3, js_crypto_unlock),
};
JSValue js_crypto_use(JSContext *js)
JSValue js_core_crypto_use(JSContext *js)
{
JSValue obj = JS_NewObject(js);
JS_SetPropertyFunctionList(js, obj, js_crypto_funcs, sizeof(js_crypto_funcs)/sizeof(js_crypto_funcs[0]));

View File

@@ -21,7 +21,7 @@ static const JSCFunctionListEntry js_debug_funcs[] = {
MIST_FUNC_DEF(debug, backtrace_fns,0),
};
JSValue js_debug_use(JSContext *js) {
JSValue js_core_debug_use(JSContext *js) {
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js,mod,js_debug_funcs,countof(js_debug_funcs));
return mod;

View File

@@ -20,7 +20,7 @@ static const JSCFunctionListEntry js_js_funcs[] = {
MIST_FUNC_DEF(js, fn_info, 1),
};
JSValue js_js_use(JSContext *js) {
JSValue js_core_js_use(JSContext *js) {
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js,mod,js_js_funcs,countof(js_js_funcs));
return mod;

2
fd.cm
View File

@@ -1,4 +1,4 @@
var fd = use('internal/fd_c')
var fd = use('internal/fd')
var wildstar = use('wildstar')
function last_pos(str, sep) {

2
fit.c
View File

@@ -248,7 +248,7 @@ static const JSCFunctionListEntry js_fit_funcs[] = {
MIST_FUNC_DEF(fit, zeros, 1),
};
JSValue js_fit_use(JSContext *js)
JSValue js_core_fit_use(JSContext *js)
{
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js, mod, js_fit_funcs, countof(js_fit_funcs));

View File

@@ -1,13 +1,13 @@
// Hidden vars come from env:
// CLI mode (cell_init): os, args, core_path, shop_path
// Actor spawn (script_startup): os, json, nota, wota, actorsym, init, core_path, shop_path
// Actor spawn (script_startup): os, json, actorsym, init, core_path, shop_path
// args[0] = script name, args[1..] = user args
var load_internal = os.load_internal
function use_embed(name) {
return load_internal("js_" + name + "_use")
return load_internal("js_core_" + name + "_use")
}
var fd = use_embed('fd')
var fd = use_embed('internal_fd')
var json = use_embed('json')
var crypto = use_embed('crypto')
@@ -23,7 +23,7 @@ function content_hash(content) {
function cache_path(hash) {
if (!shop_path) return null
return shop_path + '/build/' + hash + '.mach'
return shop_path + '/build/' + hash
}
function ensure_build_dir() {
@@ -267,7 +267,7 @@ if (args != null) {
// Actor spawn mode — load engine.cm with full actor env
load_engine({
os: os, actorsym: actorsym, init: init,
core_path: core_path, shop_path: shop_path, json: json, nota: nota, wota: wota,
core_path: core_path, shop_path: shop_path, json: json,
analyze: analyze, run_ast_fn: run_ast, run_ast_noopt_fn: run_ast_noopt,
use_cache: use_cache,
content_hash: content_hash, cache_path: cache_path,

View File

@@ -1,5 +1,4 @@
// Hidden vars (os, actorsym, init, core_path, shop_path, analyze, run_ast_fn, run_ast_noopt_fn, json, use_cache, content_hash, cache_path, ensure_build_dir, compile_to_blob_fn) come from env
// In actor spawn mode, also: nota, wota
var ACTORDATA = actorsym
var SYSYM = '__SYSTEM__'
@@ -19,7 +18,7 @@ var ACTOR_EXT = '.ce'
var load_internal = os.load_internal
function use_embed(name) {
return load_internal("js_" + name + "_use")
return load_internal("js_core_" + name + "_use")
}
function logical(val1) {
@@ -46,7 +45,7 @@ function ends_with(str, suffix) {
return search(str, suffix, -length(suffix)) != null
}
var fd = use_embed('fd')
var fd = use_embed('internal_fd')
var js = use_embed('js')
// core_path and shop_path come from env (bootstrap.cm passes them through)
@@ -69,53 +68,17 @@ function use_core(path) {
var result = null
var script = null
var ast = null
var c_cache_key = null
// If C embed exists, register it so .cm modules can use('internal/<name>_c')
if (sym) {
c_cache_key = 'core/internal/' + path + '_c'
if (!use_cache[c_cache_key])
use_cache[c_cache_key] = sym
}
// Build env: merge core_extras
env = {use: use_core}
arrfor(array(core_extras), function(k) { env[k] = core_extras[k] })
// Check for pre-compiled .cm.mach file first
var mach_path = core_path + '/' + path + '.cm.mach'
if (fd.is_file(mach_path)) {
result = mach_load(fd.slurp(mach_path), env)
use_cache[cache_key] = result
return result
}
// Check for .cm.mcode JSON IR
var mcode_path = core_path + '/' + path + '.cm.mcode'
var mcode_blob = null
var hash = null
var cached_path = null
var mach_blob = null
var source_blob = null
if (fd.is_file(mcode_path)) {
mcode_blob = fd.slurp(mcode_path)
hash = content_hash(mcode_blob)
cached_path = cache_path(hash)
if (cached_path && fd.is_file(cached_path)) {
result = mach_load(fd.slurp(cached_path), env)
} else {
mach_blob = mach_compile_mcode_bin('core:' + path, text(mcode_blob))
if (cached_path) {
ensure_build_dir()
fd.slurpwrite(cached_path, mach_blob)
}
result = mach_load(mach_blob, env)
}
use_cache[cache_key] = result
return result
}
// Fall back to source .cm file — compile at runtime
// Compile from source .cm file
var file_path = core_path + '/' + path + MOD_EXT
if (fd.is_file(file_path)) {
source_blob = fd.slurp(file_path)

View File

@@ -752,7 +752,7 @@ static const JSCFunctionListEntry js_fd_funcs[] = {
MIST_FUNC_DEF(fd, readlink, 1),
};
JSValue js_fd_use(JSContext *js) {
JSValue js_core_internal_fd_use(JSContext *js) {
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js, mod, js_fd_funcs, countof(js_fd_funcs));
return mod;

View File

@@ -73,7 +73,7 @@ static const JSCFunctionListEntry js_kim_funcs[] = {
MIST_FUNC_DEF(kim, decode, 1),
};
JSValue js_kim_use(JSContext *js)
JSValue js_core_kim_use(JSContext *js)
{
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js, mod, js_kim_funcs, countof(js_kim_funcs));

View File

@@ -641,7 +641,7 @@ static const JSCFunctionListEntry js_os_funcs[] = {
MIST_FUNC_DEF(os, getenv, 1),
};
JSValue js_os_use(JSContext *js) {
JSValue js_core_os_use(JSContext *js) {
JS_NewClassID(&js_dylib_class_id);
JS_NewClass(js, js_dylib_class_id, &js_dylib_class);

View File

@@ -479,8 +479,8 @@ function resolve_mod_fn(path, pkg) {
return cached
}
// Check for cached mcode in content-addressed store
cached_mcode_path = hash_path(content_key) + '.mcode'
// Check for cached mcode in content-addressed store (salted hash to distinguish from mach)
cached_mcode_path = global_shop_path + '/build/' + content_hash(stone(blob(text(content_key) + "\nmcode")))
if (fd.is_file(cached_mcode_path)) {
mcode_json = text(fd.slurp(cached_mcode_path))
compiled = mach_compile_mcode_bin(path, mcode_json)
@@ -488,22 +488,6 @@ function resolve_mod_fn(path, pkg) {
return compiled
}
// Check for pre-compiled .mach or .mcode file alongside .cm source
if (ends_with(path, '.cm')) {
mach_path = text(path, 0, length(path) - 3) + '.mach'
if (fd.is_file(mach_path)) {
mach_blob = fd.slurp(mach_path)
put_into_cache(content_key, mach_blob)
return mach_blob
}
mcode_path = path + '.mcode'
if (fd.is_file(mcode_path)) {
compiled = mach_compile_mcode_bin(path, text(fd.slurp(mcode_path)))
put_into_cache(content_key, compiled)
return compiled
}
}
// Compile via full pipeline: analyze → mcode → streamline → serialize
if (!_mcode_mod) _mcode_mod = Shop.use("mcode", null)
if (!_streamline_mod) _streamline_mod = Shop.use("streamline", null)
@@ -684,8 +668,7 @@ function resolve_c_symbol(path, package_context) {
// If no package context, only check core
if (!package_context || package_context == 'core') {
_path = replace(path, '/', '_')
core_sym = `js_${_path}_use`
core_sym = make_c_symbol('core', path)
// Check lib/ dylib first for core
loader = try_dylib_symbol(core_sym, 'core', path)
@@ -760,7 +743,7 @@ function resolve_c_symbol(path, package_context) {
}
// 3. Check core (dylib first, then internal)
core_sym = `js_${replace(path, '/', '_')}_use`
core_sym = make_c_symbol('core', path)
loader = try_dylib_symbol(core_sym, 'core', path)
if (loader) {

View File

@@ -69,7 +69,7 @@ static const JSCFunctionListEntry js_time_funcs[] = {
};
JSValue
js_internal_time_use(JSContext *ctx)
js_core_internal_time_use(JSContext *ctx)
{
JSValue obj = JS_NewObject(ctx);
JS_SetPropertyFunctionList(ctx, obj,
@@ -78,9 +78,3 @@ js_internal_time_use(JSContext *ctx)
sizeof(js_time_funcs[0]));
return obj;
}
JSValue
js_time_use(JSContext *ctx)
{
return js_internal_time_use(ctx);
}

View File

@@ -63,10 +63,10 @@ scripts = [
'fit.c',
'crypto.c',
'internal/kim.c',
'time.c',
'internal/time.c',
'debug/debug.c',
'internal/os.c',
'fd.c',
'internal/fd.c',
'net/http.c',
'net/enet.c',
'wildstar.c',

View File

@@ -568,7 +568,7 @@ static const JSCFunctionListEntry js_enet_peer_funcs[] = {
// JS_CGETSET_DEF("address", js_enet_peer_get_address, NULL),
};
JSValue js_enet_use(JSContext *ctx)
JSValue js_core_enet_use(JSContext *ctx)
{
JS_NewClassID(&enet_host_id);
JS_NewClass(ctx, enet_host_id, &enet_host);

View File

@@ -318,7 +318,7 @@ static const JSCFunctionListEntry js_http_funcs[] = {
JS_CFUNC_DEF("fetch", 2, js_fetch_picoparser),
};
JSValue js_http_use(JSContext *js) {
JSValue js_core_http_use(JSContext *js) {
par_easycurl_init(0); // Initialize platform HTTP backend
JSValue obj = JS_NewObject(js);
JS_SetPropertyFunctionList(js, obj, js_http_funcs,

View File

@@ -594,7 +594,7 @@ static const JSCFunctionListEntry js_socket_funcs[] = {
MIST_FUNC_DEF(socket, close, 1),
};
JSValue js_socket_use(JSContext *js) {
JSValue js_core_socket_use(JSContext *js) {
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js, mod, js_socket_funcs, countof(js_socket_funcs));

2
qop.c
View File

@@ -456,7 +456,7 @@ static const JSCFunctionListEntry js_qop_funcs[] = {
JS_PROP_INT32_DEF("FLAG_ENCRYPTED", QOP_FLAG_ENCRYPTED, 0),
};
JSValue js_qop_use(JSContext *js) {
JSValue js_core_qop_use(JSContext *js) {
JS_NewClassID(&js_qop_archive_class_id);
JS_NewClass(js, js_qop_archive_class_id, &js_qop_archive_class);
JSValue archive_proto = JS_NewObject(js);

View File

@@ -178,8 +178,8 @@ while (i < length(files)) {
hash = text(crypto.blake2(mcode_blob), 'h')
compact_mcode = json.encode(optimized)
mach_blob = mach_compile_mcode_bin(entry.name, compact_mcode)
fd.slurpwrite(cache_dir + '/' + hash + '.mach', mach_blob)
print(` cached ${hash}.mach`)
fd.slurpwrite(cache_dir + '/' + hash, mach_blob)
print(` cached ${hash}`)
}
i = i + 1
}

View File

@@ -42,12 +42,12 @@ static char *compute_blake2_hex(const char *data, size_t size) {
return hex;
}
// Build cache path: shop_path/build/<hex>.mach (caller must free)
// Build cache path: shop_path/build/<hex> (caller must free)
static char *build_cache_path(const char *hex) {
if (!shop_path) return NULL;
size_t len = strlen(shop_path) + strlen("/build/") + 64 + strlen(".mach") + 1;
size_t len = strlen(shop_path) + strlen("/build/") + 64 + 1;
char *path = malloc(len);
snprintf(path, len, "%s/build/%s.mach", shop_path, hex);
snprintf(path, len, "%s/build/%s", shop_path, hex);
return path;
}
@@ -225,11 +225,8 @@ void actor_disrupt(cell_rt *crt)
actor_free(crt);
}
JSValue js_os_use(JSContext *js);
JSValue js_math_use(JSContext *js);
JSValue js_json_use(JSContext *js);
JSValue js_nota_use(JSContext *js);
JSValue js_wota_use(JSContext *js);
JSValue js_core_os_use(JSContext *js);
JSValue js_core_json_use(JSContext *js);
void script_startup(cell_rt *prt)
{
@@ -255,7 +252,7 @@ void script_startup(cell_rt *prt)
prt->actor_sym_ref.val = JS_NULL;
cell_rt *crt = JS_GetContextOpaque(js);
JS_FreeValue(js, js_blob_use(js));
JS_FreeValue(js, js_core_blob_use(js));
// Load pre-compiled bootstrap .mcode
size_t boot_size;
@@ -276,10 +273,8 @@ void script_startup(cell_rt *prt)
// Create hidden environment
JSValue hidden_env = JS_NewObject(js);
JS_SetPropertyStr(js, hidden_env, "os", js_os_use(js));
JS_SetPropertyStr(js, hidden_env, "json", js_json_use(js));
JS_SetPropertyStr(js, hidden_env, "nota", js_nota_use(js));
JS_SetPropertyStr(js, hidden_env, "wota", js_wota_use(js));
JS_SetPropertyStr(js, hidden_env, "os", js_core_os_use(js));
JS_SetPropertyStr(js, hidden_env, "json", js_core_json_use(js));
crt->actor_sym_ref.val = JS_NewObject(js);
JS_SetPropertyStr(js, hidden_env, "actorsym", JS_DupValue(js, crt->actor_sym_ref.val));
@@ -502,17 +497,15 @@ int cell_init(int argc, char **argv)
root_cell = cli_rt;
JS_FreeValue(ctx, js_blob_use(ctx));
JS_FreeValue(ctx, js_core_blob_use(ctx));
JSValue hidden_env = JS_NewObject(ctx);
JS_SetPropertyStr(ctx, hidden_env, "os", js_os_use(ctx));
JS_SetPropertyStr(ctx, hidden_env, "os", js_core_os_use(ctx));
JS_SetPropertyStr(ctx, hidden_env, "core_path", JS_NewString(ctx, core_path));
JS_SetPropertyStr(ctx, hidden_env, "shop_path",
shop_path ? JS_NewString(ctx, shop_path) : JS_NULL);
JS_SetPropertyStr(ctx, hidden_env, "actorsym", JS_DupValue(ctx, cli_rt->actor_sym_ref.val));
JS_SetPropertyStr(ctx, hidden_env, "json", js_json_use(ctx));
JS_SetPropertyStr(ctx, hidden_env, "nota", js_nota_use(ctx));
JS_SetPropertyStr(ctx, hidden_env, "wota", js_wota_use(ctx));
JS_SetPropertyStr(ctx, hidden_env, "json", js_core_json_use(ctx));
JS_SetPropertyStr(ctx, hidden_env, "init", JS_NULL);
JSValue args_arr = JS_NewArray(ctx);
for (int i = arg_start; i < argc; i++) {

View File

@@ -9,7 +9,7 @@ extern "C" {
#endif
// blob fns
JSValue js_blob_use(JSContext *js);
JSValue js_core_blob_use(JSContext *js);
JSValue js_new_blob_stoned_copy(JSContext *js, void *data, size_t bytes);
void *js_get_blob_data(JSContext *js, size_t *size, JSValue v); // bytes
void *js_get_blob_data_bits(JSContext *js, size_t *bits, JSValue v); // bits
@@ -31,9 +31,7 @@ void *value2wota(JSContext *js, JSValue v, JSValue replacer, size_t *bytes);
JSValue nota2value(JSContext *js, void *nota);
void *value2nota(JSContext *js, JSValue v);
JSValue js_json_use(JSContext *js);
JSValue js_nota_use(JSContext *js);
JSValue js_wota_use(JSContext *js);
JSValue js_core_json_use(JSContext *js);
#define CELL_HOOK_ENTER 1
#define CELL_HOOK_EXIT 2

View File

@@ -155,7 +155,7 @@ static const JSCFunctionListEntry js_actor_funcs[] = {
MIST_FUNC_DEF(actor, clock, 1),
};
JSValue js_actor_use(JSContext *js) {
JSValue js_core_actor_use(JSContext *js) {
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js,mod,js_actor_funcs,countof(js_actor_funcs));
return mod;

View File

@@ -9443,7 +9443,7 @@ static const JSCFunctionListEntry js_blob_proto_funcs[] = {
/* Initialize blob - called during context setup (but we do it in
* JS_AddIntrinsicBaseObjects now) */
JSValue js_blob_use (JSContext *js) {
JSValue js_core_blob_use (JSContext *js) {
return JS_GetPropertyStr (js, js->global_obj, "blob");
}
@@ -10917,7 +10917,7 @@ static const JSCFunctionListEntry js_cell_json_funcs[] = {
JS_CFUNC_DEF ("decode", 1, js_cell_json_decode),
};
JSValue js_json_use (JSContext *ctx) {
JSValue js_core_json_use (JSContext *ctx) {
JSGCRef obj_ref;
JS_PushGCRef (ctx, &obj_ref);
obj_ref.val = JS_NewObject (ctx);
@@ -11329,7 +11329,7 @@ static const JSCFunctionListEntry js_nota_funcs[] = {
JS_CFUNC_DEF ("decode", 1, js_nota_decode),
};
JSValue js_nota_use (JSContext *js) {
JSValue js_core_nota_use (JSContext *js) {
JSGCRef export_ref;
JS_PushGCRef (js, &export_ref);
export_ref.val = JS_NewObject (js);
@@ -11763,7 +11763,7 @@ static const JSCFunctionListEntry js_wota_funcs[] = {
JS_CFUNC_DEF ("decode", 2, js_wota_decode),
};
JSValue js_wota_use (JSContext *ctx) {
JSValue js_core_wota_use (JSContext *ctx) {
JSGCRef exports_ref;
JS_PushGCRef (ctx, &exports_ref);
exports_ref.val = JS_NewObject (ctx);
@@ -11878,7 +11878,7 @@ static const JSCFunctionListEntry js_math_radians_funcs[]
JS_CFUNC_DEF ("sqrt", 1, js_math_sqrt),
JS_CFUNC_DEF ("e", 1, js_math_e) };
JSValue js_math_radians_use (JSContext *ctx) {
JSValue js_core_math_radians_use (JSContext *ctx) {
JSValue obj = JS_NewObject (ctx);
JS_SetPropertyFunctionList (ctx, obj, js_math_radians_funcs, countof (js_math_radians_funcs));
return obj;
@@ -11944,7 +11944,7 @@ static const JSCFunctionListEntry js_math_degrees_funcs[]
JS_CFUNC_DEF ("sqrt", 1, js_math_sqrt),
JS_CFUNC_DEF ("e", 1, js_math_e) };
JSValue js_math_degrees_use (JSContext *ctx) {
JSValue js_core_math_degrees_use (JSContext *ctx) {
JSValue obj = JS_NewObject (ctx);
JS_SetPropertyFunctionList (ctx, obj, js_math_degrees_funcs, countof (js_math_degrees_funcs));
return obj;
@@ -12009,7 +12009,7 @@ static const JSCFunctionListEntry js_math_cycles_funcs[]
JS_CFUNC_DEF ("sqrt", 1, js_math_sqrt),
JS_CFUNC_DEF ("e", 1, js_math_e) };
JSValue js_math_cycles_use (JSContext *ctx) {
JSValue js_core_math_cycles_use (JSContext *ctx) {
JSValue obj = JS_NewObject (ctx);
JS_SetPropertyFunctionList (ctx, obj, js_math_cycles_funcs, countof (js_math_cycles_funcs));
return obj;

View File

@@ -1,13 +1,10 @@
// epoch = 0000-01-01 00:00:00 +0000
var time = use('internal/time_c')
var time = use('internal/time')
var now = time.now
var computer_zone = time.computer_zone
var computer_dst = time.computer_dst
delete time.now
delete time.computer_zone
delete time.computer_dst
time.second = 1
time.minute = 60

View File

@@ -28,7 +28,7 @@ static const JSCFunctionListEntry js_wildstar_funcs[] = {
JS_PROP_INT32_DEF("WM_WILDSTAR", WM_WILDSTAR, 0),
};
JSValue js_wildstar_use(JSContext *js) {
JSValue js_core_wildstar_use(JSContext *js) {
JSValue mod = JS_NewObject(js);
JS_SetPropertyFunctionList(js, mod, js_wildstar_funcs, countof(js_wildstar_funcs));
return mod;