1 /* |
1 /* |
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
83 Unimplemented(); |
83 Unimplemented(); |
84 return NULL; |
84 return NULL; |
85 } |
85 } |
86 |
86 |
87 |
87 |
88 |
|
89 jobject ObjectType::encoding() const { |
|
90 assert(is_constant(), "must be"); |
|
91 return constant_value()->constant_encoding(); |
|
92 } |
|
93 |
|
94 bool ObjectType::is_loaded() const { |
|
95 assert(is_constant(), "must be"); |
|
96 return constant_value()->is_loaded(); |
|
97 } |
|
98 |
|
99 ciObject* ObjectConstant::constant_value() const { return _value; } |
|
100 ciObject* ArrayConstant::constant_value() const { return _value; } |
|
101 ciObject* InstanceConstant::constant_value() const { return _value; } |
|
102 ciObject* ClassConstant::constant_value() const { return _value; } |
|
103 |
|
104 ciType* ObjectConstant::exact_type() const { |
88 ciType* ObjectConstant::exact_type() const { |
105 ciObject* c = constant_value(); |
89 ciObject* c = constant_value(); |
106 return (c != NULL && !c->is_null_object()) ? c->klass() : NULL; |
90 return (c != NULL && !c->is_null_object()) ? c->klass() : NULL; |
107 } |
91 } |
108 ciType* ArrayConstant::exact_type() const { |
92 ciType* ArrayConstant::exact_type() const { |
112 ciType* InstanceConstant::exact_type() const { |
96 ciType* InstanceConstant::exact_type() const { |
113 ciObject* c = constant_value(); |
97 ciObject* c = constant_value(); |
114 return (c != NULL && !c->is_null_object()) ? c->klass() : NULL; |
98 return (c != NULL && !c->is_null_object()) ? c->klass() : NULL; |
115 } |
99 } |
116 ciType* ClassConstant::exact_type() const { |
100 ciType* ClassConstant::exact_type() const { |
117 ciObject* c = constant_value(); |
101 return Compilation::current()->env()->Class_klass(); |
118 return (c != NULL && !c->is_null_object()) ? c->klass() : NULL; |
|
119 } |
102 } |
120 |
103 |
|
104 |
|
105 jobject ObjectType::encoding() const { |
|
106 assert(is_constant(), "must be"); |
|
107 return constant_value()->constant_encoding(); |
|
108 } |
|
109 |
|
110 bool ObjectType::is_loaded() const { |
|
111 assert(is_constant(), "must be"); |
|
112 return constant_value()->is_loaded(); |
|
113 } |
|
114 |
|
115 bool MetadataType::is_loaded() const { |
|
116 assert(is_constant(), "must be"); |
|
117 return constant_value()->is_loaded(); |
|
118 } |
|
119 |
|
120 ciObject* ObjectConstant::constant_value() const { return _value; } |
|
121 ciObject* ArrayConstant::constant_value() const { return _value; } |
|
122 ciObject* InstanceConstant::constant_value() const { return _value; } |
121 |
123 |
122 ValueType* as_ValueType(BasicType type) { |
124 ValueType* as_ValueType(BasicType type) { |
123 switch (type) { |
125 switch (type) { |
124 case T_VOID : return voidType; |
126 case T_VOID : return voidType; |
125 case T_BYTE : // fall through |
127 case T_BYTE : // fall through |