Repository navigation
Expand file tree
/
Copy pathIRStaticScopeFactory.java
More file actions
59 lines (47 loc) · 1.76 KB
/
Copy pathIRStaticScopeFactory.java
File metadata and controls
59 lines (47 loc) · 1.76 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package org.jruby.parser;
import org.jruby.Ruby;
/**
* Allocate IR-friendly static scopes (it is also a marker
* for constructing IR-friendly dynamic scopes.
*/
public class IRStaticScopeFactory extends StaticScopeFactory {
public IRStaticScopeFactory(Ruby runtime) {
super(runtime);
}
@Override
public StaticScope newBlockScope(StaticScope parent) {
return new IRStaticScope(parent, true, false);
}
@Override
public StaticScope newBlockScope(StaticScope parent, String[] names) {
return new IRStaticScope(parent, names, true, false);
}
@Override
public StaticScope newEvalScope(StaticScope parent) {
return new IRStaticScope(parent, true, true);
}
@Override
public StaticScope newEvalScope(StaticScope parent, String[] names) {
return new IRStaticScope(parent, names, true, true);
}
@Override
public StaticScope newLocalScope(StaticScope parent) {
return new IRStaticScope(parent, false, false);
}
@Override
public StaticScope newLocalScope(StaticScope parent, String[] names) {
return new IRStaticScope(parent, names, false, false);
}
// We only call these from inside IR impl (IR is all or nothing)
public static StaticScope newIRBlockScope(StaticScope parent) {
return new IRStaticScope(parent, true, false);
}
// We only call these from inside IR impl (IR is all or nothing)
public static StaticScope newIRLocalScope(StaticScope parent) {
return new IRStaticScope(parent, false, false);
}
// We only call these from inside IR impl (IR is all or nothing)
public static StaticScope newIREvalScope(StaticScope parent) {
return new IRStaticScope(parent, true, true);
}
}