< prev index next >

src/hotspot/share/ci/ciInstance.cpp

Print this page
@@ -37,11 +37,11 @@
  // This class represents an instanceOop in the HotSpot virtual
  // machine.
  
  // ------------------------------------------------------------------
  // ciObject::java_mirror_type
- ciType* ciInstance::java_mirror_type() {
+ ciType* ciInstance::java_mirror_type(bool* is_val_mirror) {
    VM_ENTRY_MARK;
    oop m = get_oop();
    // Return NULL if it is not java.lang.Class.
    if (m == NULL || m->klass() != vmClasses::Class_klass()) {
      return NULL;

@@ -50,10 +50,13 @@
    if (java_lang_Class::is_primitive(m)) {
      return ciType::make(java_lang_Class::primitive_type(m));
    } else {
      Klass* k = java_lang_Class::as_Klass(m);
      assert(k != NULL, "");
+     if (is_val_mirror != NULL) {
+       *is_val_mirror = java_lang_Class::is_secondary_mirror(m);
+     }
      return CURRENT_THREAD_ENV->get_klass(k);
    }
  }
  
  // ------------------------------------------------------------------

@@ -68,10 +71,11 @@
      case T_BOOLEAN: return ciConstant(field_btype, obj->bool_field(offset));
      case T_INT:     return ciConstant(field_btype, obj->int_field(offset));
      case T_FLOAT:   return ciConstant(obj->float_field(offset));
      case T_DOUBLE:  return ciConstant(obj->double_field(offset));
      case T_LONG:    return ciConstant(obj->long_field(offset));
+     case T_INLINE_TYPE:  // fall through
      case T_OBJECT:  // fall through
      case T_ARRAY: {
        oop o = obj->obj_field(offset);
  
        // A field will be "constant" if it is known always to be

@@ -98,11 +102,12 @@
  //
  // Constant value of a field.
  ciConstant ciInstance::field_value(ciField* field) {
    assert(is_loaded(), "invalid access - must be loaded");
    assert(field->holder()->is_loaded(), "invalid access - holder must be loaded");
-   assert(field->is_static() || klass()->is_subclass_of(field->holder()), "invalid access - must be subclass");
+   assert(field->is_static() || field->holder()->is_inlinetype() || klass()->is_subclass_of(field->holder()),
+          "invalid access - must be subclass");
  
    GUARDED_VM_ENTRY(return field_value_impl(field->type()->basic_type(), field->offset());)
  }
  
  // ------------------------------------------------------------------
< prev index next >