Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
3d3c471
Initial refactor commit
m3m0r7 Feb 22, 2019
dfe4d38
Add types
m3m0r7 Feb 22, 2019
f1504d4
Add mnemonic lists
m3m0r7 Feb 22, 2019
de94b2c
Copied mnemonics
m3m0r7 Feb 23, 2019
decd6ef
Update
m3m0r7 Feb 23, 2019
47c3f29
Add extra line
m3m0r7 Feb 23, 2019
67a1a28
Update attributes
m3m0r7 Feb 23, 2019
110c545
Add extra line
m3m0r7 Feb 23, 2019
ff8c669
Add BinaryReader and BinaryTool
m3m0r7 Feb 23, 2019
fe0479d
Add Java structure readers
m3m0r7 Feb 23, 2019
cead14f
Fix PSR-2
m3m0r7 Feb 23, 2019
2ddb9dc
Rename Maps
m3m0r7 Feb 23, 2019
680e12a
WIP commit
m3m0r7 Feb 23, 2019
d9f2147
WIP commit
m3m0r7 Feb 23, 2019
a06fb50
WIP commit
m3m0r7 Feb 23, 2019
465ca81
WIP commit
m3m0r7 Feb 23, 2019
ef24b63
WIP commit
m3m0r7 Feb 23, 2019
6fe3e97
WIP
m3m0r7 Feb 23, 2019
001e32f
WIP commit
m3m0r7 Feb 23, 2019
3fd63a7
Change array
m3m0r7 Feb 23, 2019
f6c21a0
Replace array syntax
m3m0r7 Feb 23, 2019
c56c147
WIP commit
m3m0r7 Feb 23, 2019
153e81d
WIP commit
m3m0r7 Feb 23, 2019
69a68c0
WIP commit
m3m0r7 Feb 23, 2019
83deb7e
WIP commit
m3m0r7 Feb 23, 2019
7433899
WIP commit
m3m0r7 Feb 23, 2019
05cb6b6
WIP commit
m3m0r7 Feb 23, 2019
72743f8
WIP commit
m3m0r7 Feb 23, 2019
e7f9ff5
WIP commit
m3m0r7 Feb 23, 2019
1660b96
WIP commit
m3m0r7 Feb 23, 2019
f222e99
WIP commit
m3m0r7 Feb 23, 2019
42fe161
WIP commit
m3m0r7 Feb 24, 2019
0047521
Add type into anonymous function
m3m0r7 Feb 24, 2019
1e6064e
Fix missing parameter
m3m0r7 Feb 24, 2019
7a22d9c
WIP commit
m3m0r7 Feb 24, 2019
f416bd5
Fix missing param
m3m0r7 Feb 24, 2019
224b128
Remove commentout
m3m0r7 Feb 24, 2019
a4f1ca3
Fix missing namespace
m3m0r7 Feb 24, 2019
32d51c2
Update
m3m0r7 Feb 24, 2019
024c444
Update debug information
m3m0r7 Feb 24, 2019
e4a12f3
Change namespace Bridge to Imitation
m3m0r7 Feb 24, 2019
066f212
WIP commit
m3m0r7 Feb 24, 2019
cc45500
Add imitations
m3m0r7 Feb 24, 2019
da8a02e
WIP commit
m3m0r7 Feb 24, 2019
496722c
WIP commit
m3m0r7 Feb 24, 2019
5f67242
WIP commit
m3m0r7 Feb 24, 2019
c2a22d5
WIP commit
m3m0r7 Feb 24, 2019
518ce90
WIP commit
m3m0r7 Feb 24, 2019
f8c6719
WIP commit
m3m0r7 Feb 24, 2019
5d404e1
WIP
m3m0r7 Feb 24, 2019
471bb06
WIP commit
m3m0r7 Feb 25, 2019
9548287
Implement dynamically field
m3m0r7 Feb 25, 2019
40d4cf6
Update lookupswitch
m3m0r7 Feb 25, 2019
ec8fe61
Add tests
m3m0r7 Feb 25, 2019
5b1fc8c
align
m3m0r7 Feb 25, 2019
9695fd1
WIP commit
m3m0r7 Feb 25, 2019
c9874e8
Update tests
m3m0r7 Feb 26, 2019
e66d3d6
Remove unnecessary file
m3m0r7 Feb 26, 2019
57a2979
Add test
m3m0r7 Feb 26, 2019
a04602f
Add tests
m3m0r7 Feb 26, 2019
e0a8277
Replace name getPointer to getProgramCounter
m3m0r7 Feb 26, 2019
1ac8d22
Test simplify
m3m0r7 Feb 26, 2019
335304b
Add switch tests
m3m0r7 Feb 26, 2019
23500f8
Supported invokespecial
m3m0r7 Feb 26, 2019
ccb1326
WIP commit
m3m0r7 Feb 26, 2019
7fcc288
Support construction
m3m0r7 Feb 26, 2019
c536240
Add construction tests
m3m0r7 Feb 26, 2019
a088370
Remove used tools
m3m0r7 Feb 26, 2019
fe860de
Test readme
m3m0r7 Feb 26, 2019
8b33a07
Fix logo
m3m0r7 Feb 26, 2019
dd36f66
Change logo size
m3m0r7 Feb 26, 2019
1a5f038
Update
m3m0r7 Feb 26, 2019
16c285d
Change height
m3m0r7 Feb 26, 2019
d7a0d5e
Update readme and add dependency to composer.json
m3m0r7 Feb 26, 2019
562c2c1
Update readme
m3m0r7 Feb 26, 2019
c056594
Update readme
m3m0r7 Feb 26, 2019
0320031
Add breakline
m3m0r7 Feb 26, 2019
0c2d85c
text alignment in readme
m3m0r7 Feb 26, 2019
6e685fc
WIP commit
m3m0r7 Feb 26, 2019
e9e780e
Fix grammar
m3m0r7 Feb 26, 2019
0aa1a66
Update readme
m3m0r7 Feb 26, 2019
5a294b5
Update readme
m3m0r7 Feb 26, 2019
dfcc149
Update readme
m3m0r7 Feb 27, 2019
01ce8b1
Fix grammar
m3m0r7 Feb 27, 2019
b1e2979
Update readme
m3m0r7 Feb 27, 2019
2366d43
Fix grammar
m3m0r7 Feb 27, 2019
e56d151
Update readme
m3m0r7 Feb 27, 2019
0be66c1
Remove japanese which is before translation
m3m0r7 Feb 27, 2019
8385a6b
Add
m3m0r7 Feb 27, 2019
e8b629a
Missing escape
m3m0r7 Feb 27, 2019
34cf92f
WIP commit
m3m0r7 Feb 27, 2019
a90a5cc
Add PHPCS and Fix for rules
m3m0r7 Feb 27, 2019
859b16e
Update readme
m3m0r7 Feb 27, 2019
9a92e24
Change chain method
m3m0r7 Feb 27, 2019
5731b68
Add tests
m3m0r7 Feb 27, 2019
f0833fe
Add version to composer.json
m3m0r7 Feb 27, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add mnemonic lists
  • Loading branch information
