翻译:JVM虚拟机规范1.7中的运行时常量池部分(二)
本篇为JVM虚拟机规范1.7中的运行时常量池部分系列的第二篇。
4.4.4. The CONSTANT_Integer_info
and CONSTANT_Float_info
Structures
The CONSTANT_Integer_info
and CONSTANT_Float_info
structures represent 4-byte numeric (int
and float
) constants:
代表4字节的数字常量,如int和float:
The items of these structures are as follows:
- tag
-
The
tag
item of theCONSTANT_Integer_info
structure has the valueCONSTANT_Integer
(3).The
tag
item of theCONSTANT_Float_info
structure has the valueCONSTANT_Float
(4).类型分别必须为
CONSTANT_Integer和
CONSTANT_Float
- bytes
-
The
bytes
item of theCONSTANT_Integer_info
structure represents the value of theint
constant. The bytes of the value are stored in big-endian (high byte first) order.The
bytes
item of theCONSTANT_Float_info
structure represents the value of thefloat
constant in IEEE 754 floating-point single format (§2.3.2). The bytes of the single format representation are stored in big-endian (high byte first) order.The value represented by the
CONSTANT_Float_info
structure is determined as follows. The bytes of the value are first converted into anint
constant bits. Then:If bits is
0x7f800000
, thefloat
value will be positive infinity.If bits is
0xff800000
, thefloat
value will be negative infinity.If bits is in the range
0x7f800001
through0x7fffffff
or in the range0xff800001
through0xffffffff
, thefloat
value will be NaN.
In all other cases, let s
, e
, and m
be three values that might be computed from bits:
bytes在CONSTANT_Integer_info
中代表int常量的值。大端序(高字节在前)存储
bytes在CONSTANT_Float_info
中代表以IEEE 754 浮点数格式存储的float常量。大端序存储。
CONSTANT_Float_info结构体的内容按照如下规则。bytes的值首先被转换为int常量比特,然后:
如果bits是0x7f800000,那么浮点值为正无穷。
如果bits是0xff800000,那么浮点值为负无穷。
如果bits是在0x7f800001
到0x7fffffff或者
0xff800001到
0xffffffff,值为NaN。
其他情况,参考上图算出s,e,m,则值为 s · m · 2e-150
.
4.4.5. The CONSTANT_Long_info
and CONSTANT_Double_info
Structures
-
看看它的存储结构体:
其余和int和float差不多,只是变成了两个4字节来存储。
4.4.6. The CONSTANT_NameAndType_info
Structure
The CONSTANT_NameAndType_info
structure is used to represent a field or method, without indicating which class or interface type it belongs to:
代表一个字段或者方法,没标识属于哪个类或者接口:
The items of the CONSTANT_NameAndType_info
structure are as follows:
条目如下:
- tag
-
The
tag
item of theCONSTANT_NameAndType_info
structure has the valueCONSTANT_NameAndType
(12).tag值为
CONSTANT_NameAndType
- name_index
-
The value of the
name_index
item must be a valid index into theconstant_pool
table. Theconstant_pool
entry at that index must be aCONSTANT_Utf8_info
structure (§4.4.7) representing either the special method name<init>
(§2.9) or a valid unqualified name denoting a field or method (§4.2.2).name_index项必须为有效索引项。必须指向
CONSTANT_Utf8_info
结构体,代表特殊方法名,如<init>或者一个有效的相对名标识字段或方法。 - descriptor_index
-
The value of the
descriptor_index
item must be a valid index into theconstant_pool
table. Theconstant_pool
entry at that index must be aCONSTANT_Utf8_info
structure (§4.4.7) representing a valid field descriptor or method descriptor (§4.3.2, §4.3.3).
值必须为有效索引。必须指向CONSTANT_Utf8_info
,代表有效的字段描述符或者方法描述符。(应该是一个域前面的那些:private,static,final之类的修饰符吧)
最新文章
- string.Join()的用法
- XproerUI控件工厂代码优化-使用C++11特性优化
- excel上传和下载
- 转:android 录制视频的Demo
- html5响应式布局
- win7系统64位安装oracle10g
- 分享基于分布式Http长连接框架--设计模型
- MySQL数据库Inception工具学习与测试 笔记
- Linux 下的 python 虚拟环境 + vim快捷方式
- PowerApp Document
- Stripes视图框架实现纯Java代码控制表现层参考文档
- ionic 兼容title居中显示和tab栏在显示底部
- (3)HomeAssistant 连接MQTT
- Python3学习笔记12-定义函数及调用
- 【Scala学习之二】 Scala 集合 Trait Actor
- (转)Android学习-使用Async-Http实现图片压缩并上传功能
- mac 上运行cassandra出现的java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: : : unknown error错误解决方法
- python_不用循环打印1-1000
- Codeforces Round #247 (Div. 2) D. Random Task
- 三点估算和PERT技术