annotate backendutils_c.rhope @ 169:fd06fb07762a

Basic inlining of arithmetic and comparison operations on integer types
author Mike Pavone <pavone@retrodev.com>
date Sun, 08 May 2011 01:37:44 -0700
parents a68e6828d896
children ed322ae64738
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1
109
b7df624895b2 Hack to reduce overhead of Escape Rhope Name
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
2 Escape Rhope Name[name,p:out]
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 {
109
b7df624895b2 Hack to reduce overhead of Escape Rhope Name
Mike Pavone <pavone@retrodev.com>
parents: 100
diff changeset
4 escaped <- [name]Replace[p,
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5 ("UN_","AT_","SP_","CN_","QN_","PL_","MN_","TM_","DV_","LT_","GT_","LP_","RP_","NT_","EQ_","PR_",
100
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
6 "DP_","TB_","CM_","PD_","NL_","LC_","RC_", "LS_", "RS_", "HS_", "BS_", "CR_", "SC_", "AM_", "PI_", "PC_", "CT_", "BT_", "TD_")]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
7
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
8 [("char","int","short","long","float","double","void","struct")]Find[=[escaped, ?]]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
9 {
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
10 out <- ["ID_"]Append[escaped]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
11 }{
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
12 out <- Val[escaped]
f51c4c17457c Broken port of parser to compiler
Mike Pavone <pavone@retrodev.com>
parents: 99
diff changeset
13 }
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16 Blueprint AddRef
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18 Value
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
21 AddRef[value:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
23 out <- [Build[AddRef()]]Value <<[value]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
26 Make Op@AddRef[addref,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 {
136
fc3815b7462f Javascript backend now produces working code for some simple examples, still more of the standard lib that needs to be ported.
Mike Pavone <pavone@retrodev.com>
parents: 135
diff changeset
28 out <- [func]Make AddRef Op[[addref]Value >>]
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31 Strip Addref@AddRef[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
32 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
33 out <- [[op]Value >>]Strip Addref
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
36 Make Op@String[string,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 out <- [func]Resolve[string]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
39 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
41 Strip Addref@String[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
42 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
43 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
44 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45
135
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
46 Get Type@String[op,func:out]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
47 {
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
48 out <- [func]Get Var Type[op]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
49 }
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
50
99
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
51 Make Op@String Cat[string,func:out]
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
52 {
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
53 out <- [func]Resolve[string]
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
54 }
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
55
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
56 Strip Addref@String Cat[op:out]
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
57 {
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
58 out <- op
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
59 }
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
60
135
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
61 Get Type@String Cat[op,func:out]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
62 {
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
63 out <- [func]Get Var Type[op]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
64 }
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
65
99
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
66 Make Op@String Slice[string,func:out]
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
67 {
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
68 out <- [func]Resolve[string]
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
69 }
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
70
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
71 Strip Addref@String Slice[op:out]
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
72 {
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
73 out <- op
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
74 }
e09c2d1d6d5b Got dataflow graph code working in compiler (nworker_c.rhope)
Mike Pavone <pavone@retrodev.com>
parents: 92
diff changeset
75
135
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
76 Get Type@String Slice[op,func:out]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
77 {
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
78 out <- [func]Get Var Type[op]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
79 }
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
80
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
81 Make Op@Whole Number[num,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
82 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
83 out <- num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
84 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
85
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
86 Strip Addref@Whole Number[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
87 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
88 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
89 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
90
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
91 Make Op@Real Number[num,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
92 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
93 out <- num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
94 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
95
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
96 Strip Addref@Real Number[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
97 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
98 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
99 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
100
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
101 Blueprint Output
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
102 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
103 Name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
104 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
105
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
106 Output[name:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
107 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
108 out <- [Build[Output()]]Name <<[name]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
109 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
110
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
111 Make Op@Output[op,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
112 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
113 out <- [func]Resolve Output[[op]Name >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
114 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
115
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
116 Strip Addref@Output[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
117 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
118 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
119 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
120
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
121 Blueprint Constant
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
122 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
123 Value
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
124 Need Addref
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
125 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
126
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
127 Constant[var:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
128 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
129 out <- [[Build[Constant()]]Value <<[var]]Need Addref <<[Yes]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
130 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
131
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
132 Make Op@Constant[const,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
133 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
134 out <- [func]Lookup Constant[[const]Value >>, [const]Need Addref >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
135 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
136
135
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
137 Get Type@Constant[const,func:out]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
138 {
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
139 out <- [func]Get Constant Type[const]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
140 }
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
141
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
142 Strip Addref@Constant[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
143 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
144 out <- [op]Need Addref <<[No]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
145 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
146
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
147 Blueprint Result
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
148 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
149 Output Num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
150 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
151
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
152 Result[num:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
153 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
154 out <- [Build[Result()]]Output Num <<[num]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
155 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
156
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
157 Make Op@Result[result,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
158 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
159 out <- [func]Result Reference[[result]Output Num>>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
160 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
161
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
162 Strip Addref@Result[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
163 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
164 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
165 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
166
139
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
167 Blueprint Global Get
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
168 {
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
169 Store
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
170 Var
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
171 }
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
172
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
173 Global Get[store,var:out]
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
174 {
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
175 out <- [[Build[Global Get()]]Store <<[store]]Var <<[var]
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
176 }
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
177
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
178 Make Op@Global Get[get,func:out]
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
179 {
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
180 out <- [func]Global Reference[[get]Store >>, [get]Var >>]
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
181 }
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
182
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
183 Strip Addref@Global Get[get:out]
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
184 {
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
185 out <- get
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
186 }
a68e6828d896 Global stores and transactions are working. Definately leaks memory on retries. Probably a fair number of bugs to work out. However, a basic test program works.
Mike Pavone <pavone@retrodev.com>
parents: 136
diff changeset
187
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
188 Blueprint Check Result
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
189 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
190 Output Num
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
191 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
192
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
193 Check Result[num:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
194 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
195 out <- [Build[Check Result()]]Output Num <<[num]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
196 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
197
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
198 Make Op@Check Result[result,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
199 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
200 out <- [func]Checked Result Reference[[result]Output Num>>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
201 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
202
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
203 Strip Addref@Check Result[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
204 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
205 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
206 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
207
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
208 Make Condition[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
209 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
210 If[[Blueprint Of[op]]=[OrValue()]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
211 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
212 out <- OrCond[Make Condition[[op]Left >>], Make Condition[[op]Right >>]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
213 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
214 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
215 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
216 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
217
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
218 Blueprint OrValue
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
219 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
220 Left
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
221 Right
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
222 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
223
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
224 OrValue[left,right:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
225 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
226 out <- [[Build[OrValue()]]Left <<[left]]Right <<[right]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
227 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
228
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
229 Make Op@OrValue[orval,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
230 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
231 out <- [func]If Null Else[[orval]Left >>, [orval]Right >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
232 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
233
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
234 Strip Addref@OrValue[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
235 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
236 out <- [[op]Left <<[ [[op]Left >>]Strip Addref ]]Right <<[ [[op]Right >>]Strip Addref ]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
237 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
238
169
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
239 Blueprint Cast
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
240 {
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
241 Value
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
242 Type
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
243 }
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
244
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
245 Cast[val,type:out]
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
246 {
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
247 out <- [[Build[Cast()]]Value <<[val]]Type <<[type]
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
248 }
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
249
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
250 Make Op@Cast[cast,func:out]
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
251 {
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
252 out <- [func]Cast Value[[cast]Value >>, [cast]Type >>]
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
253 }
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
254
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
255 Strip Addref@Cast[op:out]
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
256 {
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
257 out <- [op]Value <<[[[op]Value >>]Strip Addref]
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
258 }
fd06fb07762a Basic inlining of arithmetic and comparison operations on integer types
Mike Pavone <pavone@retrodev.com>
parents: 139
diff changeset
259
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
260 Blueprint NotCond
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
261 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
262 Condition
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
263 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
264
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
265 NotCond[cond:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
266 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
267 out <- [Build[NotCond()]]Condition <<[[cond]Strip Addref]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
268 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
269
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
270 Make Op@NotCond[cond,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
271 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
272 out <- ["!"]Append[[[cond]Condition >>]Make Op[func]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
273 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
274
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
275 Strip Addref@NotCond[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
276 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
277 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
278 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
279
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
280 Blueprint OrCond
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
281 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
282 Condition1
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
283 Condition2
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
284 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
285
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
286 OrCond[cond1,cond2:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
287 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
288 out <- [[Build[OrCond()]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
289 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
290
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
291 Make Op@OrCond[cond,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
292 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
293 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" || "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
294 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
295
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
296 Strip Addref@OrCond[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
297 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
298 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
299 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
300
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
301 Blueprint AndCond
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
302 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
303 Condition1
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
304 Condition2
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
305 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
306
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
307 AndCond[cond1,cond2:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
308 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
309 out <- [[Build[AndCond()]]Condition1 <<[[cond1]Strip Addref]]Condition2 <<[[cond2]Strip Addref]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
310 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
311
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
312 Make Op@AndCond[cond,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
313 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
314 out <- ["("]Append[[[ [[cond]Condition1 >>]Make Op[func] ]Append[" && "]]Append[[ [[cond]Condition2 >>]Make Op[func] ]Append[")"]]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
315 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
316
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
317 Strip Addref@AndCond[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
318 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
319 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
320 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
321
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
322 Blueprint Field Ref
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
323 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
324 Variable
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
325 Field
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
326 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
327
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
328 Field Ref[var,field:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
329 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
330 out <- [[Build[Field Ref()]]Variable <<[var]]Field <<[field]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
331 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
332
135
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
333 Get Type@Field Ref[ref,func:out]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
334 {
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
335 out <- [func]Get Field Type[[[ref]Variable >>]Get Type[func], [ref]Field >>]
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
336 }
18a4403fe576 Javascript backend can now produce broken output. Needs fixes plus port of standard lib
Mike Pavone <pavone@retrodev.com>
parents: 109
diff changeset
337
92
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
338 Make Op@Field Ref[ref,func:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
339 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
340 out <- [func]Field Result[[ref]Variable >>,[ref]Field >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
341 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
342
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
343 Strip Addref@Field Ref[op:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
344 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
345 out <- op
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
346 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
347
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
348 Blueprint Type Instance
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
349 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
350 Name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
351 Params
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
352 Variant
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
353 Mutable?
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
354 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
355
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
356 Type Instance[raw name:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
357 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
358 If[[raw name]=[""]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
359 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
360 name <- "Any Type"
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
361 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
362 name <- raw name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
363 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
364 out <- [[[[Build[Type Instance()]]Name <<[name]]Params <<[()]]Variant <<["Boxed"]]Mutable? <<[No]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
365 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
366
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
367 Set Variant@Type Instance[type,variant:out,invalid]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
368 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
369 [("Boxed","Naked","Pointer","Raw Pointer")]Find[=[variant,?]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
370 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
371 out <- [type]Variant <<[variant]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
372 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
373 invalid <- type
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
374 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
375 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
376
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
377 =@Type Instance[type,compare:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
378 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
379 If[[Blueprint Of[compare]] = [Type Instance()]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
380 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
381 //TODO: Compare parameters
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
382 ,out <- If[[[type]Name >>] = [[compare]Name >>]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
383 { out <- [[type]Variant >>] = [[compare]Variant >>] }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
384 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
385 out <- [[type]Name >>] = [compare]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
386 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
387 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
388
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
389 String@Type Instance[type:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
390 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
391 typestr <- [[[[type]Name >>
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
392 ]Append["("]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
393 ]Append[ [[type]Params >>]Join[", "] ]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
394 ]Append[")"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
395 If[[type]Mutable? >>]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
396 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
397 out <- [[ [["("]Append[typestr]]Append[", "] ]Append[[type]Variant >>]]Append[", Mutable)"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
398 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
399 If[[[type]Variant >>] = ["Boxed"]]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
400 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
401 out <- Val[typestr]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
402 }{
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
403 out <- [[ [["("]Append[typestr]]Append[", "] ]Append[[type]Variant >>]]Append[", Mutable)"]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
404 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
405 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
406 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
407
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
408 Blueprint Worker Literal
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
409 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
410 Name
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
411 Args
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
412 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
413
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
414 Worker Literal[name:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
415 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
416 out <- [[Build[Worker Literal()]]Name <<[name]]Args <<[()]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
417 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
418
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
419 Set Input@Worker Literal[worker,argnum,val:out]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
420 {
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
421 out <- [worker]Args <<[ [[worker]Args >>]Set[argnum, val] ]
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
422 }
e73a93fb5de1 Beginning of port of compiler to itself, some bugfixes and a refcount optimization
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
423