-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasddd.js
39 lines (32 loc) · 786 Bytes
/
asddd.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function acceptExpression(node, env, scope) {
var ret = { value: null };
// Primitive literals are unambiguously non-array representations of
// themselves.
if (typeof node !== 'object' || node === null) {
ret.value = node;
} else {
ret.value = evaluateNode(node, env, scope);
}
return ret;
}
function evaluateNode(node, env, scope) {
switch (node[0]) {
// can be used by manualElement
case 'value': return 'hello';
}
return 'bro';
}
function loop(input, count) {
for (var i =0; i < count; i++) {
acceptExpression(input, {}, {});
}
}
function foo() {
loop(1, 100);
loop([1,2,3], 100);
%OptimizeFunctionOnNextCall(acceptExpression);
loop([], 1);
%OptimizeFunctionOnNextCall(acceptExpression);
loop([1,2,3], 100);
}
foo();