Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8234508

VM_HeapWalkOperation::iterate_over_object reads non-strong fields with an on-strong load barrier

XMLWordPrintable

    • gc
    • b27

        I added some verification code to check that we never apply on-strong load barriers to non-strong fields.

        The verification triggered at this point:
        // an object references a class and its instance fields
        // (static fields are ignored here as we report these as
        // references from the class).
        inline bool VM_HeapWalkOperation::iterate_over_object(oop o) {
          // reference to the class
          if (!CallbackInvoker::report_class_reference(o, o->klass()->java_mirror())) {
            return false;
          }

          // iterate over instance fields
          ClassFieldMap* field_map = JvmtiCachedClassFieldMap::get_map_of_instance_fields(o);
          for (int i=0; i<field_map->field_count(); i++) {
            ClassFieldDescriptor* field = field_map->field_at(i);
            char type = field->field_type();
            if (!is_primitive_field_type(type)) {
              oop fld_o = o->obj_field(field->field_offset()); <<< Here

              stefank Stefan Karlsson
              stefank Stefan Karlsson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: