From ae9c23f5ec9dad75de3008fbc452f6411a7599fb Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 13 Aug 1999 09:08:09 +0000 Subject: [PATCH] use implementation specific opcode as border opcode instead of xxxunknownxxx git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1146 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/bytecode/BytecodeInfo.java.in | 4 +++- jode/jode/bytecode/Instruction.java | 6 +++--- jode/jode/bytecode/Opcodes.java | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/jode/jode/bytecode/BytecodeInfo.java.in b/jode/jode/bytecode/BytecodeInfo.java.in index 5c9fbf3..1148da1 100644 --- a/jode/jode/bytecode/BytecodeInfo.java.in +++ b/jode/jode/bytecode/BytecodeInfo.java.in @@ -64,7 +64,9 @@ public class BytecodeInfo extends BinaryInfo implements Opcodes { int instructionCount = 0; InstructionList() { - borderInstr = new Instruction(opc_xxxunusedxxx); + // opc_impdep1 is used as border instruction, it may not + // occur in bytecode. + borderInstr = new Instruction(opc_impdep1); borderInstr.nextByAddr = borderInstr.prevByAddr = borderInstr; } diff --git a/jode/jode/bytecode/Instruction.java b/jode/jode/bytecode/Instruction.java index 1508962..48fc1e1 100644 --- a/jode/jode/bytecode/Instruction.java +++ b/jode/jode/bytecode/Instruction.java @@ -333,13 +333,13 @@ public final class Instruction implements Opcodes{ } public final Instruction getPrevByAddr() { - if (prevByAddr.opcode == opc_xxxunusedxxx) + if (prevByAddr.opcode == opc_impdep1) return null; return prevByAddr; } public final Instruction getNextByAddr() { - if (nextByAddr.opcode == opc_xxxunusedxxx) + if (nextByAddr.opcode == opc_impdep1) return null; return nextByAddr; } @@ -608,7 +608,7 @@ public final class Instruction implements Opcodes{ if (lnt != null) { for (int i=0; i< lnt.length; i++) { if (lnt[i].start == this) { - if (nextByAddr.opcode == opc_xxxunusedxxx + if (nextByAddr.opcode == opc_impdep1 || (i+1 < lnt.length && lnt[i+1].start == nextByAddr)) { /* Remove the line number. diff --git a/jode/jode/bytecode/Opcodes.java b/jode/jode/bytecode/Opcodes.java index e6edc8b..0234647 100644 --- a/jode/jode/bytecode/Opcodes.java +++ b/jode/jode/bytecode/Opcodes.java @@ -226,6 +226,8 @@ public interface Opcodes { public final static int opc_goto_w = 200; public final static int opc_jsr_w = 201; public final static int opc_breakpoint = 202; + public final static int opc_impdep1 = 254; + public final static int opc_impdep2 = 255; public final static String[] opcodeString = { "nop", "aconst_null", "iconst_m1", "iconst_0", "iconst_1",