File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Exceptions \ NotImplementedException ;
4+ use PHPJava \Utilities \ Extractor ;
55
66final class _baload implements OperationInterface
77{
@@ -10,6 +10,11 @@ final class _baload implements OperationInterface
1010
1111 public function execute (): void
1212 {
13- throw new NotImplementedException (__CLASS__ );
13+ $ index = Extractor::getRealValue ($ this ->popFromOperandStack ());
14+ $ arrayref = $ this ->popFromOperandStack ();
15+
16+ $ this ->pushToOperandStack (
17+ $ arrayref [$ index ]
18+ );
1419 }
1520}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Exceptions \NotImplementedException ;
4+ use PHPJava \Kernel \Types \Type ;
5+ use PHPJava \Utilities \Extractor ;
56
67final class _bastore implements OperationInterface
78{
@@ -10,6 +11,19 @@ final class _bastore implements OperationInterface
1011
1112 public function execute (): void
1213 {
13- throw new NotImplementedException (__CLASS__ );
14+ $ value = $ this ->popFromOperandStack ();
15+ $ index = Extractor::getRealValue ($ this ->popFromOperandStack ());
16+
17+ /**
18+ * @var Type $arrayref
19+ */
20+ $ arrayref = $ this ->popFromOperandStack ();
21+
22+ // The value is a ref.
23+ $ arrayref [$ index ] = $ value ;
24+
25+ $ this ->pushToOperandStack (
26+ $ arrayref
27+ );
1428 }
1529}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Exceptions \ NotImplementedException ;
4+ use PHPJava \Utilities \ Extractor ;
55
66final class _caload implements OperationInterface
77{
@@ -10,6 +10,11 @@ final class _caload implements OperationInterface
1010
1111 public function execute (): void
1212 {
13- throw new NotImplementedException (__CLASS__ );
13+ $ index = Extractor::getRealValue ($ this ->popFromOperandStack ());
14+ $ arrayref = $ this ->popFromOperandStack ();
15+
16+ $ this ->pushToOperandStack (
17+ $ arrayref [$ index ]
18+ );
1419 }
1520}
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ public function execute(): void
1616 $ index = Extractor::getRealValue ($ this ->popFromOperandStack ());
1717 $ arrayref = $ this ->popFromOperandStack ();
1818
19- $ this ->pushToOperandStack ($ arrayref [$ index ]);
19+ $ this ->pushToOperandStack (
20+ $ arrayref [$ index ]
21+ );
2022 }
2123}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4+ use PHPJava \Kernel \Types \Type ;
45use PHPJava \Utilities \Extractor ;
56
67final class _dastore implements OperationInterface
@@ -15,8 +16,17 @@ public function execute(): void
1516 {
1617 $ value = $ this ->popFromOperandStack ();
1718 $ index = Extractor::getRealValue ($ this ->popFromOperandStack ());
19+
20+ /**
21+ * @var Type $arrayref
22+ */
1823 $ arrayref = $ this ->popFromOperandStack ();
1924
25+ // The value is a ref.
2026 $ arrayref [$ index ] = $ value ;
27+
28+ $ this ->pushToOperandStack (
29+ $ arrayref
30+ );
2131 }
2232}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Exceptions \NotImplementedException ;
4+ use PHPJava \Kernel \Types \_Double ;
5+ use PHPJava \Utilities \BinaryTool ;
6+ use PHPJava \Utilities \Extractor ;
57
68final class _dneg implements OperationInterface
79{
@@ -10,6 +12,14 @@ final class _dneg implements OperationInterface
1012
1113 public function execute (): void
1214 {
13- throw new NotImplementedException (__CLASS__ );
15+ $ value = Extractor::getRealValue (
16+ $ this ->popFromOperandStack ()
17+ );
18+
19+ $ this ->pushToOperandStack (
20+ _Double::get (
21+ BinaryTool::negate ($ value )
22+ )
23+ );
1424 }
1525}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Utilities \BinaryTool ;
4+ use PHPJava \Utilities \Extractor ;
55
66final class _dstore implements OperationInterface
77{
@@ -14,8 +14,11 @@ final class _dstore implements OperationInterface
1414 public function execute (): void
1515 {
1616 $ index = $ this ->readUnsignedByte ();
17- $ value = $ this ->popFromOperandStack ();
17+ $ value = Extractor:: getRealValue ( $ this ->popFromOperandStack () );
1818
19- $ this ->setLocalStorage ($ index , BinaryTool::convertDoubleToIEEE754 ($ value ));
19+ $ this ->setLocalStorage (
20+ $ index ,
21+ $ value
22+ );
2023 }
2124}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Exceptions \ NotImplementedException ;
4+ use PHPJava \Utilities \ Extractor ;
55
66final class _faload implements OperationInterface
77{
@@ -10,6 +10,11 @@ final class _faload implements OperationInterface
1010
1111 public function execute (): void
1212 {
13- throw new NotImplementedException (__CLASS__ );
13+ $ index = Extractor::getRealValue ($ this ->popFromOperandStack ());
14+ $ arrayref = $ this ->popFromOperandStack ();
15+
16+ $ this ->pushToOperandStack (
17+ $ arrayref [$ index ]
18+ );
1419 }
1520}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Exceptions \NotImplementedException ;
4+ use PHPJava \Kernel \Types \Type ;
5+ use PHPJava \Utilities \Extractor ;
56
67final class _fastore implements OperationInterface
78{
@@ -10,6 +11,19 @@ final class _fastore implements OperationInterface
1011
1112 public function execute (): void
1213 {
13- throw new NotImplementedException (__CLASS__ );
14+ $ value = $ this ->popFromOperandStack ();
15+ $ index = Extractor::getRealValue ($ this ->popFromOperandStack ());
16+
17+ /**
18+ * @var Type $arrayref
19+ */
20+ $ arrayref = $ this ->popFromOperandStack ();
21+
22+ // The value is a ref.
23+ $ arrayref [$ index ] = $ value ;
24+
25+ $ this ->pushToOperandStack (
26+ $ arrayref
27+ );
1428 }
1529}
Original file line number Diff line number Diff line change 11<?php
22namespace PHPJava \Kernel \Mnemonics ;
33
4- use PHPJava \Exceptions \NotImplementedException ;
4+ use PHPJava \Kernel \Types \_Float ;
5+ use PHPJava \Utilities \BinaryTool ;
6+ use PHPJava \Utilities \Extractor ;
57
68final class _fneg implements OperationInterface
79{
@@ -10,6 +12,14 @@ final class _fneg implements OperationInterface
1012
1113 public function execute (): void
1214 {
13- throw new NotImplementedException (__CLASS__ );
15+ $ value = Extractor::getRealValue (
16+ $ this ->popFromOperandStack ()
17+ );
18+
19+ $ this ->pushToOperandStack (
20+ _Float::get (
21+ BinaryTool::negate ($ value )
22+ )
23+ );
1424 }
1525}
You can’t perform that action at this time.
0 commit comments