forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeVersion.java
More file actions
30 lines (23 loc) · 986 Bytes
/
Copy pathCodeVersion.java
File metadata and controls
30 lines (23 loc) · 986 Bytes
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
package org.jruby.ir;
public class CodeVersion {
private static long _nextVersionNumber = 0L;
// SSS FIXME: Does int suffice, or do we need long?
public final long _version;
public static CodeVersion getClassVersionToken() {
return new ClassCodeVersion();
}
public static CodeVersion getMethodVersionToken() {
return new MethodCodeVersion();
}
protected CodeVersion(long v) { _version = v; }
static class ClassCodeVersion extends CodeVersion {
ClassCodeVersion() { super(_nextVersionNumber+1); _nextVersionNumber++; }
public String toString() { return "C_" + super.toString(); }
private static long _nextVersionNumber = 0L;
}
static class MethodCodeVersion extends CodeVersion {
MethodCodeVersion() { super(_nextVersionNumber+1); _nextVersionNumber++; }
public String toString() { return "M_" + super.toString(); }
private static long _nextVersionNumber = 0L;
}
}