// ------------------------------------------------------------------ // ciConstant::print void ciConstant::print() { tty->print("<ciConstant type=%s value=", basictype_to_str(basic_type())); switch (basic_type()) { case T_BOOLEAN: tty->print("%s", bool_to_str(_value._int != 0)); break; case T_CHAR: case T_BYTE: case T_SHORT: case T_INT: tty->print("%d", _value._int); break; case T_LONG: tty->print(INT64_FORMAT, _value._long); break; case T_FLOAT: tty->print("%f", _value._float); break; case T_DOUBLE: tty->print("%lf", _value._double); break; case T_OBJECT: case T_ARRAY: _value._object->print(); break; default: tty->print("ILLEGAL"); break; } tty->print(">"); }
// ------------------------------------------------------------------ // ciType::box_klass // ciKlass* ciType::box_klass() { if (!is_primitive_type()) return this->as_klass(); // reference types are "self boxing" // Void is "boxed" with a null. if (basic_type() == T_VOID) return NULL; VM_ENTRY_MARK; return CURRENT_THREAD_ENV->get_instance_klass(SystemDictionary::box_klass(basic_type())); }
static gboolean mn_eval_default_expr(cml_node *mn, cml_atom *val) { if (mn->expr == 0) return FALSE; /* no explicit expression for default value */ cml_atom_init(val); expr_evaluate(mn->expr, val); if (basic_type(val->type) != basic_type(mn->value_type) && mn->value_type != A_NONE) return FALSE; return TRUE; }
// Report if this is a zero value (not top). bool is_zero_type() const { BasicType type = basic_type(); if (type == T_VOID || type >= T_CONFLICT) return false; else return (this == _zero_type[type]); }
// ------------------------------------------------------------------ // ciType::name // // Return the name of this type const char* ciType::name() { if (is_primitive_type()) { return type2name(basic_type()); } else { assert(is_klass(), "must be"); return as_klass()->name()->as_utf8(); } }
BasicType FieldType::get_array_info(symbolOop signature, jint* dimension, symbolOop* object_key, TRAPS) { assert(basic_type(signature) == T_ARRAY, "must be array"); int index = 1; int dim = 1; skip_optional_size(signature, &index); while (signature->byte_at(index) == '[') { index++; dim++; skip_optional_size(signature, &index); } ResourceMark rm; symbolOop element = oopFactory::new_symbol(signature->as_C_string() + index, CHECK_(T_BYTE)); BasicType element_type = FieldType::basic_type(element); if (element_type == T_OBJECT) { char* object_type = element->as_C_string(); object_type[element->utf8_length() - 1] = '\0'; *object_key = oopFactory::new_symbol(object_type + 1, CHECK_(T_BYTE)); } // Pass dimension back to caller *dimension = dim; return element_type; }
// ------------------------------------------------------------------ // ciType::java_mirror // ciInstance* ciType::java_mirror() { VM_ENTRY_MARK; return CURRENT_THREAD_ENV->get_instance(Universe::java_mirror(basic_type())); }
bool is_void() const { return basic_type() == T_VOID; }
int size() const { return type2size[basic_type()]; }
// Returns true if this is not a klass or array (i.e., not a reference type). bool is_primitive_type() const { return basic_type() != T_OBJECT && basic_type() != T_ARRAY; }
// ------------------------------------------------------------------ // ciType::print_name // // Print the name of this type void ciType::print_name_on(outputStream* st) { st->print(type2name(basic_type())); }
static value_type generate_value(Gen& gen, size_t max, std::pair<const basic_type, basic_type>) { return std::make_pair(basic_type(gen, max), basic_type(gen, max)); }
static value_type generate_value(Gen& r_gen, size_t max, basic_type) { return basic_type(r_gen, max); }
static value_type generate_value(Gen& r_gen, size_t max, __gnu_pbds::null_type) { return basic_type(r_gen, max); }
static key_type generate_key(Gen& r_gen, size_t max) { return basic_type(r_gen, max); }