Files
jsrt/docs/class_form.txt
T
2026-09-11 13:36:57 +00:00

140 lines
3.5 KiB
Plaintext

=== after regify ===
[
RegFn {
name: "test",
arg_count: 0,
var_count: 4,
value_names: [
file_atom[2],
atom("<class_fields_init>"),
file_atom[2],
file_atom[3],
],
captures: [],
cpool: [
FnById(
2,
),
FnById(
3,
),
FnById(
4,
),
],
code: [
[] = SetLocUninitialized Loc(3) [],
[] = SetLocUninitialized Loc(2) [],
[] = SetLocUninitialized Loc(0) [],
[4] = Undefined None [],
[] = SetLocUninitialized Loc(1) [],
// This is the pattern to be replaced by prototype form
[5] = PushConst8 Const(1) [],
[6, 7] = DefineClass AtomU8 { atom: file_atom[2], arg: 0 } [5, 4],
[8] = Fclosure8 Const(0) [],
[9] = DefineMethod AtomU8 { atom: file_atom[5], arg: 0 } [8, 7],
[10] = Fclosure8 Const(2) [],
[11, 12] = SetHomeObject None [10, 9],
[] = PutLoc1 None [12],
[] = Drop None [11],
[13] = SetLoc0 None [6],
[] = CloseLoc Loc(1) [],
[] = PutLoc2 None [13],
[14] = GetLocCheck Loc(2) [],
[15, 16] = Dup None [14],
[17] = CallConstructor Npop(0) [16, 15],
[] = PutLoc3 None [17],
[] = ReturnUndef None [],
],
next_val: 18,
},
RegFn {
name: "<null>", // method, unchanged
arg_count: 0,
var_count: 0,
value_names: [],
captures: [],
cpool: [],
code: [
[] = ReturnUndef None [],
],
next_val: 0,
},
RegFn {
name: "<null>", // constructor, needs to be renamed to "Counter"
arg_count: 0,
var_count: 1,
value_names: [
atom("this"),
],
captures: [
Capture {
name: "<class_fields_init>",
atom: atom("<class_fields_init>"),
from: ParentLocal(
1,
),
},
],
cpool: [],
code: [
[1] = PushThis None [],
[] = PutLoc0 None [1],
[] = CheckCtor None [],
[2] = GetVarRefCheck VarRef(0) [],
[3, 4] = Dup None [2],
[] = IfFalse8 Label { target: 14 } [4],
[5] = GetLoc0 None [],
[6, 7] = Swap None [5, 3],
[8] = CallMethod Npop(0) [7, 6],
[] = ReturnUndef None [],
],
next_val: 9,
},
RegFn {
name: "<null>", // instance fields initializer, needs thinking
arg_count: 0,
var_count: 2,
value_names: [
atom("this"),
atom("<home_object>"),
],
captures: [],
cpool: [],
code: [
[2] = SpecialObject U8(4) [],
[] = PutLoc1 None [2],
[3] = PushThis None [],
[] = PutLoc0 None [3],
[] = Goto8 Label { target: 7 } [],
[4] = GetLoc0 None [],
[5] = Push1 None [],
[6] = DefineField Atom(file_atom[4]) [5, 4],
[] = ReturnUndef None [],
],
next_val: 7,
},
]
[
String(
"../test.js",
),
String(
"test",
),
String(
"Counter",
),
String(
"c",
),
String(
"x",
),
String(
"m1",
),
]