- 浏览: 209324 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
Prepared:
Hadoop的几个明显缺点 -
CSunDNan:
...
openjdk jvm 方法字节码执行过程 -
幻影之蚀:
...
mysql 源码分析2 源码调试环境建立 -
shukongchengje:
紧急呼唤楼主,mysql代码从哪里弄?官网wiki上看的一头雾 ...
mysql源码分析 整体架构 -
yeshaoting:
好文章.不介意的话转载了.
jvm 字节码中文含义
struct ClassFile
{
u4 magic; //识别Class文件格式,具体值为0xCAFEBABE,
u2 minor_version; // Class文件格式副版本号,
u2 major_version; // Class文件格式主版本号,
u2 constant_pool_count; // 常数表项个数,
cp_info **constant_pool;// 常数表,又称变长符号表,
u2 access_flags; //Class的声明中使用的修饰符掩码,
u2 this_class; //常数表索引,索引内保存类名或接口名,
u2 super_class; //常数表索引,索引内保存父类名,
u2 interfaces_count; //超接口个数,
u2 *interfaces; //常数表索引,各超接口名称,
u2 fields_count; //类的域个数,
field_info **fields; //域数据,包括属性名称索引,
//域修饰符掩码等,
u2 methods_count; //方法个数,
method_info **methods;//方法数据,包括方法名称索引,方法修饰符掩码等,
u2 attributes_count; //类附加属性个数,
attribute_info **attributes; //类附加属性数据,包括源文件名等。
};
class ClassFileParser VALUE_OBJ_CLASS_SPEC {
private:
bool _need_verify;
bool _relax_verify;
u2 _major_version;
u2 _minor_version;
symbolHandle _class_name;
KlassHandle _host_klass;
GrowableArray<Handle>* _cp_patches; // overrides for CP entries
bool _has_finalizer;
bool _has_empty_finalizer;
bool _has_vanilla_constructor;
enum { fixed_buffer_size = 128 };
u_char linenumbertable_buffer[fixed_buffer_size];
ClassFileStream* _stream; // Actual input stream
enum { LegalClass, LegalField, LegalMethod }; // used to verify unqualified names
// Accessors
ClassFileStream* stream() { return _stream; }
void set_stream(ClassFileStream* st) { _stream = st; }
// Constant pool parsing
void parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS);
constantPoolHandle parse_constant_pool(TRAPS);
// Interface parsing
objArrayHandle parse_interfaces(constantPoolHandle cp,
int length,
Handle class_loader,
Handle protection_domain,
symbolHandle class_name,
TRAPS);
// Field parsing
void parse_field_attributes(constantPoolHandle cp, u2 attributes_count,
bool is_static, u2 signature_index,
u2* constantvalue_index_addr,
bool* is_synthetic_addr,
u2* generic_signature_index_addr,
typeArrayHandle* field_annotations, TRAPS);
typeArrayHandle parse_fields(constantPoolHandle cp, bool is_interface,
struct FieldAllocationCount *fac,
objArrayHandle* fields_annotations, TRAPS);
// Method parsing
methodHandle parse_method(constantPoolHandle cp, bool is_interface,
AccessFlags* promoted_flags,
typeArrayHandle* method_annotations,
typeArrayHandle* method_parameter_annotations,
typeArrayHandle* method_default_annotations,
TRAPS);
objArrayHandle parse_methods (constantPoolHandle cp, bool is_interface,
AccessFlags* promoted_flags,
bool* has_final_method,
objArrayOop* methods_annotations_oop,
objArrayOop* methods_parameter_annotations_oop,
objArrayOop* methods_default_annotations_oop,
TRAPS);
typeArrayHandle sort_methods (objArrayHandle methods,
objArrayHandle methods_annotations,
objArrayHandle methods_parameter_annotations,
objArrayHandle methods_default_annotations,
TRAPS);
typeArrayHandle parse_exception_table(u4 code_length, u4 exception_table_length,
constantPoolHandle cp, TRAPS);
void parse_linenumber_table(
u4 code_attribute_length, u4 code_length,
CompressedLineNumberWriteStream** write_stream, TRAPS);
u2* parse_localvariable_table(u4 code_length, u2 max_locals, u4 code_attribute_length,
constantPoolHandle cp, u2* localvariable_table_length,
bool isLVTT, TRAPS);
u2* parse_checked_exceptions(u2* checked_exceptions_length, u4 method_attribute_length,
constantPoolHandle cp, TRAPS);
void parse_type_array(u2 array_length, u4 code_length, u4* u1_index, u4* u2_index,
u1* u1_array, u2* u2_array, constantPoolHandle cp, TRAPS);
typeArrayOop parse_stackmap_table(u4 code_attribute_length, TRAPS);
// Classfile attribute parsing
void parse_classfile_sourcefile_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
void parse_classfile_source_debug_extension_attribute(constantPoolHandle cp,
instanceKlassHandle k, int length, TRAPS);
u2 parse_classfile_inner_classes_attribute(constantPoolHandle cp,
instanceKlassHandle k, TRAPS);
void parse_classfile_attributes(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
void parse_classfile_synthetic_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
void parse_classfile_signature_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
// Annotations handling
typeArrayHandle assemble_annotations(u1* runtime_visible_annotations,
int runtime_visible_annotations_length,
u1* runtime_invisible_annotations,
int runtime_invisible_annotations_length, TRAPS);
// Final setup
unsigned int compute_oop_map_count(instanceKlassHandle super,
unsigned int nonstatic_oop_count,
int first_nonstatic_oop_offset);
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);
objArrayHandle compute_transitive_interfaces(instanceKlassHandle super,
objArrayHandle local_ifs, TRAPS);
// Special handling for certain classes.
// Add the "discovered" field to java.lang.ref.Reference if
// it does not exist.
void java_lang_ref_Reference_fix_pre(typeArrayHandle* fields_ptr,
constantPoolHandle cp, FieldAllocationCount *fac_ptr, TRAPS);
// Adjust the field allocation counts for java.lang.Class to add
// fake fields.
void java_lang_Class_fix_pre(objArrayHandle* methods_ptr,
FieldAllocationCount *fac_ptr, TRAPS);
// Adjust the next_nonstatic_oop_offset to place the fake fields
// before any Java fields.
void java_lang_Class_fix_post(int* next_nonstatic_oop_offset);
// Adjust the field allocation counts for java.dyn.MethodHandle to add
// a fake address (void*) field.
void java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
typeArrayHandle* fields_ptr,
FieldAllocationCount *fac_ptr, TRAPS);
// Format checker methods
void classfile_parse_error(const char* msg, TRAPS);
void classfile_parse_error(const char* msg, int index, TRAPS);
void classfile_parse_error(const char* msg, const char *name, TRAPS);
void classfile_parse_error(const char* msg, int index, const char *name, TRAPS);
inline void guarantee_property(bool b, const char* msg, TRAPS) {
if (!b) { classfile_parse_error(msg, CHECK); }
}
inline void assert_property(bool b, const char* msg, TRAPS) {
#ifdef ASSERT
if (!b) { fatal(msg); }
#endif
}
inline void check_property(bool property, const char* msg, int index, TRAPS) {
if (_need_verify) {
guarantee_property(property, msg, index, CHECK);
} else {
assert_property(property, msg, CHECK);
}
}
inline void check_property(bool property, const char* msg, TRAPS) {
if (_need_verify) {
guarantee_property(property, msg, CHECK);
} else {
assert_property(property, msg, CHECK);
}
}
inline void guarantee_property(bool b, const char* msg, int index, TRAPS) {
if (!b) { classfile_parse_error(msg, index, CHECK); }
}
inline void guarantee_property(bool b, const char* msg, const char *name, TRAPS) {
if (!b) { classfile_parse_error(msg, name, CHECK); }
}
inline void guarantee_property(bool b, const char* msg, int index, const char *name, TRAPS) {
if (!b) { classfile_parse_error(msg, index, name, CHECK); }
}
bool is_supported_version(u2 major, u2 minor);
bool has_illegal_visibility(jint flags);
void verify_constantvalue(int constantvalue_index, int signature_index, constantPoolHandle cp, TRAPS);
void verify_legal_utf8(const unsigned char* buffer, int length, TRAPS);
void verify_legal_class_name(symbolHandle name, TRAPS);
void verify_legal_field_name(symbolHandle name, TRAPS);
void verify_legal_method_name(symbolHandle name, TRAPS);
void verify_legal_field_signature(symbolHandle fieldname, symbolHandle signature, TRAPS);
int verify_legal_method_signature(symbolHandle methodname, symbolHandle signature, TRAPS);
void verify_legal_class_modifiers(jint flags, TRAPS);
void verify_legal_field_modifiers(jint flags, bool is_interface, TRAPS);
void verify_legal_method_modifiers(jint flags, bool is_interface, symbolHandle name, TRAPS);
bool verify_unqualified_name(char* name, unsigned int length, int type);
char* skip_over_field_name(char* name, bool slash_ok, unsigned int length);
char* skip_over_field_signature(char* signature, bool void_ok, unsigned int length, TRAPS);
bool is_anonymous() {
assert(AnonymousClasses || _host_klass.is_null(), "");
return _host_klass.not_null();
}
bool has_cp_patch_at(int index) {
assert(AnonymousClasses, "");
assert(index >= 0, "oob");
return (_cp_patches != NULL
&& index < _cp_patches->length()
&& _cp_patches->adr_at(index)->not_null());
}
Handle cp_patch_at(int index) {
assert(has_cp_patch_at(index), "oob");
return _cp_patches->at(index);
}
Handle clear_cp_patch_at(int index) {
Handle patch = cp_patch_at(index);
_cp_patches->at_put(index, Handle());
assert(!has_cp_patch_at(index), "");
return patch;
}
void patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS);
// 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.
bool is_klass_reference(constantPoolHandle cp, int index) {
return ((LinkWellKnownClasses || AnonymousClasses)
? cp->tag_at(index).is_klass_or_reference()
: cp->tag_at(index).is_klass_reference());
}
public:
// Constructor
ClassFileParser(ClassFileStream* st) { set_stream(st); }
// 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.
instanceKlassHandle parseClassFile(symbolHandle name,
Handle class_loader,
Handle protection_domain,
symbolHandle& parsed_name,
bool verify,
TRAPS) {
KlassHandle no_host_klass;
return parseClassFile(name, class_loader, protection_domain, no_host_klass, NULL, parsed_name, verify, THREAD);
}
instanceKlassHandle parseClassFile(symbolHandle name,
Handle class_loader,
Handle protection_domain,
KlassHandle host_klass,
GrowableArray<Handle>* cp_patches,
symbolHandle& parsed_name,
bool verify,
TRAPS);
// Verifier checks
static void check_super_class_access(instanceKlassHandle this_klass, TRAPS);
static void check_super_interface_access(instanceKlassHandle this_klass, TRAPS);
static void check_final_method_override(instanceKlassHandle this_klass, TRAPS);
static void check_illegal_static_method(instanceKlassHandle this_klass, TRAPS);
};
{
u4 magic; //识别Class文件格式,具体值为0xCAFEBABE,
u2 minor_version; // Class文件格式副版本号,
u2 major_version; // Class文件格式主版本号,
u2 constant_pool_count; // 常数表项个数,
cp_info **constant_pool;// 常数表,又称变长符号表,
u2 access_flags; //Class的声明中使用的修饰符掩码,
u2 this_class; //常数表索引,索引内保存类名或接口名,
u2 super_class; //常数表索引,索引内保存父类名,
u2 interfaces_count; //超接口个数,
u2 *interfaces; //常数表索引,各超接口名称,
u2 fields_count; //类的域个数,
field_info **fields; //域数据,包括属性名称索引,
//域修饰符掩码等,
u2 methods_count; //方法个数,
method_info **methods;//方法数据,包括方法名称索引,方法修饰符掩码等,
u2 attributes_count; //类附加属性个数,
attribute_info **attributes; //类附加属性数据,包括源文件名等。
};
class ClassFileParser VALUE_OBJ_CLASS_SPEC {
private:
bool _need_verify;
bool _relax_verify;
u2 _major_version;
u2 _minor_version;
symbolHandle _class_name;
KlassHandle _host_klass;
GrowableArray<Handle>* _cp_patches; // overrides for CP entries
bool _has_finalizer;
bool _has_empty_finalizer;
bool _has_vanilla_constructor;
enum { fixed_buffer_size = 128 };
u_char linenumbertable_buffer[fixed_buffer_size];
ClassFileStream* _stream; // Actual input stream
enum { LegalClass, LegalField, LegalMethod }; // used to verify unqualified names
// Accessors
ClassFileStream* stream() { return _stream; }
void set_stream(ClassFileStream* st) { _stream = st; }
// Constant pool parsing
void parse_constant_pool_entries(constantPoolHandle cp, int length, TRAPS);
constantPoolHandle parse_constant_pool(TRAPS);
// Interface parsing
objArrayHandle parse_interfaces(constantPoolHandle cp,
int length,
Handle class_loader,
Handle protection_domain,
symbolHandle class_name,
TRAPS);
// Field parsing
void parse_field_attributes(constantPoolHandle cp, u2 attributes_count,
bool is_static, u2 signature_index,
u2* constantvalue_index_addr,
bool* is_synthetic_addr,
u2* generic_signature_index_addr,
typeArrayHandle* field_annotations, TRAPS);
typeArrayHandle parse_fields(constantPoolHandle cp, bool is_interface,
struct FieldAllocationCount *fac,
objArrayHandle* fields_annotations, TRAPS);
// Method parsing
methodHandle parse_method(constantPoolHandle cp, bool is_interface,
AccessFlags* promoted_flags,
typeArrayHandle* method_annotations,
typeArrayHandle* method_parameter_annotations,
typeArrayHandle* method_default_annotations,
TRAPS);
objArrayHandle parse_methods (constantPoolHandle cp, bool is_interface,
AccessFlags* promoted_flags,
bool* has_final_method,
objArrayOop* methods_annotations_oop,
objArrayOop* methods_parameter_annotations_oop,
objArrayOop* methods_default_annotations_oop,
TRAPS);
typeArrayHandle sort_methods (objArrayHandle methods,
objArrayHandle methods_annotations,
objArrayHandle methods_parameter_annotations,
objArrayHandle methods_default_annotations,
TRAPS);
typeArrayHandle parse_exception_table(u4 code_length, u4 exception_table_length,
constantPoolHandle cp, TRAPS);
void parse_linenumber_table(
u4 code_attribute_length, u4 code_length,
CompressedLineNumberWriteStream** write_stream, TRAPS);
u2* parse_localvariable_table(u4 code_length, u2 max_locals, u4 code_attribute_length,
constantPoolHandle cp, u2* localvariable_table_length,
bool isLVTT, TRAPS);
u2* parse_checked_exceptions(u2* checked_exceptions_length, u4 method_attribute_length,
constantPoolHandle cp, TRAPS);
void parse_type_array(u2 array_length, u4 code_length, u4* u1_index, u4* u2_index,
u1* u1_array, u2* u2_array, constantPoolHandle cp, TRAPS);
typeArrayOop parse_stackmap_table(u4 code_attribute_length, TRAPS);
// Classfile attribute parsing
void parse_classfile_sourcefile_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
void parse_classfile_source_debug_extension_attribute(constantPoolHandle cp,
instanceKlassHandle k, int length, TRAPS);
u2 parse_classfile_inner_classes_attribute(constantPoolHandle cp,
instanceKlassHandle k, TRAPS);
void parse_classfile_attributes(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
void parse_classfile_synthetic_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
void parse_classfile_signature_attribute(constantPoolHandle cp, instanceKlassHandle k, TRAPS);
// Annotations handling
typeArrayHandle assemble_annotations(u1* runtime_visible_annotations,
int runtime_visible_annotations_length,
u1* runtime_invisible_annotations,
int runtime_invisible_annotations_length, TRAPS);
// Final setup
unsigned int compute_oop_map_count(instanceKlassHandle super,
unsigned int nonstatic_oop_count,
int first_nonstatic_oop_offset);
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);
objArrayHandle compute_transitive_interfaces(instanceKlassHandle super,
objArrayHandle local_ifs, TRAPS);
// Special handling for certain classes.
// Add the "discovered" field to java.lang.ref.Reference if
// it does not exist.
void java_lang_ref_Reference_fix_pre(typeArrayHandle* fields_ptr,
constantPoolHandle cp, FieldAllocationCount *fac_ptr, TRAPS);
// Adjust the field allocation counts for java.lang.Class to add
// fake fields.
void java_lang_Class_fix_pre(objArrayHandle* methods_ptr,
FieldAllocationCount *fac_ptr, TRAPS);
// Adjust the next_nonstatic_oop_offset to place the fake fields
// before any Java fields.
void java_lang_Class_fix_post(int* next_nonstatic_oop_offset);
// Adjust the field allocation counts for java.dyn.MethodHandle to add
// a fake address (void*) field.
void java_dyn_MethodHandle_fix_pre(constantPoolHandle cp,
typeArrayHandle* fields_ptr,
FieldAllocationCount *fac_ptr, TRAPS);
// Format checker methods
void classfile_parse_error(const char* msg, TRAPS);
void classfile_parse_error(const char* msg, int index, TRAPS);
void classfile_parse_error(const char* msg, const char *name, TRAPS);
void classfile_parse_error(const char* msg, int index, const char *name, TRAPS);
inline void guarantee_property(bool b, const char* msg, TRAPS) {
if (!b) { classfile_parse_error(msg, CHECK); }
}
inline void assert_property(bool b, const char* msg, TRAPS) {
#ifdef ASSERT
if (!b) { fatal(msg); }
#endif
}
inline void check_property(bool property, const char* msg, int index, TRAPS) {
if (_need_verify) {
guarantee_property(property, msg, index, CHECK);
} else {
assert_property(property, msg, CHECK);
}
}
inline void check_property(bool property, const char* msg, TRAPS) {
if (_need_verify) {
guarantee_property(property, msg, CHECK);
} else {
assert_property(property, msg, CHECK);
}
}
inline void guarantee_property(bool b, const char* msg, int index, TRAPS) {
if (!b) { classfile_parse_error(msg, index, CHECK); }
}
inline void guarantee_property(bool b, const char* msg, const char *name, TRAPS) {
if (!b) { classfile_parse_error(msg, name, CHECK); }
}
inline void guarantee_property(bool b, const char* msg, int index, const char *name, TRAPS) {
if (!b) { classfile_parse_error(msg, index, name, CHECK); }
}
bool is_supported_version(u2 major, u2 minor);
bool has_illegal_visibility(jint flags);
void verify_constantvalue(int constantvalue_index, int signature_index, constantPoolHandle cp, TRAPS);
void verify_legal_utf8(const unsigned char* buffer, int length, TRAPS);
void verify_legal_class_name(symbolHandle name, TRAPS);
void verify_legal_field_name(symbolHandle name, TRAPS);
void verify_legal_method_name(symbolHandle name, TRAPS);
void verify_legal_field_signature(symbolHandle fieldname, symbolHandle signature, TRAPS);
int verify_legal_method_signature(symbolHandle methodname, symbolHandle signature, TRAPS);
void verify_legal_class_modifiers(jint flags, TRAPS);
void verify_legal_field_modifiers(jint flags, bool is_interface, TRAPS);
void verify_legal_method_modifiers(jint flags, bool is_interface, symbolHandle name, TRAPS);
bool verify_unqualified_name(char* name, unsigned int length, int type);
char* skip_over_field_name(char* name, bool slash_ok, unsigned int length);
char* skip_over_field_signature(char* signature, bool void_ok, unsigned int length, TRAPS);
bool is_anonymous() {
assert(AnonymousClasses || _host_klass.is_null(), "");
return _host_klass.not_null();
}
bool has_cp_patch_at(int index) {
assert(AnonymousClasses, "");
assert(index >= 0, "oob");
return (_cp_patches != NULL
&& index < _cp_patches->length()
&& _cp_patches->adr_at(index)->not_null());
}
Handle cp_patch_at(int index) {
assert(has_cp_patch_at(index), "oob");
return _cp_patches->at(index);
}
Handle clear_cp_patch_at(int index) {
Handle patch = cp_patch_at(index);
_cp_patches->at_put(index, Handle());
assert(!has_cp_patch_at(index), "");
return patch;
}
void patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS);
// 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.
bool is_klass_reference(constantPoolHandle cp, int index) {
return ((LinkWellKnownClasses || AnonymousClasses)
? cp->tag_at(index).is_klass_or_reference()
: cp->tag_at(index).is_klass_reference());
}
public:
// Constructor
ClassFileParser(ClassFileStream* st) { set_stream(st); }
// 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.
instanceKlassHandle parseClassFile(symbolHandle name,
Handle class_loader,
Handle protection_domain,
symbolHandle& parsed_name,
bool verify,
TRAPS) {
KlassHandle no_host_klass;
return parseClassFile(name, class_loader, protection_domain, no_host_klass, NULL, parsed_name, verify, THREAD);
}
instanceKlassHandle parseClassFile(symbolHandle name,
Handle class_loader,
Handle protection_domain,
KlassHandle host_klass,
GrowableArray<Handle>* cp_patches,
symbolHandle& parsed_name,
bool verify,
TRAPS);
// Verifier checks
static void check_super_class_access(instanceKlassHandle this_klass, TRAPS);
static void check_super_interface_access(instanceKlassHandle this_klass, TRAPS);
static void check_final_method_override(instanceKlassHandle this_klass, TRAPS);
static void check_illegal_static_method(instanceKlassHandle this_klass, TRAPS);
};
发表评论
-
Java类的初始化过程详解
2010-04-11 17:09 1218java是多线程的,所以类 ... -
jvm 字节码中文含义
2010-04-08 11:31 3610栈和局部变量操作 将常 ... -
诡异的JVM Crash之EXCEPTION_STACK_OVERFLOW
2010-04-08 11:08 1730关于JVM的一个常识是:如果对象被意外地持有很容易造成内存泄漏 ... -
jvm 初始化
2010-04-07 16:01 1165void vm_init_globals() { chec ... -
jvm gc
2010-04-06 23:52 1007jvm gc -
jvm exception
2010-04-06 23:52 845jvm exception -
jvm method invoke
2010-04-06 23:51 1067jvm method invoke -
jvm interpreter
2010-04-06 23:51 1239jvm interpreter 解释器的初始化 JNI_Cr ... -
jvm运行时数据结构
2010-04-06 23:50 900jvm运行时数据结构 -
jvm class与instance运行时结构
2010-04-06 23:49 861jvm class与instance运行时结构 -
jvm dll加载分析
2010-04-06 23:48 1160jvm dll加载分析 -
汇编语言与计算机体系结构--使用C++和Java
2010-04-06 15:16 1667第1章数制1 1.1简介1 1.2按位记数制1 1.3各数制的 ... -
JVM内存管理及垃圾回收机制
2010-04-06 09:30 846JAVA在内存中由 Perm 和 He ... -
IBM Java Jvm GC实现内幕 (几年前的老文)
2010-04-05 14:39 824好言归正传,按照Sam Borman的说法IBM java 1 ... -
修复 Java 内存模型,第 1 部分(什么是 Java 内存模型,最初它是怎样被破坏的?)
2010-03-30 14:16 1038Java 平台把线程和多处理技术集成到了语言中,这种集成程度比 ... -
JVM内存结构
2010-03-29 15:25 795(1)类装载子系统 装载 连 ... -
Java轻量级锁原理详解(Lightweight Locking)
2010-03-29 15:21 782Java轻量级锁原理详解(Lightweight Lockin ... -
解析 Java 类和对象的初始化过程
2010-03-29 15:15 1056类的初始化和对象初始 ... -
解析 Java 类和对象的初始化过程
2010-03-29 15:14 734类的初始化和对象初始化是 JVM 管理的类型生命周期中非常重要 ... -
Java偏向锁实现原理(Biased Locking)
2010-03-29 15:00 879Java偏向锁实现原理(Bias ...
相关推荐
Java class文件格式是Java虚拟机(JVM)执行的基础,它包含了构成Java程序的基本元素。在本文中,我们将深入探讨class文件中的数据类型,特别是CONSTANT_Class_info和CONSTANT_Fieldref_info这两个重要的数据项。 ...
Java Class文件是Java程序编译后的二进制表示形式,它是Java虚拟机(JVM)运行的基础。本文将详细解析Class文件中的方法部分,帮助读者理解其结构和功能。 首先,Class文件由多个结构化的数据单元组成,其中包括`...
在深入讲解Class文件格式之前,我们需要理解Java字节码的概念,它是一种平台无关的中间语言,使得Java程序可以在任何支持JVM的设备上运行。 1. **总体格式** Class文件的结构遵循一个固定的模板,由多个字段组成...
Class文件的格式是严格定义的,确保了JVM能够正确解析和执行其中的代码。在JVM规范第四章中,详细描述了Class文件的结构,主要包括以下几个关键部分: 1. **魔数(Magic Number)**:每个Class文件的开头都有一个4...
Java Class文件是Java虚拟机(JVM)执行的二进制格式,它是程序的核心组成部分,包含了编译后的字节码指令。这篇学习笔记主要探讨了Class文件的结构、...理解Class文件格式对于深入理解Java虚拟机的工作原理至关重要。
在探讨Java class文件格式时,数据类型的处理是其中非常核心和基础的部分。Java class文件格式由Oracle官方定义,是Java虚拟机(JVM)执行Java程序时所依赖的文件格式。数据类型在class文件格式中扮演着非常重要的...
Java Class文件格式是Java虚拟机(JVM)能够识别和执行的基础。它是Java源代码经过编译后的二进制表示,包含了程序的结构、方法、字段等信息,使得JVM可以解析并执行其中的指令。深入理解Class文件格式对于开发者来...
总之,Java Class文件是Java程序执行的关键,通过编译过程将源代码转化为JVM能理解的二进制格式。了解其结构和编译原理对于优化代码和调试问题都十分有益。使用像jclasslib这样的工具,我们可以直观地查看和分析...
Java class文件格式是Java虚拟机(JVM)能够识别和执行的基本单元,它是Java源代码编译后的结果。深入理解class文件格式对于开发者而言至关重要,因为它不仅有助于理解JVM的工作原理,还能帮助我们深入理解Java语言...
Java Class文件遵循特定的文件格式,这个格式由一系列的8位字节构成,包括魔数(Magic Number)、版本信息、常量池、访问标志、类和父类索引、接口索引集合、字段表集合、方法表集合、属性表集合等。这些结构共同...
Java Class文件是Java程序编译后的二进制格式,它包含了类和接口的定义、方法体、常量池等信息,但这些信息是以机器可读的字节码形式存在,对于人类来说不易理解。为了查看和理解Class文件内部的源代码,我们就需要...
Java class文件格式之常量池 Java class文件格式之常量池是Java虚拟机(JVM)加载和执行Java类文件的核心组件之一。常量池是class文件的一部分,存储着Java类文件中的各种常量信息,如字符串常量、类名、方法名、...
1、打开一个或者多个*.class文件,XJad反编译后,重命名为*.java文件, 保存至当前文件夹,并在编辑器中打开查看; 2、打开一个文件夹,XJad将该文件夹下所有*.class文件进行反编译,并保存至该文件夹下, 依据包...
轻松方便的把class文件转化为java文件
Java class文件格式是Java虚拟机(JVM)运行的基础,其中访问标志信息(access_flags)是定义类或接口访问权限及特性的关键部分。访问标志信息位于class文件的结构中,紧随常量池之后,占据2个字节的空间。 访问...
Java Class文件查看器是一款专为Java开发者设计的实用工具,它允许用户查看和分析.class文件,这是Java编译器将源代码编译后的二进制形式。了解如何使用这类工具对于理解和调试Java应用程序至关重要,尤其是在处理已...
《深入剖析Java Class文件格式》 Java程序在编译后会生成后缀为`.class`的文件,这些文件包含了运行时所需的所有信息。本实验旨在通过详细分析一个名为`Test.class`的文件,揭示其内部结构,从而理解Java类文件的...
Java class文件格式是Java虚拟机(JVM)执行的基础,其中属性(Attributes)部分是class文件结构中的一个重要组成部分,用于存储方法、字段等元数据的附加信息。在本篇文章中,我们将深入探讨Java class文件格式的...
java class文件反编译器,可以看轻松查看源代码!下吧
然而,Java的.class文件通常是不可编辑的,因为它们是编译后的机器可读格式,直接修改可能会导致无法正常运行。但如果你确实需要修改.class文件,可能需要使用像JAD (Java反汇编器和汇编器) 或FernFlower这样的工具...