Site Tools

Sidebar

Smart Card Solution

User Manual

JavaCard API Samples

Java Card Specification

Knowledge Sharing

javacard:jcvm:2.3.2.3_static_restrictions_on_bytecodes

2.3.2.3 Static Restrictions on Bytecodes

A class file must conform to the following restrictions on the static form of bytecodes.

ldc_ldc_w

The ldc and ldc_w bytecodes can only be used to load integer constants. The constant pool entry at index must be a CONSTANT_Integer entry. If a program contains an ldc or ldc_w instruction that is used to load an integer value less than -32768 or greater than 32767, that program will require the optional int instructions ( Section 2.2.3.1, Integer Data Type).

lookupswitch

The value of the npairs operand must be less than 65536. This limit is far greater than the limit imposed by the maximum size of methods ( Section 2.2.4.4, Methods). If a program contains a lookupswitch instruction that uses keys of type int, that program will require the optional int instructions ( Section 2.2.3.1, Integer Data Type). Otherwise, key values must be in the range -32768 to 32767.

tableswitch

The bytecode can contain at most 65536 cases. This limit is far greater than the limit imposed by the maximum size of methods ( Section 2.2.4.4, Methods). If a program does not use the optional int instructions ( Section 2.2.3.1, Integer Data Type), the values of the high and low operands must both be at least -32768 and at most 32767.

wide

The wide bytecode can only be used with an iinc instruction.

javacard/jcvm/2.3.2.3_static_restrictions_on_bytecodes.txt · Last modified: 2017/05/13 04:10 (external edit)