Content deleted Content added
Plastikspork (talk | contribs) Undid revision 1266177809 by Shubhip (talk) |
m →Instruction set architecture: Add missing word ("passing"). |
||
Line 18:
The bytecode comprises various instruction types, including data manipulation, control transfer, object creation and manipulation, and method invocation, all integral to Java's object-oriented programming model.<ref name="oracle jvm spec"/>
The JVM is both a [[stack machine]] and a [[register machine]]. Each [[Call stack#STACK-FRAME|frame]] for a method call has an "operand stack" and an array of "local variables".<ref name="jvm">{{cite book |last1=Lindholm |first1=Tim |last2=Yellin |first2=Frank |last3=Bracha |first3=Gilad |last4=Buckley |first4=Alex |title=The Java Virtual Machine Specification |edition=Java SE 8 |date=2015-02-13 |url=http://docs.oracle.com/javase/specs/jvms/se8/html/}}</ref>{{rp|2.6}} <ref name="JVM Book"/> The operand stack is used for passing operands to computations and for receiving the return value of a called method, while local variables serve the same purpose as [[Processor register|registers]] and are also used to pass method arguments. The maximum size of the operand stack and local variable array, computed by the compiler, is part of the attributes of each method.<ref name="jvm"/>{{rp|4.7.3}} Each can be independently sized from 0 to 65535 values, where each value is 32 bits. {{code|lang="java"|long}} and {{code|lang="java"|double}} types, which are 64 bits, take up two consecutive local variables<ref name="jvm"/>{{rp|2.6.1}} (which need not be 64-bit aligned in the local variables array) or one value in the operand stack (but are counted as two units in the depth of the stack).<ref name="jvm"/>{{rp|2.6.2}}
=== Instruction set ===
|