File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Float ;
56use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
68
79final class _d2f implements OperationInterface
810{
@@ -11,6 +13,10 @@ final class _d2f implements OperationInterface
1113
1214 public function execute (): void
1315 {
14- throw new NotImplementedException (__CLASS__ );
16+ $ value = Extractor::realValue (
17+ $ this ->popFromOperandStack ()
18+ );
19+
20+ $ this ->pushToOperandStack (new _Float ($ value ));
1521 }
1622}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Int ;
56use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
68
79final class _d2i implements OperationInterface
810{
@@ -11,6 +13,10 @@ final class _d2i implements OperationInterface
1113
1214 public function execute (): void
1315 {
14- throw new NotImplementedException (__CLASS__ );
16+ $ value = Extractor::realValue (
17+ $ this ->popFromOperandStack ()
18+ );
19+
20+ $ this ->pushToOperandStack (new _Int ($ value ));
1521 }
1622}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Long ;
56use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
68
79final class _d2l implements OperationInterface
810{
@@ -11,6 +13,10 @@ final class _d2l implements OperationInterface
1113
1214 public function execute (): void
1315 {
14- throw new NotImplementedException (__CLASS__ );
16+ $ value = Extractor::realValue (
17+ $ this ->popFromOperandStack ()
18+ );
19+
20+ $ this ->pushToOperandStack (new _Long ($ value ));
1521 }
1622}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Double ;
56use PHPJava \Utilities \BinaryTool ;
67
78final class _dreturn implements OperationInterface
89{
910 use \PHPJava \Kernel \Core \Accumulator;
1011 use \PHPJava \Kernel \Core \ConstantPool;
1112
12- public function execute (): void
13+ public function execute ()
1314 {
14- return new JavaTypeDouble ($ this ->popFromOperandStack ());
15+ $ value = $ this ->popFromOperandStack ();
16+ return ($ value instanceof _Double)
17+ ? $ value
18+ : new _Double ($ value );
1519 }
1620}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Double ;
56use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
68
79final class _f2d implements OperationInterface
810{
@@ -11,6 +13,10 @@ final class _f2d implements OperationInterface
1113
1214 public function execute (): void
1315 {
14- throw new NotImplementedException (__CLASS__ );
16+ $ value = Extractor::realValue (
17+ $ this ->popFromOperandStack ()
18+ );
19+
20+ $ this ->pushToOperandStack (new _Double ($ value ));
1521 }
1622}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Int ;
56use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
68
79final class _f2i implements OperationInterface
810{
@@ -11,6 +13,10 @@ final class _f2i implements OperationInterface
1113
1214 public function execute (): void
1315 {
14- throw new NotImplementedException (__CLASS__ );
16+ $ value = Extractor::realValue (
17+ $ this ->popFromOperandStack ()
18+ );
19+
20+ $ this ->pushToOperandStack (new _Int ($ value ));
1521 }
1622}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Long ;
56use PHPJava \Utilities \BinaryTool ;
7+ use PHPJava \Utilities \Extractor ;
68
79final class _f2l implements OperationInterface
810{
@@ -11,6 +13,10 @@ final class _f2l implements OperationInterface
1113
1214 public function execute (): void
1315 {
14- throw new NotImplementedException (__CLASS__ );
16+ $ value = Extractor::realValue (
17+ $ this ->popFromOperandStack ()
18+ );
19+
20+ $ this ->pushToOperandStack (new _Long ($ value ));
1521 }
1622}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Float ;
56use PHPJava \Utilities \BinaryTool ;
67
78final class _fload implements OperationInterface
@@ -11,6 +12,11 @@ final class _fload implements OperationInterface
1112
1213 public function execute (): void
1314 {
14- throw new NotImplementedException (__CLASS__ );
15+ $ index = $ this ->readUnsignedByte ();
16+ $ this ->pushToOperandStack (
17+ new _Float (
18+ $ this ->getLocalStorage ($ index )
19+ )
20+ );
1521 }
1622}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Float ;
56use PHPJava \Utilities \BinaryTool ;
67
78final class _fload_0 implements OperationInterface
@@ -11,6 +12,10 @@ final class _fload_0 implements OperationInterface
1112
1213 public function execute (): void
1314 {
14- throw new NotImplementedException (__CLASS__ );
15+ $ this ->pushToOperandStack (
16+ new _Float (
17+ $ this ->getLocalStorage (0 )
18+ )
19+ );
1520 }
1621}
Original file line number Diff line number Diff line change 22namespace PHPJava \Kernel \Mnemonics ;
33
44use PHPJava \Exceptions \NotImplementedException ;
5+ use PHPJava \Kernel \Types \_Float ;
56use PHPJava \Utilities \BinaryTool ;
67
78final class _fload_1 implements OperationInterface
@@ -11,6 +12,10 @@ final class _fload_1 implements OperationInterface
1112
1213 public function execute (): void
1314 {
14- throw new NotImplementedException (__CLASS__ );
15+ $ this ->pushToOperandStack (
16+ new _Float (
17+ $ this ->getLocalStorage (1 )
18+ )
19+ );
1520 }
1621}
You can’t perform that action at this time.
0 commit comments