47 static final int LOCATION_CODE = 0; |
47 static final int LOCATION_CODE = 0; |
48 static final int CONSTANT_INT_CODE = 1; |
48 static final int CONSTANT_INT_CODE = 1; |
49 static final int CONSTANT_OOP_CODE = 2; |
49 static final int CONSTANT_OOP_CODE = 2; |
50 static final int CONSTANT_LONG_CODE = 3; |
50 static final int CONSTANT_LONG_CODE = 3; |
51 static final int CONSTANT_DOUBLE_CODE = 4; |
51 static final int CONSTANT_DOUBLE_CODE = 4; |
|
52 static final int CONSTANT_OBJECT_CODE = 5; |
|
53 static final int CONSTANT_OBJECT_ID_CODE = 6; |
52 |
54 |
53 public boolean isLocation() { return false; } |
55 public boolean isLocation() { return false; } |
54 public boolean isConstantInt() { return false; } |
56 public boolean isConstantInt() { return false; } |
55 public boolean isConstantDouble() { return false; } |
57 public boolean isConstantDouble() { return false; } |
56 public boolean isConstantLong() { return false; } |
58 public boolean isConstantLong() { return false; } |
57 public boolean isConstantOop() { return false; } |
59 public boolean isConstantOop() { return false; } |
|
60 public boolean isObject() { return false; } |
58 |
61 |
59 public static ScopeValue readFrom(DebugInfoReadStream stream) { |
62 public static ScopeValue readFrom(DebugInfoReadStream stream) { |
60 switch (stream.readInt()) { |
63 switch (stream.readInt()) { |
61 case LOCATION_CODE: |
64 case LOCATION_CODE: |
62 return new LocationValue(stream); |
65 return new LocationValue(stream); |
66 return new ConstantOopReadValue(stream); |
69 return new ConstantOopReadValue(stream); |
67 case CONSTANT_LONG_CODE: |
70 case CONSTANT_LONG_CODE: |
68 return new ConstantLongValue(stream); |
71 return new ConstantLongValue(stream); |
69 case CONSTANT_DOUBLE_CODE: |
72 case CONSTANT_DOUBLE_CODE: |
70 return new ConstantDoubleValue(stream); |
73 return new ConstantDoubleValue(stream); |
|
74 case CONSTANT_OBJECT_CODE: |
|
75 return stream.readObjectValue(); |
|
76 case CONSTANT_OBJECT_ID_CODE: |
|
77 return stream.getCachedObject(); |
71 default: |
78 default: |
72 Assert.that(false, "should not reach here"); |
79 Assert.that(false, "should not reach here"); |
73 return null; |
80 return null; |
74 } |
81 } |
75 } |
82 } |