JVM Specification 第一天(JVM数据类型&运行时数据区)

1.The Structure of the Java Virtual Machine

1.1  Data Type

JVM Specification 第一天(JVM数据类型&运行时数据区)_第1张图片




1 The booleanType

Although  the  Java  virtual  machine  defines  a  boolean type,  it  only  provides
very limited support for it. There are no Java virtual machine instructions solely
dedicated  to  operations  on  boolean values.  Instead,  expressions  in  the  Java
programming language that operate on booleanvalues are compiled to use values
of the Java virtual machine intdata type.
The  Java  virtual  machine  does  directly  support  boolean arrays.  Its  newarray
instruction  (§newarray)  enables  creation  of  boolean arrays.  Arrays  of  type
booleanare accessed and modified using the bytearray instructions baloadand
bastore(§baload, §bastore).
In Oracle’s Java virtual machine implementation,  booleanarrays in the Java programming
language  are  encoded  as  Java  virtual  machine  byte arrays,  using  8  bits  per  boolean
element.
The Java virtual machine encodes booleanarray components using 1to represent
trueand  0to represent  false. Where Java programming language  booleanvalues
are mapped by compilers to values of Java virtual machine type int, the compilers
must use the same encoding.

1.2 Runtime Data Area

JVM Specification 第一天(JVM数据类型&运行时数据区)_第2张图片




1  PC register 程序计数器

Each Java virtual machine thread has its own pc(program counter) register

The Java virtual machine can support many threads of execution at once (JLS §17).
Each Java virtual machine thread has its own pc(program counter) register. At any
point, each Java virtual machine thread is executing the code of a single method,
namely the current method (§2.6) for that thread. If that method is not native, the
pcregister contains the address of the Java virtual machine instruction currently
being executed. If the method currently being executed by the thread is  native,
the value of the Java virtual machine's  pcregister is undefined. The Java virtual
machine's pcregister is wide enough to hold a returnAddressor a native pointer
on the specific platform.

2  JVM  Stack

*Each Java virtual machine thread has a private Java virtual machine stack

* A Java virtual machine stack stores frames 

*it holds local variables and partial results, and plays a part in method
invocation and return

http://www.open-open.com/lib/view/open1383745340321.html


你可能感兴趣的:(JVM Specification 第一天(JVM数据类型&运行时数据区))