With new bytecode format introduced in Webkit 608.1, the unlinked and linked 
bytecodes were replaced by narrow (1-byte operand) and wide (4-byte operand) 
bytecodes. These were extended to narrow, wide16 and wide32 bytecodes in WebKit 
609.1. In narrow instructions, each argument of the opcode has a fixed size of 
1-byte. The same applies for wide 16 and wide32 with 2-byte and 4-byte, 
respectively.

In the Low Level Intepreter (LLInt), each opcode has a corresponding ID 
assigned for narrow, wide16 and wide32 implementation, and the variable 
`numOpcodeIDs` is used to denote the total number of opcodes. The narrow opcode 
IDs are mapped from 0 to (`numOpcodeIDs` - 1). The next `numOpcodeIDs` opcode 
IDs are mapped to wide16 opcodes, and similarly, the next `numOpcodeIDs` to 
wide32 opcodes. The same can be found in 
[LowLevelInterpreter.cpp](https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp#L265)
 and also in the autogenerated file `Bytecodes.h`. 

Bug: When `getOpcodeWide(id)` is called in `LLIntData.h`, the value (`id` - 
`numOpcodesIDs`) is returned.

Fix: It's modified to (`id` + `numOpcodesIDs`) in `getOpcodeWide16()` and (`id` 
+ `numOpcodesIDs`*2) in `getOpcodeWide32()`.

-------------

Commits:
 - eed20431: 8239454: LLIntData : invalid opcode returned for 16 and 32 bit 
wide instructions

Changes: https://git.openjdk.java.net/jfx/pull/115/files
 Webrev: https://webrevs.openjdk.java.net/jfx/115/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8239454
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jfx/pull/115.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/115/head:pull/115

PR: https://git.openjdk.java.net/jfx/pull/115

Reply via email to