src/share/vm/oops/fieldStreams.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/oops/fieldStreams.hpp Wed Sep 11 19:08:45 2013
--- new/src/share/vm/oops/fieldStreams.hpp Wed Sep 11 19:08:44 2013
*** 1,7 ****
--- 1,7 ----
/*
! * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
! * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 25,34 ****
--- 25,35 ----
#ifndef SHARE_VM_OOPS_FIELDSTREAMS_HPP
#define SHARE_VM_OOPS_FIELDSTREAMS_HPP
#include "oops/instanceKlass.hpp"
#include "oops/fieldInfo.hpp"
+ #include "runtime/fieldDescriptor.hpp"
// The is the base class for iteration over the fields array
// describing the declared fields in the class. Several subclasses
// are provided depending on the kind of iteration required. The
// JavaFieldStream is for iterating over regular Java fields and it
*** 41,52 ****
--- 42,55 ----
Array<u2>* _fields;
constantPoolHandle _constants;
int _index;
int _limit;
int _generic_signature_slot;
+ fieldDescriptor _fd_buf;
FieldInfo* field() const { return FieldInfo::from_field_array(_fields, _index); }
+ InstanceKlass* field_holder() const { return _constants->pool_holder(); }
int init_generic_signature_start_slot() {
int length = _fields->length();
int num_fields = 0;
int skipped_generic_signature_slots = 0;
*** 100,116 ****
--- 103,121 ----
_fields = klass->fields();
_constants = klass->constants();
_index = 0;
_limit = klass->java_fields_count();
init_generic_signature_start_slot();
+ assert(klass == field_holder(), "");
}
FieldStreamBase(instanceKlassHandle klass) {
_fields = klass->fields();
_constants = klass->constants();
_index = 0;
_limit = klass->java_fields_count();
init_generic_signature_start_slot();
+ assert(klass == field_holder(), "");
}
// accessors
int index() const { return _index; }
*** 178,187 ****
--- 183,198 ----
int contended_group() const {
return field()->contended_group();
}
+ // bridge to a heavier API:
+ fieldDescriptor& field_descriptor() const {
+ fieldDescriptor& field = const_cast<fieldDescriptor&>(_fd_buf);
+ field.reinitialize(field_holder(), _index);
+ return field;
+ }
};
// Iterate over only the internal fields
class JavaFieldStream : public FieldStreamBase {
public:
src/share/vm/oops/fieldStreams.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File