m3m0r7 committed Feb 22, 2019
commit f1504d4ff2d656b595cd06a10d261a828fc14737
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"name": "memory"
}
],
"require": {},
"require": {
"php": ">=7.2"
},
"autoload": {
"psr-4": {
"PHPJava\\": "src/"
Expand Down
29 changes: 29 additions & 0 deletions src/kernel/maps/Map.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
namespace PHPJava\Kernel\Maps;

class Map
{
public function getName(string $value): ?string
{
try {
$reflectionClass = new \ReflectionClass($this);
$constants = $reflectionClass->getConstants();
if (($key = array_search($value, $constants, true)) !== false) {
return $key;
}
} catch (\ReflectionException $e) {
}
return null;
}

public function getValues(): array
{

try {
$reflectionClass = new \ReflectionClass($this);
return array_values($reflectionClass->getConstants());
} catch (\ReflectionException $e) {
}
return [];
}
}
212 changes: 212 additions & 0 deletions src/kernel/maps/Mnemonics.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
<?php

namespace PHPJava\Kernel\Maps;

class Mnemonics extends Map
{
const nop = 0x00;
const aconst_null = 0x01;
const iconst_m1 = 0x02;
const iconst_0 = 0x03;
const iconst_1 = 0x04;
const iconst_2 = 0x05;
const iconst_3 = 0x06;
const iconst_4 = 0x07;
const iconst_5 = 0x08;
const lconst_0 = 0x09;
const lconst_1 = 0x0A;
const fconst_0 = 0x0B;
const fconst_1 = 0x0C;
const fconst_2 = 0x0D;
const dconst_0 = 0x0E;
const dconst_1 = 0x0F;
const bipush = 0x10;
const sipush = 0x11;
const ldc = 0x12;
const ldc_w = 0x13;
const ldc2_w = 0x14;
const iload = 0x15;
const lload = 0x16;
const fload = 0x17;
const dload = 0x18;
const aload = 0x19;
const iload_0 = 0x1A;
const iload_1 = 0x1B;
const iload_2 = 0x1C;
const iload_3 = 0x1D;
const lload_0 = 0x1E;
const lload_1 = 0x1F;
const lload_2 = 0x20;
const lload_3 = 0x21;
const fload_0 = 0x22;
const fload_1 = 0x23;
const fload_2 = 0x24;
const fload_3 = 0x25;
const dload_0 = 0x26;
const dload_1 = 0x27;
const dload_2 = 0x28;
const dload_3 = 0x29;
const aload_0 = 0x2A;
const aload_1 = 0x2B;
const aload_2 = 0x2C;
const aload_3 = 0x2D;
const iaload = 0x2E;
const laload = 0x2F;
const faload = 0x30;
const daload = 0x31;
const aaload = 0x32;
const baload = 0x33;
const caload = 0x34;
const saload = 0x35;
const istore = 0x36;
const lstore = 0x37;
const fstore = 0x38;
const dstore = 0x39;
const astore = 0x3A;
const istore_0 = 0x3B;
const istore_1 = 0x3C;
const istore_2 = 0x3D;
const istore_3 = 0x3E;
const lstore_0 = 0x3F;
const lstore_1 = 0x40;
const lstore_2 = 0x41;
const lstore_3 = 0x42;
const fstore_0 = 0x43;
const fstore_1 = 0x44;
const fstore_2 = 0x45;
const fstore_3 = 0x46;
const dstore_0 = 0x47;
const dstore_1 = 0x48;
const dstore_2 = 0x49;
const dstore_3 = 0x4A;
const astore_0 = 0x4B;
const astore_1 = 0x4C;
const astore_2 = 0x4D;
const astore_3 = 0x4E;
const iastore = 0x4F;
const lastore = 0x50;
const fastore = 0x51;
const dastore = 0x52;
const aastore = 0x53;
const bastore = 0x54;
const castore = 0x55;
const sastore = 0x56;
const pop = 0x57;
const pop2 = 0x58;
const dup = 0x59;
const dup_x1 = 0x5A;
const dup_x2 = 0x5B;
const dup2 = 0x5C;
const dup2_x1 = 0x5D;
const dup2_x2 = 0x5E;
const swap = 0x5F;
const iadd = 0x60;
const ladd = 0x61;
const fadd = 0x62;
const dadd = 0x63;
const isub = 0x64;
const lsub = 0x65;
const fsub = 0x66;
const dsub = 0x67;
const imul = 0x68;
const lmul = 0x69;
const fmul = 0x6A;
const dmul = 0x6B;
const idiv = 0x6C;
const ldiv = 0x6D;
const fdiv = 0x6E;
const ddiv = 0x6F;
const irem = 0x70;
const lrem = 0x71;
const frem = 0x72;
const drem = 0x73;
const ineg = 0x74;
const lneg = 0x75;
const fneg = 0x76;
const dneg = 0x77;
const ishl = 0x78;
const lshl = 0x79;
const ishr = 0x7A;
const lshr = 0x7B;
const iushr = 0x7C;
const lushr = 0x7D;
const iand = 0x7E;
const land = 0x7F;
const ior = 0x80;
const lor = 0x81;
const ixor = 0x82;
const lxor = 0x83;
const iinc = 0x84;
const i2l = 0x85;
const i2f = 0x86;
const i2d = 0x87;
const l2i = 0x88;
const l2f = 0x89;
const l2d = 0x8A;
const f2i = 0x8B;
const f2l = 0x8C;
const f2d = 0x8D;
const d2i = 0x8E;
const d2l = 0x8F;
const d2f = 0x90;
const i2b = 0x91;
const i2c = 0x92;
const i2s = 0x93;
const lcmp = 0x94;
const fcmpl = 0x95;
const fcmpg = 0x96;
const dcmpl = 0x97;
const dcmpg = 0x98;
const ifeq = 0x99;
const ifne = 0x9A;
const iflt = 0x9B;
const ifge = 0x9C;
const ifgt = 0x9D;
const ifle = 0x9E;
const if_icmpeq = 0x9F;
const if_icmpne = 0xA0;
const if_icmplt = 0xA1;
const if_icmpge = 0xA2;
const if_icmpgt = 0xA3;
const if_icmple = 0xA4;
const if_acmpeq = 0xA5;
const if_acmpne = 0xA6;
const goto = 0xA7;
const jsr = 0xA8;
const ret = 0xA9;
const tableswitch = 0xAA;
const lookupswitch = 0xAB;
const ireturn = 0xAC;
const lreturn = 0xAD;
const freturn = 0xAE;
const dreturn = 0xAF;
const areturn = 0xB0;
const return = 0xB1;
const getstatic = 0xB2;
const putstatic = 0xB3;
const getfield = 0xB4;
const putfield = 0xB5;
const invokevirtual = 0xB6;
const invokespecial = 0xB7;
const invokestatic = 0xB8;
const invokeinterface = 0xB9;
const invokedynamic = 0xBA;
const new = 0xBB;
const newarray = 0xBC;
const anewarray = 0xBD;
const arraylength = 0xBE;
const athrow = 0xBF;
const checkcast = 0xC0;
const instanceof = 0xC1;
const monitorenter = 0xC2;
const monitorexit = 0xC3;
const wide = 0xC4;
const multianewarray = 0xC5;
const ifnull = 0xC6;
const ifnonnull = 0xC7;
const goto_w = 0xC8;
const jsr_w = 0xC9;
const breakpoint = 0xCA;
const impdep1 = 0xFE;
const impdep2 = 0xFF;
}