Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
SquirrelJME
Commits
7db90a55
Commit
7db90a55
authored
Mar 31, 2017
by
Stephanie Gawroriski
Browse files
Implement dup; Update the readme.
parent
a683a499
Changes
3
Hide whitespace changes
Inline
Side-by-side
libs/squirreljme-class-format/net/multiphasicapps/squirreljme/classformat/StackMapType.java
View file @
7db90a55
...
@@ -70,6 +70,17 @@ public enum StackMapType
...
@@ -70,6 +70,17 @@ public enum StackMapType
return
this
!=
TOP
&&
this
!=
NOTHING
;
return
this
!=
TOP
&&
this
!=
NOTHING
;
}
}
/**
* Is this a valid type for storing of a value?
*
* @return {@code true} if this is not nothing or the top type.
* @since 2017/03/31
*/
public
final
boolean
isValid
()
{
return
this
!=
NOTHING
&&
this
!=
TOP
;
}
/**
/**
* Returns {@code true} if this is a wide type.
* Returns {@code true} if this is a wide type.
*
*
...
...
libs/squirreljme-class-format/net/multiphasicapps/squirreljme/classformat/__OpParser__.java
View file @
7db90a55
...
@@ -427,6 +427,10 @@ final class __OpParser__
...
@@ -427,6 +427,10 @@ final class __OpParser__
case
ClassByteCodeIndex
.
NEW
:
case
ClassByteCodeIndex
.
NEW
:
return
__executeNew
(
pool
.
get
(
input
.
readUnsignedShort
()).
return
__executeNew
(
pool
.
get
(
input
.
readUnsignedShort
()).
<
ClassNameSymbol
>
get
(
true
,
ClassNameSymbol
.
class
));
<
ClassNameSymbol
>
get
(
true
,
ClassNameSymbol
.
class
));
// Duplicate variables
case
ClassByteCodeIndex
.
DUP
:
return
__executeDup
();
// {@squirreljme.error AY38 Defined operation cannot be
// {@squirreljme.error AY38 Defined operation cannot be
// used in Java ME programs. (The operation)}
// used in Java ME programs. (The operation)}
...
@@ -450,7 +454,6 @@ final class __OpParser__
...
@@ -450,7 +454,6 @@ final class __OpParser__
case
ClassByteCodeIndex
.
SASTORE
:
case
ClassByteCodeIndex
.
SASTORE
:
case
ClassByteCodeIndex
.
POP
:
case
ClassByteCodeIndex
.
POP
:
case
ClassByteCodeIndex
.
POP2
:
case
ClassByteCodeIndex
.
POP2
:
case
ClassByteCodeIndex
.
DUP
:
case
ClassByteCodeIndex
.
DUP_X1
:
case
ClassByteCodeIndex
.
DUP_X1
:
case
ClassByteCodeIndex
.
DUP_X2
:
case
ClassByteCodeIndex
.
DUP_X2
:
case
ClassByteCodeIndex
.
DUP2
:
case
ClassByteCodeIndex
.
DUP2
:
...
@@ -556,6 +559,37 @@ final class __OpParser__
...
@@ -556,6 +559,37 @@ final class __OpParser__
}
}
}
}
/**
* Duplicates the topmost entry on the stack.
*
* @since 2017/03/31
*/
private
int
[]
__executeDup
()
{
// Get
__SMTState__
smwork
=
this
.
_smwork
;
__SMTStack__
stack
=
smwork
.
_stack
;
// Get the element on the top of the stack
int
top
=
stack
.
top
();
StackMapType
tt
=
stack
.
get
(
top
-
1
);
// {@squirreljme.error AY0q The specified type cannot be duplicated
// on the stack. (The type at the top of the stack)}
if
(!
tt
.
isValid
()
||
tt
.
isWide
())
throw
new
ClassFormatException
(
String
.
format
(
"AY0q %s"
,
tt
));
// Push this type to the top
stack
.
push
(
tt
);
// Generate the copy
this
.
writer
.
copy
(
tt
,
CodeVariable
.
of
(
true
,
top
-
1
),
CodeVariable
.
of
(
true
,
top
));
// Implicit next
return
IMPLICIT_NEXT
;
}
/**
/**
* Executes an invoke of a method.
* Executes an invoke of a method.
*
*
...
...
readme.mkd
View file @
7db90a55
...
@@ -30,28 +30,32 @@ Note that Java ME 8 has a Java 7 virtual machine with specific limitations.
...
@@ -30,28 +30,32 @@ Note that Java ME 8 has a Java 7 virtual machine with specific limitations.
## Repository
## Repository
*
[
Online repository
](
http://multiphasicapps.net/
)
*
[
Online repository
](
http://multiphasicapps.net/
)
*
SquirrelJME uses
`fossil`
<http://fossil-scm.org/>
.
(
[
HTTPS
](
https://multiphasicapps.net/
)
)
*
The repository may be cloned with:
*
SquirrelJME uses
`fossil`
<http://fossil-scm.org/>
.
*
The repository may be cloned with:
*
One of these commands
*
`fossil clone -u http://multiphasicapps.net/ squirreljme.fossil`
*
`fossil clone -u http://multiphasicapps.net/ squirreljme.fossil`
*
`mkdir squireljme`
*
`fossil clone -u https://multiphasicapps.net/ squirreljme.fossil`
*
`cd squirreljme`
*
`mkdir squireljme`
*
`fossil open ../squirreljme.fossil`
*
`cd squirreljme`
*
Trunk Source Snapshot (
`fossil serve`
only):
*
`fossil open ../squirreljme.fossil`
*
[
TAR.GZ
](
/tarball/squirreljme-trunk.tar.gz?uuid=trunk
)
*
Trunk Source Snapshot (
`fossil serve`
only):
*
[
ZIP
](
/zip/squirreljme-trunk.zip?uuid=trunk
)
*
[
TAR.GZ
](
/tarball/squirreljme-trunk.tar.gz?uuid=trunk
)
*
Read-Only Mirrors:
*
[
ZIP
](
/zip/squirreljme-trunk.zip?uuid=trunk
)
*
Bitbucket:
<https://bitbucket.org/mpasteven/squirreljme>
*
Read-Only Mirrors:
*
GitHub:
<http://github.com/mpasteven/SquirrelJME>
*
Bitbucket:
<https://bitbucket.org/mpasteven/squirreljme>
*
GitLab:
<https://gitlab.com/mpasteven/SquirrelJME>
*
GitHub:
<https://github.com/mpasteven/SquirrelJME>
*
Tor:
<http://squirrelzarhffxz.onion/>
*
GitLab:
<https://gitlab.com/mpasteven/SquirrelJME>
(
`fossil clone -u http://squirrelzarhffxz.onion/ squirreljme.fossil`
)
*
Tor:
<http://squirrelzarhffxz.onion/>
(
`fossil clone -u http://squirrelzarhffxz.onion/ squirreljme.fossil`
)
## Documents
## Documents
*
[
Code of Conduct
](
code-of-conduct.mkd
)
*
[
Code of Conduct
](
code-of-conduct.mkd
)
*
[
Developer Notes
](
/uv/developer-notes/index.mkd
)
*
[
Developer Notes
](
/uv/developer-notes/index.mkd
)
*
[
Alternative URL
](
http://multiphasicapps.net/uv/developer-notes/index.mkd
)
*
[
Alternative URL
](
http://multiphasicapps.net/uv/developer-notes/index.mkd
)
(Links to the main repository)
(
[
HTTPS
](
https://multiphasicapps.net/uv/developer-notes/index.mkd
)
;
Links to the main repository, do not follow via Tor use the direct link)
*
[
Manual
](
assets/manual/index.mkd
)
*
[
Manual
](
assets/manual/index.mkd
)
*
[
Project Scope
](
scope.mkd
)
*
[
Project Scope
](
scope.mkd
)
*
[
Why?
](
assets/manual/user/why.mkd
)
*
[
Why?
](
assets/manual/user/why.mkd
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment