resin 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/amber/css/amber-normalize.css +73 -73
- data/amber/css/amber-normalize.less +1 -1
- data/amber/css/amber.css +106 -106
- data/amber/css/helios.css +242 -0
- data/amber/images/hsplitter.png +0 -0
- data/amber/images/vsplitter.png +0 -0
- data/amber/js/Benchfib.deploy.js +116 -38
- data/amber/js/Benchfib.js +120 -42
- data/amber/js/Canvas.deploy.js +674 -403
- data/amber/js/Canvas.js +682 -411
- data/amber/js/Compiler-AST.deploy.js +1150 -0
- data/amber/js/Compiler-AST.js +1591 -0
- data/amber/js/Compiler-Core.deploy.js +1562 -0
- data/amber/js/Compiler-Core.js +1972 -0
- data/amber/js/Compiler-Exceptions.deploy.js +114 -0
- data/amber/js/Compiler-Exceptions.js +161 -0
- data/amber/js/Compiler-IR.deploy.js +2326 -0
- data/amber/js/Compiler-IR.js +3146 -0
- data/amber/js/Compiler-Inlining.deploy.js +1147 -0
- data/amber/js/Compiler-Inlining.js +1514 -0
- data/amber/js/Compiler-Semantic.deploy.js +1207 -0
- data/amber/js/Compiler-Semantic.js +1628 -0
- data/amber/js/Compiler-Tests.deploy.js +646 -60
- data/amber/js/Compiler-Tests.js +843 -82
- data/amber/js/Compiler.deploy.js +1097 -159
- data/amber/js/Compiler.js +1414 -161
- data/amber/js/Examples.deploy.js +31 -15
- data/amber/js/Examples.js +33 -17
- data/amber/js/Helios-Announcements.deploy.js +127 -0
- data/amber/js/Helios-Announcements.js +157 -0
- data/amber/js/Helios-Browser.deploy.js +1473 -0
- data/amber/js/Helios-Browser.js +1953 -0
- data/amber/js/Helios-Commands.deploy.js +403 -0
- data/amber/js/Helios-Commands.js +563 -0
- data/amber/js/Helios-Core.deploy.js +1070 -0
- data/amber/js/Helios-Core.js +1445 -0
- data/amber/js/Helios-Environments.deploy.js +132 -0
- data/amber/js/Helios-Environments.js +179 -0
- data/amber/js/Helios-Inspector.deploy.js +855 -0
- data/amber/js/Helios-Inspector.js +1155 -0
- data/amber/js/Helios-KeyBindings.deploy.js +753 -0
- data/amber/js/Helios-KeyBindings.js +1023 -0
- data/amber/js/Helios-Layout.deploy.js +383 -0
- data/amber/js/Helios-Layout.js +523 -0
- data/amber/js/Helios-Workspace.deploy.js +799 -0
- data/amber/js/Helios-Workspace.js +1074 -0
- data/amber/js/IDE.deploy.js +2541 -1490
- data/amber/js/IDE.js +2721 -1660
- data/amber/js/Importer-Exporter.deploy.js +671 -0
- data/amber/js/Importer-Exporter.js +816 -0
- data/amber/js/Kernel-Announcements.deploy.js +137 -20
- data/amber/js/Kernel-Announcements.js +176 -22
- data/amber/js/Kernel-Classes.deploy.js +555 -168
- data/amber/js/Kernel-Classes.js +662 -205
- data/amber/js/Kernel-Collections.deploy.js +1403 -618
- data/amber/js/Kernel-Collections.js +1545 -690
- data/amber/js/Kernel-Exceptions.deploy.js +109 -45
- data/amber/js/Kernel-Exceptions.js +123 -49
- data/amber/js/Kernel-Methods.deploy.js +196 -81
- data/amber/js/Kernel-Methods.js +214 -89
- data/amber/js/Kernel-Objects.deploy.js +1542 -1117
- data/amber/js/Kernel-Objects.js +1593 -1148
- data/amber/js/Kernel-Tests.deploy.js +1725 -772
- data/amber/js/Kernel-Tests.js +2301 -1123
- data/amber/js/Kernel-Transcript.deploy.js +23 -25
- data/amber/js/Kernel-Transcript.js +24 -26
- data/amber/js/SUnit.deploy.js +204 -131
- data/amber/js/SUnit.js +222 -139
- data/amber/js/Spaces.deploy.js +240 -0
- data/amber/js/Spaces.js +326 -0
- data/amber/js/amber.js +26 -7
- data/amber/js/boot.js +65 -47
- data/amber/js/init.js +1 -1
- data/amber/js/lib/CodeMirror/amber.css +21 -21
- data/amber/js/lib/CodeMirror/codemirror.css +119 -13
- data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
- data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
- data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
- data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
- data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
- data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
- data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
- data/amber/st/Compiler-AST.st +505 -0
- data/amber/st/Compiler-Core.st +835 -0
- data/amber/st/Compiler-Exceptions.st +87 -0
- data/amber/st/Compiler-IR.st +1097 -0
- data/amber/st/Compiler-Inlining.st +650 -0
- data/amber/st/Compiler-Semantic.st +558 -0
- data/amber/st/Compiler-Tests.st +285 -381
- data/amber/st/Compiler.st +725 -2
- data/amber/st/Helios-Announcements.st +104 -0
- data/amber/st/Helios-Browser.st +708 -0
- data/amber/st/Helios-Commands.st +223 -0
- data/amber/st/Helios-Core.st +532 -0
- data/amber/st/Helios-Environments.st +98 -0
- data/amber/st/Helios-Inspector.st +367 -0
- data/amber/st/Helios-KeyBindings.st +337 -0
- data/amber/st/Helios-Layout.st +199 -0
- data/amber/st/Helios-Workspace.st +367 -0
- data/amber/st/IDE.st +75 -53
- data/amber/st/Importer-Exporter.st +386 -0
- data/amber/st/Kernel-Announcements.st +92 -0
- data/amber/st/Kernel-Classes.st +137 -15
- data/amber/st/Kernel-Collections.st +137 -47
- data/amber/st/Kernel-Exceptions.st +14 -0
- data/amber/st/Kernel-Methods.st +9 -1
- data/amber/st/Kernel-Objects.st +29 -5
- data/amber/st/Kernel-Tests.st +545 -199
- data/amber/st/SUnit.st +10 -0
- data/amber/st/Spaces.st +142 -0
- data/lib/resin/app.rb +1 -1
- metadata +86 -31
- data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
- data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
@@ -0,0 +1,242 @@
|
|
1
|
+
body {
|
2
|
+
font-size: 13px;
|
3
|
+
}
|
4
|
+
|
5
|
+
.clearfix:after {
|
6
|
+
content: ".";
|
7
|
+
display: block;
|
8
|
+
clear: both;
|
9
|
+
visibility: hidden;
|
10
|
+
line-height: 0;
|
11
|
+
height: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
.clearfix {
|
15
|
+
display: inline-block;
|
16
|
+
}
|
17
|
+
|
18
|
+
html[xmlns] .clearfix {
|
19
|
+
display: block;
|
20
|
+
}
|
21
|
+
|
22
|
+
* html .clearfix {
|
23
|
+
height: 1%;
|
24
|
+
}
|
25
|
+
|
26
|
+
a {
|
27
|
+
cursor: pointer;
|
28
|
+
}
|
29
|
+
|
30
|
+
.btn, .btn-group > .btn, .btn-group > .dropdown-menu {
|
31
|
+
font-size: 13px;
|
32
|
+
padding: 2px 8px;
|
33
|
+
}
|
34
|
+
|
35
|
+
.navbar-inner {
|
36
|
+
min-height: 30px;
|
37
|
+
}
|
38
|
+
|
39
|
+
.navbar .nav > li > a {
|
40
|
+
padding: 5px 15px;
|
41
|
+
}
|
42
|
+
|
43
|
+
.navbar-fixed-top i {
|
44
|
+
opacity: 0.2;
|
45
|
+
margin-right: 10px;
|
46
|
+
}
|
47
|
+
|
48
|
+
.navbar-fixed-top .active i {
|
49
|
+
opacity: 0.6;
|
50
|
+
}
|
51
|
+
|
52
|
+
.nav-pills.nav-stacked > li > a {
|
53
|
+
border-radius: 0;
|
54
|
+
-webkit-border-radius: 0;
|
55
|
+
-moz-border-radius: 0;
|
56
|
+
padding: 3px;
|
57
|
+
margin: 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
[class^="icon-"], [class*=" icon-"] {
|
61
|
+
margin-right: 2px;
|
62
|
+
}
|
63
|
+
|
64
|
+
/* .nav-pills.nav-stacked > li > a { */
|
65
|
+
/* width: 14px; */
|
66
|
+
/* height: 14px; */
|
67
|
+
/* display: inline-block; */
|
68
|
+
/* margin-right: 4px; */
|
69
|
+
/* } */
|
70
|
+
|
71
|
+
.nav-pills > .active > a {
|
72
|
+
background: #ccc;
|
73
|
+
color: #fff;
|
74
|
+
}
|
75
|
+
|
76
|
+
/* .focused .nav-pills{ */
|
77
|
+
/* box-shadow: inset 0 0 4px #000AFF; */
|
78
|
+
/* -webkit-box-shadow: inset 0 0 4px #000AFF; */
|
79
|
+
/* -moz-box-shadow: inset 0 0 4px #000AFF; */
|
80
|
+
/* } */
|
81
|
+
|
82
|
+
.focused .nav-pills > .active > a, .nav-pills > .active > a:hover {
|
83
|
+
background: #08C;
|
84
|
+
}
|
85
|
+
|
86
|
+
|
87
|
+
#container {
|
88
|
+
position: fixed;
|
89
|
+
top: 30px;
|
90
|
+
bottom: 0;
|
91
|
+
left: 0;
|
92
|
+
right: 0;
|
93
|
+
}
|
94
|
+
|
95
|
+
#container .panes {
|
96
|
+
height: 100%;
|
97
|
+
width: 100%;
|
98
|
+
overflow: hidden;
|
99
|
+
}
|
100
|
+
|
101
|
+
#container .panes .pane {
|
102
|
+
overflow: auto;
|
103
|
+
}
|
104
|
+
|
105
|
+
#container .panes .pane {
|
106
|
+
overflow: auto;
|
107
|
+
}
|
108
|
+
|
109
|
+
#container .panes .pane > div {
|
110
|
+
height: 100%;
|
111
|
+
position: relative;
|
112
|
+
}
|
113
|
+
|
114
|
+
#container .panes .pane .nav-pills {
|
115
|
+
position: absolute;
|
116
|
+
overflow-y: auto;
|
117
|
+
top: 0;
|
118
|
+
bottom: 37px;
|
119
|
+
width: 100%;
|
120
|
+
margin: 0;
|
121
|
+
}
|
122
|
+
|
123
|
+
#container .panes .pane .pane_actions {
|
124
|
+
position: absolute;
|
125
|
+
overflow: hidden;
|
126
|
+
width: 100%;
|
127
|
+
height: 26px;
|
128
|
+
bottom: 0;
|
129
|
+
background: #E5E5E5;
|
130
|
+
border-top: 1px solid #bbb;
|
131
|
+
padding: 5px 0;
|
132
|
+
margin: 0;
|
133
|
+
text-align: center;
|
134
|
+
}
|
135
|
+
|
136
|
+
#container .panes .pane .pane_actions .info {
|
137
|
+
padding: 10px 5px 5px;
|
138
|
+
font-weight: bold;
|
139
|
+
color: #666;
|
140
|
+
line-height: 20px;
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
#container .panes .pane .pane_actions .btn-group {
|
145
|
+
display: inline;
|
146
|
+
margin-left: 5px;
|
147
|
+
}
|
148
|
+
|
149
|
+
#container .panes .pane .pane_actions .btn-group .btn {
|
150
|
+
margin: 0;
|
151
|
+
}
|
152
|
+
|
153
|
+
#container .panes .pane .pane_actions .btn-group.switch .btn.active:first-child {
|
154
|
+
background: #5AD;
|
155
|
+
color: white;
|
156
|
+
text-shadow: 0 1px 0 #333;
|
157
|
+
}
|
158
|
+
|
159
|
+
#container .panes .pane .pane_actions .btn {
|
160
|
+
margin-left: 5px;
|
161
|
+
}
|
162
|
+
|
163
|
+
#container .panes .pane .class_side .nav-pills {
|
164
|
+
font-weight: bold;
|
165
|
+
background: #ffd;
|
166
|
+
}
|
167
|
+
|
168
|
+
|
169
|
+
#container .panes.horizontal > .pane {
|
170
|
+
height: 50%;
|
171
|
+
min-height: 50px;
|
172
|
+
}
|
173
|
+
|
174
|
+
#container .panes.vertical > .pane {
|
175
|
+
width: 50%;
|
176
|
+
display: inline;
|
177
|
+
float: left;
|
178
|
+
height: 100%;
|
179
|
+
}
|
180
|
+
|
181
|
+
#container .splitter {
|
182
|
+
z-index: 10;
|
183
|
+
background: #E6E6E6;
|
184
|
+
border: 1px solid #bbb;
|
185
|
+
}
|
186
|
+
|
187
|
+
#container .splitter.vertical {
|
188
|
+
width: 4px;
|
189
|
+
height: 100%;
|
190
|
+
float: left;
|
191
|
+
cursor: e-resize;
|
192
|
+
background-image: url('/images/vsplitter.png');
|
193
|
+
background-repeat: no-repeat;
|
194
|
+
background-position: center;
|
195
|
+
}
|
196
|
+
|
197
|
+
#container .splitter.horizontal {
|
198
|
+
height: 4px;
|
199
|
+
cursor: s-resize;
|
200
|
+
background-image: url('/images/hsplitter.png');
|
201
|
+
background-repeat: no-repeat;
|
202
|
+
background-position: center;
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
.key_helper {
|
207
|
+
z-index: 20;
|
208
|
+
position: fixed;
|
209
|
+
bottom: 0px;
|
210
|
+
background: #ddd;
|
211
|
+
width: 100%;
|
212
|
+
border-top: 1px solid #AAA;
|
213
|
+
font-size: 11px;
|
214
|
+
height: 22px;
|
215
|
+
}
|
216
|
+
|
217
|
+
.key_helper .command {
|
218
|
+
padding: 0 10px;
|
219
|
+
}
|
220
|
+
|
221
|
+
.key_helper .label {
|
222
|
+
padding: 0 4px;
|
223
|
+
border-top: 1px solid white;
|
224
|
+
border-left: 1px solid white;
|
225
|
+
border-bottom: 1px solid #666;
|
226
|
+
border-right: 1px solid #666;
|
227
|
+
font-family: monospace;
|
228
|
+
}
|
229
|
+
|
230
|
+
.key_helper .action {
|
231
|
+
padding: 0 5px;
|
232
|
+
color: #666;
|
233
|
+
}
|
234
|
+
|
235
|
+
.key_helper .selected {
|
236
|
+
background: #0C8;
|
237
|
+
height: 30px;
|
238
|
+
padding: 4px;
|
239
|
+
color: white;
|
240
|
+
font-weight: bold;
|
241
|
+
text-shadow: 0 -1px 0 #666;
|
242
|
+
}
|
Binary file
|
Binary file
|
data/amber/js/Benchfib.deploy.js
CHANGED
@@ -7,10 +7,10 @@ smalltalk.method({
|
|
7
7
|
selector: "main",
|
8
8
|
fn: function (){
|
9
9
|
var self=this;
|
10
|
-
var result
|
11
|
-
|
12
|
-
smalltalk.send(
|
13
|
-
return self
|
10
|
+
var result;
|
11
|
+
result=smalltalk.send((0),"_tinyBenchmarks",[]);
|
12
|
+
smalltalk.send(console,"_log_",[smalltalk.send("0 tinyBenchmarks => ","__comma",[result])]);
|
13
|
+
return self}
|
14
14
|
}),
|
15
15
|
smalltalk.Benchfib.klass);
|
16
16
|
|
@@ -21,8 +21,15 @@ smalltalk.method({
|
|
21
21
|
selector: "benchFib",
|
22
22
|
fn: function (){
|
23
23
|
var self=this;
|
24
|
-
|
25
|
-
|
24
|
+
var $2,$1;
|
25
|
+
$2=smalltalk.send(self,"__lt",[(2)]);
|
26
|
+
if(smalltalk.assert($2)){
|
27
|
+
$1=(1);
|
28
|
+
} else {
|
29
|
+
$1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"__minus",[(1)]),"_benchFib",[]),"__plus",[smalltalk.send(smalltalk.send(self,"__minus",[(2)]),"_benchFib",[])]),"__plus",[(1)]);
|
30
|
+
};
|
31
|
+
return $1;
|
32
|
+
}
|
26
33
|
}),
|
27
34
|
smalltalk.Number);
|
28
35
|
|
@@ -32,15 +39,42 @@ smalltalk.method({
|
|
32
39
|
selector: "benchmark",
|
33
40
|
fn: function (){
|
34
41
|
var self=this;
|
35
|
-
var
|
36
|
-
var
|
37
|
-
var
|
38
|
-
var
|
39
|
-
var
|
40
|
-
|
41
|
-
|
42
|
+
var $1;
|
43
|
+
var size;
|
44
|
+
var flags;
|
45
|
+
var prime;
|
46
|
+
var k;
|
47
|
+
var count;
|
48
|
+
size=(8190);
|
49
|
+
smalltalk.send((1),"_to_do_",[self,(function(iter){
|
50
|
+
count=(0);
|
51
|
+
count;
|
52
|
+
flags=smalltalk.send((smalltalk.Array || Array),"_new",[]);
|
53
|
+
flags;
|
54
|
+
smalltalk.send(size,"_timesRepeat_",[(function(){
|
55
|
+
return smalltalk.send(flags,"_add_",[true]);
|
56
|
+
})]);
|
57
|
+
return smalltalk.send((1),"_to_do_",[size,(function(i){
|
58
|
+
$1=smalltalk.send(flags,"_at_",[i]);
|
59
|
+
if(smalltalk.assert($1)){
|
60
|
+
prime=smalltalk.send(i,"__plus",[(1)]);
|
61
|
+
prime;
|
62
|
+
k=smalltalk.send(i,"__plus",[prime]);
|
63
|
+
k;
|
64
|
+
smalltalk.send((function(){
|
65
|
+
return smalltalk.send(k,"__lt_eq",[size]);
|
66
|
+
}),"_whileTrue_",[(function(){
|
67
|
+
smalltalk.send(flags,"_at_put_",[k,false]);
|
68
|
+
k=smalltalk.send(k,"__plus",[prime]);
|
69
|
+
return k;
|
70
|
+
})]);
|
71
|
+
count=smalltalk.send(count,"__plus",[(1)]);
|
72
|
+
return count;
|
73
|
+
};
|
74
|
+
})]);
|
75
|
+
})]);
|
42
76
|
return count;
|
43
|
-
|
77
|
+
}
|
44
78
|
}),
|
45
79
|
smalltalk.Number);
|
46
80
|
|
@@ -54,7 +88,8 @@ if (this < 2) {
|
|
54
88
|
return 1;
|
55
89
|
} else {
|
56
90
|
return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
|
57
|
-
|
91
|
+
;
|
92
|
+
return self}
|
58
93
|
}),
|
59
94
|
smalltalk.Number);
|
60
95
|
|
@@ -86,7 +121,8 @@ for (var z=0;z<this;z++) {
|
|
86
121
|
}
|
87
122
|
}
|
88
123
|
return count;
|
89
|
-
|
124
|
+
;
|
125
|
+
return self}
|
90
126
|
}),
|
91
127
|
smalltalk.Number);
|
92
128
|
|
@@ -96,17 +132,38 @@ smalltalk.method({
|
|
96
132
|
selector: "jstinyBenchmarks",
|
97
133
|
fn: function (){
|
98
134
|
var self=this;
|
99
|
-
var
|
100
|
-
var
|
101
|
-
var
|
102
|
-
var
|
103
|
-
var
|
104
|
-
|
105
|
-
|
106
|
-
(
|
107
|
-
|
108
|
-
return smalltalk.send(
|
109
|
-
|
135
|
+
var $1;
|
136
|
+
var t1;
|
137
|
+
var t2;
|
138
|
+
var r;
|
139
|
+
var n1;
|
140
|
+
var n2;
|
141
|
+
n1=(1);
|
142
|
+
smalltalk.send((function(){
|
143
|
+
t1=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
144
|
+
return smalltalk.send(n1,"_jsbenchmark",[]);
|
145
|
+
})]);
|
146
|
+
t1;
|
147
|
+
return smalltalk.send(t1,"__lt",[(1000)]);
|
148
|
+
}),"_whileTrue_",[(function(){
|
149
|
+
n1=smalltalk.send(n1,"__star",[(2)]);
|
150
|
+
return n1;
|
151
|
+
})]);
|
152
|
+
n2=(28);
|
153
|
+
smalltalk.send((function(){
|
154
|
+
t2=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
155
|
+
r=smalltalk.send(n2,"_jsbenchFib",[]);
|
156
|
+
return r;
|
157
|
+
})]);
|
158
|
+
t2;
|
159
|
+
return smalltalk.send(t2,"__lt",[(1000)]);
|
160
|
+
}),"_whileTrue_",[(function(){
|
161
|
+
n2=smalltalk.send(n2,"__plus",[(1)]);
|
162
|
+
return n2;
|
163
|
+
})]);
|
164
|
+
$1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(n1,"__star",[(500000)]),"__star",[(1000)]),"__slash",[t1]),"_printString",[]),"__comma",[" bytecodes/sec; "]),"__comma",[smalltalk.send(smalltalk.send(smalltalk.send(r,"__star",[(1000)]),"__slash",[t2]),"_printString",[])]),"__comma",[" sends/sec"]);
|
165
|
+
return $1;
|
166
|
+
}
|
110
167
|
}),
|
111
168
|
smalltalk.Number);
|
112
169
|
|
@@ -116,17 +173,38 @@ smalltalk.method({
|
|
116
173
|
selector: "tinyBenchmarks",
|
117
174
|
fn: function (){
|
118
175
|
var self=this;
|
119
|
-
var
|
120
|
-
var
|
121
|
-
var
|
122
|
-
var
|
123
|
-
var
|
124
|
-
|
125
|
-
|
126
|
-
(
|
127
|
-
|
128
|
-
return smalltalk.send(
|
129
|
-
|
176
|
+
var $1;
|
177
|
+
var t1;
|
178
|
+
var t2;
|
179
|
+
var r;
|
180
|
+
var n1;
|
181
|
+
var n2;
|
182
|
+
n1=(1);
|
183
|
+
smalltalk.send((function(){
|
184
|
+
t1=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
185
|
+
return smalltalk.send(n1,"_benchmark",[]);
|
186
|
+
})]);
|
187
|
+
t1;
|
188
|
+
return smalltalk.send(t1,"__lt",[(1000)]);
|
189
|
+
}),"_whileTrue_",[(function(){
|
190
|
+
n1=smalltalk.send(n1,"__star",[(2)]);
|
191
|
+
return n1;
|
192
|
+
})]);
|
193
|
+
n2=(16);
|
194
|
+
smalltalk.send((function(){
|
195
|
+
t2=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
196
|
+
r=smalltalk.send(n2,"_benchFib",[]);
|
197
|
+
return r;
|
198
|
+
})]);
|
199
|
+
t2;
|
200
|
+
return smalltalk.send(t2,"__lt",[(1000)]);
|
201
|
+
}),"_whileTrue_",[(function(){
|
202
|
+
n2=smalltalk.send(n2,"__plus",[(1)]);
|
203
|
+
return n2;
|
204
|
+
})]);
|
205
|
+
$1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(n1,"__star",[(500000)]),"__star",[(1000)]),"__slash",[t1]),"_printString",[]),"__comma",[" bytecodes/sec; "]),"__comma",[smalltalk.send(smalltalk.send(smalltalk.send(r,"__star",[(1000)]),"__slash",[t2]),"_printString",[])]),"__comma",[" sends/sec"]);
|
206
|
+
return $1;
|
207
|
+
}
|
130
208
|
}),
|
131
209
|
smalltalk.Number);
|
132
210
|
|
data/amber/js/Benchfib.js
CHANGED
@@ -8,10 +8,10 @@ selector: "main",
|
|
8
8
|
category: 'not yet classified',
|
9
9
|
fn: function (){
|
10
10
|
var self=this;
|
11
|
-
var result
|
12
|
-
|
13
|
-
smalltalk.send(
|
14
|
-
return self
|
11
|
+
var result;
|
12
|
+
result=smalltalk.send((0),"_tinyBenchmarks",[]);
|
13
|
+
smalltalk.send(console,"_log_",[smalltalk.send("0 tinyBenchmarks => ","__comma",[result])]);
|
14
|
+
return self},
|
15
15
|
args: [],
|
16
16
|
source: "main\x0a\x0a\x09| result |\x0a\x09result := 0 tinyBenchmarks.\x0a\x09console log: '0 tinyBenchmarks => ' , result",
|
17
17
|
messageSends: ["tinyBenchmarks", "log:", ","],
|
@@ -27,11 +27,18 @@ selector: "benchFib",
|
|
27
27
|
category: '*Benchfib',
|
28
28
|
fn: function (){
|
29
29
|
var self=this;
|
30
|
-
|
31
|
-
|
30
|
+
var $2,$1;
|
31
|
+
$2=smalltalk.send(self,"__lt",[(2)]);
|
32
|
+
if(smalltalk.assert($2)){
|
33
|
+
$1=(1);
|
34
|
+
} else {
|
35
|
+
$1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self,"__minus",[(1)]),"_benchFib",[]),"__plus",[smalltalk.send(smalltalk.send(self,"__minus",[(2)]),"_benchFib",[])]),"__plus",[(1)]);
|
36
|
+
};
|
37
|
+
return $1;
|
38
|
+
},
|
32
39
|
args: [],
|
33
40
|
source: "benchFib \x0a\x09\x22Handy send-heavy benchmark\x22\x0a\x09\x22(result // seconds to run) = approx calls per second\x22\x0a\x09\x22 | r t |\x0a\x09 t := Time millisecondsToRun: [r := 26 benchFib].\x0a\x09 (r * 1000) // t\x22\x0a\x09\x22138000 on a Mac 8100/100\x22\x0a\x09^ self < 2 \x0a\x09\x09ifTrue: [1] \x0a\x09\x09ifFalse: [(self-1) benchFib + (self-2) benchFib + 1]",
|
34
|
-
messageSends: ["ifTrue:ifFalse:", "
|
41
|
+
messageSends: ["ifTrue:ifFalse:", "+", "benchFib", "-", "<"],
|
35
42
|
referencedClasses: []
|
36
43
|
}),
|
37
44
|
smalltalk.Number);
|
@@ -43,18 +50,45 @@ selector: "benchmark",
|
|
43
50
|
category: '*Benchfib',
|
44
51
|
fn: function (){
|
45
52
|
var self=this;
|
46
|
-
var
|
47
|
-
var
|
48
|
-
var
|
49
|
-
var
|
50
|
-
var
|
51
|
-
|
52
|
-
|
53
|
+
var $1;
|
54
|
+
var size;
|
55
|
+
var flags;
|
56
|
+
var prime;
|
57
|
+
var k;
|
58
|
+
var count;
|
59
|
+
size=(8190);
|
60
|
+
smalltalk.send((1),"_to_do_",[self,(function(iter){
|
61
|
+
count=(0);
|
62
|
+
count;
|
63
|
+
flags=smalltalk.send((smalltalk.Array || Array),"_new",[]);
|
64
|
+
flags;
|
65
|
+
smalltalk.send(size,"_timesRepeat_",[(function(){
|
66
|
+
return smalltalk.send(flags,"_add_",[true]);
|
67
|
+
})]);
|
68
|
+
return smalltalk.send((1),"_to_do_",[size,(function(i){
|
69
|
+
$1=smalltalk.send(flags,"_at_",[i]);
|
70
|
+
if(smalltalk.assert($1)){
|
71
|
+
prime=smalltalk.send(i,"__plus",[(1)]);
|
72
|
+
prime;
|
73
|
+
k=smalltalk.send(i,"__plus",[prime]);
|
74
|
+
k;
|
75
|
+
smalltalk.send((function(){
|
76
|
+
return smalltalk.send(k,"__lt_eq",[size]);
|
77
|
+
}),"_whileTrue_",[(function(){
|
78
|
+
smalltalk.send(flags,"_at_put_",[k,false]);
|
79
|
+
k=smalltalk.send(k,"__plus",[prime]);
|
80
|
+
return k;
|
81
|
+
})]);
|
82
|
+
count=smalltalk.send(count,"__plus",[(1)]);
|
83
|
+
return count;
|
84
|
+
};
|
85
|
+
})]);
|
86
|
+
})]);
|
53
87
|
return count;
|
54
|
-
|
88
|
+
},
|
55
89
|
args: [],
|
56
90
|
source: "benchmark \x0a\x09\x22Handy bytecode-heavy benchmark\x22\x0a\x09\x22(500000 // time to run) = approx bytecodes per second\x22\x0a\x09\x225000000 // (Time millisecondsToRun: [10 benchmark]) * 1000\x22\x0a\x09\x223059000 on a Mac 8100/100\x22\x0a | size flags prime k count |\x0a size := 8190.\x0a 1 to: self do:\x0a [:iter |\x0a count := 0.\x0a flags := Array new.\x0a size timesRepeat: [ flags add: true].\x0a 1 to: size do:\x0a [:i | (flags at: i) ifTrue:\x0a [prime := i+1.\x0a k := i + prime.\x0a [k <= size] whileTrue:\x0a [flags at: k put: false.\x0a k := k + prime].\x0a count := count + 1]]].\x0a ^ count",
|
57
|
-
messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "
|
91
|
+
messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "+", "whileTrue:", "at:put:", "<=", "at:"],
|
58
92
|
referencedClasses: ["Array"]
|
59
93
|
}),
|
60
94
|
smalltalk.Number);
|
@@ -70,7 +104,8 @@ if (this < 2) {
|
|
70
104
|
return 1;
|
71
105
|
} else {
|
72
106
|
return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
|
73
|
-
|
107
|
+
;
|
108
|
+
return self},
|
74
109
|
args: [],
|
75
110
|
source: "jsbenchFib\x0a \x0a\x09<if (this < 2) {\x0areturn 1;\x0a} else {\x0areturn (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;}>",
|
76
111
|
messageSends: [],
|
@@ -107,7 +142,8 @@ for (var z=0;z<this;z++) {
|
|
107
142
|
}
|
108
143
|
}
|
109
144
|
return count;
|
110
|
-
|
145
|
+
;
|
146
|
+
return self},
|
111
147
|
args: [],
|
112
148
|
source: "jsbenchmark\x0a\x0a<\x0avar size = 8190;\x0avar count;\x0afor (var z=0;z<this;z++) {\x0a count = 0;\x0a var flags = new Array();\x0a for (var p=0; p<size; p++) {\x0a flags[p] = true;\x0a }\x0a for (var i=1;i<=size;i++) {\x0a if (flags[i-1]) {\x0a var prime = i+1;\x0a var k = i + prime;\x0a while (k <= size) {\x0a flags[k-1] = false;\x0a k = k + prime;\x0a }\x0a count = count + 1;\x0a }\x0a }\x0a}\x0areturn count>",
|
113
149
|
messageSends: [],
|
@@ -122,20 +158,41 @@ selector: "jstinyBenchmarks",
|
|
122
158
|
category: '*Benchfib',
|
123
159
|
fn: function (){
|
124
160
|
var self=this;
|
125
|
-
var
|
126
|
-
var
|
127
|
-
var
|
128
|
-
var
|
129
|
-
var
|
130
|
-
|
131
|
-
|
132
|
-
(
|
133
|
-
|
134
|
-
return smalltalk.send(
|
135
|
-
|
161
|
+
var $1;
|
162
|
+
var t1;
|
163
|
+
var t2;
|
164
|
+
var r;
|
165
|
+
var n1;
|
166
|
+
var n2;
|
167
|
+
n1=(1);
|
168
|
+
smalltalk.send((function(){
|
169
|
+
t1=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
170
|
+
return smalltalk.send(n1,"_jsbenchmark",[]);
|
171
|
+
})]);
|
172
|
+
t1;
|
173
|
+
return smalltalk.send(t1,"__lt",[(1000)]);
|
174
|
+
}),"_whileTrue_",[(function(){
|
175
|
+
n1=smalltalk.send(n1,"__star",[(2)]);
|
176
|
+
return n1;
|
177
|
+
})]);
|
178
|
+
n2=(28);
|
179
|
+
smalltalk.send((function(){
|
180
|
+
t2=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
181
|
+
r=smalltalk.send(n2,"_jsbenchFib",[]);
|
182
|
+
return r;
|
183
|
+
})]);
|
184
|
+
t2;
|
185
|
+
return smalltalk.send(t2,"__lt",[(1000)]);
|
186
|
+
}),"_whileTrue_",[(function(){
|
187
|
+
n2=smalltalk.send(n2,"__plus",[(1)]);
|
188
|
+
return n2;
|
189
|
+
})]);
|
190
|
+
$1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(n1,"__star",[(500000)]),"__star",[(1000)]),"__slash",[t1]),"_printString",[]),"__comma",[" bytecodes/sec; "]),"__comma",[smalltalk.send(smalltalk.send(smalltalk.send(r,"__star",[(1000)]),"__slash",[t2]),"_printString",[])]),"__comma",[" sends/sec"]);
|
191
|
+
return $1;
|
192
|
+
},
|
136
193
|
args: [],
|
137
194
|
source: "jstinyBenchmarks\x0a\x09\x220 jstinyBenchmarks\x22\x0a\x0a\x09| t1 t2 r n1 n2 |\x0a\x09n1 := 1.\x0a\x09[t1 := Date millisecondsToRun: [n1 jsbenchmark].\x0a\x09t1 < 1000] whileTrue:[n1 := n1 * 2]. \x22Note: #benchmark's runtime is about O(n)\x22\x0a\x0a\x09n2 := 28.\x0a\x09[t2 := Date millisecondsToRun: [r := n2 jsbenchFib].\x0a\x09t2 < 1000] whileTrue:[n2 := n2 + 1]. \x0a\x09\x22Note: #jsbenchFib's runtime is about O(k^n),\x0a\x09\x09where k is the golden number = (1 + 5 sqrt) / 2 = 1.618....\x22\x0a\x0a\x09^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',\x0a\x09 ((r * 1000) / t2) printString, ' sends/sec'",
|
138
|
-
messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", "<", "
|
195
|
+
messageSends: ["whileTrue:", "*", "millisecondsToRun:", "jsbenchmark", "<", "+", "jsbenchFib", ",", "printString", "/"],
|
139
196
|
referencedClasses: ["Date"]
|
140
197
|
}),
|
141
198
|
smalltalk.Number);
|
@@ -147,20 +204,41 @@ selector: "tinyBenchmarks",
|
|
147
204
|
category: '*Benchfib',
|
148
205
|
fn: function (){
|
149
206
|
var self=this;
|
150
|
-
var
|
151
|
-
var
|
152
|
-
var
|
153
|
-
var
|
154
|
-
var
|
155
|
-
|
156
|
-
|
157
|
-
(
|
158
|
-
|
159
|
-
return smalltalk.send(
|
160
|
-
|
207
|
+
var $1;
|
208
|
+
var t1;
|
209
|
+
var t2;
|
210
|
+
var r;
|
211
|
+
var n1;
|
212
|
+
var n2;
|
213
|
+
n1=(1);
|
214
|
+
smalltalk.send((function(){
|
215
|
+
t1=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
216
|
+
return smalltalk.send(n1,"_benchmark",[]);
|
217
|
+
})]);
|
218
|
+
t1;
|
219
|
+
return smalltalk.send(t1,"__lt",[(1000)]);
|
220
|
+
}),"_whileTrue_",[(function(){
|
221
|
+
n1=smalltalk.send(n1,"__star",[(2)]);
|
222
|
+
return n1;
|
223
|
+
})]);
|
224
|
+
n2=(16);
|
225
|
+
smalltalk.send((function(){
|
226
|
+
t2=smalltalk.send((smalltalk.Date || Date),"_millisecondsToRun_",[(function(){
|
227
|
+
r=smalltalk.send(n2,"_benchFib",[]);
|
228
|
+
return r;
|
229
|
+
})]);
|
230
|
+
t2;
|
231
|
+
return smalltalk.send(t2,"__lt",[(1000)]);
|
232
|
+
}),"_whileTrue_",[(function(){
|
233
|
+
n2=smalltalk.send(n2,"__plus",[(1)]);
|
234
|
+
return n2;
|
235
|
+
})]);
|
236
|
+
$1=smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(n1,"__star",[(500000)]),"__star",[(1000)]),"__slash",[t1]),"_printString",[]),"__comma",[" bytecodes/sec; "]),"__comma",[smalltalk.send(smalltalk.send(smalltalk.send(r,"__star",[(1000)]),"__slash",[t2]),"_printString",[])]),"__comma",[" sends/sec"]);
|
237
|
+
return $1;
|
238
|
+
},
|
161
239
|
args: [],
|
162
240
|
source: "tinyBenchmarks \x0a\x09\x22Report the results of running the two tiny Squeak benchmarks.\x0a\x09ar 9/10/1999: Adjusted to run at least 1 sec to get more stable results\x22\x0a\x09\x220 tinyBenchmarks\x22\x0a\x09\x22On a 292 MHz G3 Mac: 22727272 bytecodes/sec; 984169 sends/sec\x22\x0a\x09\x22On a 400 MHz PII/Win98: 18028169 bytecodes/sec; 1081272 sends/sec\x22\x0a\x09| t1 t2 r n1 n2 |\x0a\x09n1 := 1.\x0a\x09[t1 := Date millisecondsToRun: [n1 benchmark].\x0a\x09t1 < 1000] whileTrue:[n1 := n1 * 2]. \x22Note: #benchmark's runtime is about O(n)\x22\x0a\x0a\x09n2 := 16.\x0a\x09[t2 := Date millisecondsToRun: [r := n2 benchFib].\x0a\x09t2 < 1000] whileTrue:[n2 := n2 + 1]. \x0a\x09\x22Note: #benchFib's runtime is about O(k^n),\x0a\x09\x09where k is the golden number = (1 + 5 sqrt) / 2 = 1.618....\x22\x0a\x0a\x09^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',\x0a\x09 ((r * 1000) / t2) printString, ' sends/sec'",
|
163
|
-
messageSends: ["whileTrue:", "millisecondsToRun:", "benchmark", "<", "
|
241
|
+
messageSends: ["whileTrue:", "*", "millisecondsToRun:", "benchmark", "<", "+", "benchFib", ",", "printString", "/"],
|
164
242
|
referencedClasses: ["Date"]
|
165
243
|
}),
|
166
244
|
smalltalk.Number);
|