classFileParser.hpp revision 3650
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "classfile/classFileStream.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "oops/typeArrayOop.hpp"
#include "runtime/handles.inline.hpp"
#include "utilities/accessFlags.hpp"
class TempNewSymbol;
class FieldAllocationCount;
// Parser for for .class files
//
// The bytes describing the class file structure is read from a Stream object
class ClassFileParser VALUE_OBJ_CLASS_SPEC {
private:
bool _need_verify;
bool _relax_verify;
bool _has_finalizer;
bool _has_empty_finalizer;
bool _has_vanilla_constructor;
enum { fixed_buffer_size = 128 };
// Accessors
// Constant pool parsing
// Interface parsing
int length,
TRAPS);
// Field parsing
bool* is_synthetic_addr,
// Method parsing
TRAPS);
bool* has_final_method,
TRAPS);
TRAPS);
void parse_linenumber_table(
// Classfile attribute parsing
instanceKlassHandle k, TRAPS);
void parse_classfile_bootstrap_methods_attribute(constantPoolHandle cp, instanceKlassHandle k, u4 attribute_length, TRAPS);
// Annotations handling
// Final setup
unsigned int nonstatic_oop_count,
void fill_oop_maps(instanceKlassHandle k,
unsigned int nonstatic_oop_map_count,
int* nonstatic_oop_offsets,
unsigned int* nonstatic_oop_counts);
void set_precomputed_flags(instanceKlassHandle k);
// Format checker methods
}
#ifdef ASSERT
#endif
}
if (_need_verify) {
} else {
}
}
if (_need_verify) {
} else {
}
}
}
}
}
void throwIllegalSignature(
void verify_constantvalue(int constantvalue_index, int signature_index, constantPoolHandle cp, TRAPS);
bool is_anonymous() {
return _host_klass.not_null();
}
bool has_cp_patch_at(int index) {
return (_cp_patches != NULL
}
}
return patch;
}
// Wrapper for constantTag.is_klass_[or_]reference.
// In older versions of the VM, klassOops cannot sneak into early phases of
// constant pool construction, but in later versions they can.
// %%% Let's phase out the old is_klass_reference.
return ((LinkWellKnownClasses || EnableInvokeDynamic)
}
public:
// Constructor
// Parse .class file and return new klassOop. The klassOop is not hooked up
// to the system dictionary or any other structures, so a .class file can
// be loaded several times if desired.
// The system dictionary hookup is done by the caller.
//
// "parsed_name" is updated by this method, and is the name found
// while parsing the stream.
bool verify,
TRAPS) {
return parseClassFile(name, class_loader, protection_domain, no_host_klass, NULL, parsed_name, verify, THREAD);
}
bool verify,
TRAPS);
// Verifier checks
};
#endif // SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP