Home | History | Annotate | Download | only in ijar

Lines Matching defs:Constant

46 enum CONSTANT {
98 struct Constant;
101 static std::vector<Constant*> const_pool_in; // input constant pool
102 static std::vector<Constant*> const_pool_out; // output constant_pool
104 static Constant * class_name;
106 // Returns the Constant object, given an index into the input constant pool.
107 // Note: constant(0) == NULL; this invariant is exploited by the
109 inline Constant *constant(int idx) {
111 fprintf(stderr, "Illegal constant pool index: %d\n", idx);
124 struct Constant {
126 Constant(u1 tag) :
130 virtual ~Constant() {}
138 // Called by slot() when a constant has been identified as required
139 // in the output classfile's constant pool. This is a hook allowing
148 // Returns the index of this constant in the output class's constant
158 fprintf(stderr, "Constant::slot() called before output phase.\n");
169 u2 slot_; // zero => "this constant is unreachable garbage"
181 struct Constant_Class : Constant
184 Constant(CONSTANT_Class),
189 put_u2be(p, constant(name_index_)->slot());
193 return constant(name_index_)->Display();
196 void Keep() { constant(name_index_)->slot(); }
202 struct Constant_FMIref : Constant
207 Constant(tag),
213 put_u2be(p, constant(class_index_)->slot());
214 put_u2be(p, constant(name_type_index_)->slot());
218 return constant(class_index_)->Display() + "::" +
219 constant(name_type_index_)->Display();
223 constant(class_index_)->slot();
224 constant(name_type_index_)->slot();
232 struct Constant_String : Constant
235 Constant(CONSTANT_String),
240 put_u2be(p, constant(string_index_)->slot());
244 return "\"" + constant(string_index_)->Display() + "\"";
247 void Keep() { constant(string_index_)->slot(); }
253 struct Constant_IntegerOrFloat : Constant
256 Constant(tag),
288 struct Constant_NameAndType : Constant
291 Constant(CONSTANT_NameAndType),
297 put_u2be(p, constant(name_index_)->slot());
298 put_u2be(p, constant(descr_index_)->slot());
302 return constant(name_index_)->Display() + "::" +
303 constant(descr_index_)->Display();
307 constant(name_index_)->slot();
308 constant(descr_index_)->slot();
316 struct Constant_Utf8 : Constant
319 Constant(CONSTANT_Utf8),
338 struct Constant_MethodHandle : Constant
341 Constant(CONSTANT_MethodHandle),
353 + constant(reference_index_)->Display();
361 struct Constant_MethodType : Constant
364 Constant(CONSTANT_MethodType),
373 return "Constant_MethodType::" + constant(descriptor_index_)->Display();
380 struct Constant_InvokeDynamic : Constant
383 Constant(CONSTANT_InvokeDynamic),
396 + constant(name_and_type_index_)->Display();
421 Constant *attribute_name_;
427 static ExceptionsAttribute* Read(const u1 *&p, Constant *attribute_name) {
432 attr->exceptions_.push_back(constant(get_u2be(p)));
445 std::vector<Constant*> exceptions_;
452 Constant *inner_class_info;
453 Constant *outer_class_info;
454 Constant *inner_name;
464 static InnerClassesAttribute* Read(const u1 *&p, Constant *attribute_name) {
471 entry->inner_class_info = constant(get_u2be(p));
472 entry->outer_class_info = constant(get_u2be(p));
473 entry->inner_name = constant(get_u2be(p));
483 // We keep an entry if the constant referring to the inner class is already
550 Constant *attribute_name) {
553 attr->class_ = constant(get_u2be(p));
554 attr->method_ = constant(get_u2be(p));
564 Constant *class_;
565 Constant *method_;
586 value->const_value_ = constant(get_u2be(p));
589 Constant *const_value_;
600 value->type_name_ = constant(get_u2be(p));
601 value->const_name_ = constant(get_u2be(p));
604 Constant *type_name_;
605 Constant *const_name_;
621 value->class_info_ = constant(get_u2be(p));
624 Constant *class_info_;
683 value->type_ = constant(get_u2be(p));
687 pair->element_name_ = constant(get_u2be(p));
693 Constant *type_;
695 Constant *element_name_;
941 Constant *attribute_name) {
962 // compile-time constant propagation.
965 static ConstantValueAttribute* Read(const u1 *&p, Constant *attribute_name) {
968 attr->constantvalue_ = constant(get_u2be(p));
977 Constant *constantvalue_;
985 static SignatureAttribute* Read(const u1 *&p, Constant *attribute_name) {
988 attr->signature_ = constant(get_u2be(p));
1002 Constant *signature_;
1010 static DeprecatedAttribute* Read(const u1 *&, Constant *attribute_name) {
1032 static AnnotationsAttribute* Read(const u1 *&p, Constant *attribute_name) {
1069 Constant *attribute_name) {
1114 static TypeAnnotationsAttribute* Read(const u1 *&p, Constant *attribute_name,
1146 static GeneralAttribute* Read(const u1 *&p, Constant *attribute_name,
1194 Constant *name;
1195 Constant *descriptor;
1200 m->name = constant(get_u2be(p));
1201 m->descriptor = constant(get_u2be(p));
1226 Constant *this_class;
1227 Constant *super_class;
1228 std::vector<Constant*> interfaces;
1241 // Constants do not need to be deleted; they are owned by the constant pool.
1304 Constant *attribute_name = constant(get_u2be(p));
1440 // Longs and doubles occupy two constant pool slots.
1441 // ("In retrospect, making 8-byte constants take two "constant
1467 fprintf(stderr, "Unknown constant: %02x. Passing class through.\n",
1547 clazz->this_class = constant(get_u2be(p));
1551 clazz->super_class = super_class_id == 0 ? NULL : constant(super_class_id);
1555 clazz->interfaces.push_back(constant(get_u2be(p)));
1750 // the essential constants and populate the output constant pool:
1769 // Constant pool item zero is a dummy entry. Setting it marks the
1770 // beginning of the output phase; calls to Constant::slot() will