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
ddfa630b
Commit
ddfa630b
authored
Jul 18, 2021
by
Stephanie Gawroriski
Browse files
More pull in.
parent
5b9733e5
Pipeline
#39158
passed with stages
in 1 minute and 29 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
emulators/summercoat-vm/src/main/java/cc/squirreljme/vm/summercoat/NativeCPU.java
View file @
ddfa630b
...
@@ -943,8 +943,7 @@ public final class NativeCPU
...
@@ -943,8 +943,7 @@ public final class NativeCPU
Frame
was
=
frames
.
getLast
();
Frame
was
=
frames
.
getLast
();
if
((
was
.
_taskid
==
0
||
if
((
was
.
_taskid
==
0
||
syscallid
==
SystemCallIndex
.
EXCEPTION_LOAD
||
syscallid
==
SystemCallIndex
.
EXCEPTION_LOAD
||
syscallid
==
SystemCallIndex
.
EXCEPTION_STORE
)
&&
syscallid
==
SystemCallIndex
.
EXCEPTION_STORE
))
syscallid
!=
SystemCallIndex
.
IPC_CALL
)
{
{
// If profiling, profile the handling of the
// If profiling, profile the handling of the
// system call in a sub-frame
// system call in a sub-frame
...
@@ -1263,8 +1262,6 @@ public final class NativeCPU
...
@@ -1263,8 +1262,6 @@ public final class NativeCPU
case
SystemCallIndex
.
PD_WRITE_BYTE
:
case
SystemCallIndex
.
PD_WRITE_BYTE
:
case
SystemCallIndex
.
SLEEP
:
case
SystemCallIndex
.
SLEEP
:
case
SystemCallIndex
.
SUPERVISOR_BOOT_OKAY
:
case
SystemCallIndex
.
SUPERVISOR_BOOT_OKAY
:
case
SystemCallIndex
.
SUPERVISOR_PROPERTY_GET
:
case
SystemCallIndex
.
SUPERVISOR_PROPERTY_SET
:
case
SystemCallIndex
.
TIME_MILLI_WALL
:
case
SystemCallIndex
.
TIME_MILLI_WALL
:
case
SystemCallIndex
.
TIME_NANO_MONO
:
case
SystemCallIndex
.
TIME_NANO_MONO
:
case
SystemCallIndex
.
VMI_MEM_FREE
:
case
SystemCallIndex
.
VMI_MEM_FREE
:
...
@@ -1554,50 +1551,6 @@ public final class NativeCPU
...
@@ -1554,50 +1551,6 @@ public final class NativeCPU
err
=
0
;
err
=
0
;
break
;
break
;
// Get supervisor property
case
SystemCallIndex
.
SUPERVISOR_PROPERTY_GET
:
{
int
dx
=
__args
[
0
];
// Out of range?
if
(
dx
<
0
||
dx
>=
SupervisorPropertyIndex
.
NUM_PROPERTIES
)
{
rv
=
0
;
err
=
SystemCallError
.
VALUE_OUT_OF_RANGE
;
}
// Valid
else
{
rv
=
this
.
_supervisorproperties
[
dx
];
err
=
SystemCallError
.
NO_ERROR
;
}
}
break
;
// Set supervisor property
case
SystemCallIndex
.
SUPERVISOR_PROPERTY_SET
:
{
int
dx
=
__args
[
0
];
// Out of range?
if
(
dx
<
0
||
dx
>=
SupervisorPropertyIndex
.
NUM_PROPERTIES
)
{
rv
=
0
;
err
=
SystemCallError
.
VALUE_OUT_OF_RANGE
;
}
// Valid
else
{
this
.
_supervisorproperties
[
dx
]
=
__args
[
1
];
rv
=
0
;
err
=
SystemCallError
.
NO_ERROR
;
}
}
break
;
// Current wall clock milliseconds.
// Current wall clock milliseconds.
case
SystemCallIndex
.
TIME_MILLI_WALL
:
case
SystemCallIndex
.
TIME_MILLI_WALL
:
{
{
...
...
modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SystemCallException.java
deleted
100644 → 0
View file @
5b9733e5
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
cc.squirreljme.jvm
;
/**
* Exception that may be thrown by {@link SystemCallError#checkError(short)}.
*
* @since 2020/01/12
*/
public
class
SystemCallException
extends
RuntimeException
{
/** The system call ID. */
public
final
int
callid
;
/** The error code. */
public
final
int
code
;
/**
* Initializes the exception with no message or cause.
*
* @param __sid The call ID.
* @param __ec The error code.
* @since 2019/10/21
*/
public
SystemCallException
(
int
__sid
,
int
__ec
)
{
this
.
callid
=
__sid
;
this
.
code
=
__ec
;
}
/**
* Initializes the exception with the given message and no cause.
*
* @param __sid The call ID.
* @param __ec The error code.
* @param __m The message.
* @since 2019/10/21
*/
public
SystemCallException
(
int
__sid
,
int
__ec
,
String
__m
)
{
super
(
__m
);
this
.
callid
=
__sid
;
this
.
code
=
__ec
;
}
/**
* Initializes the exception with the given message and cause.
*
* @param __sid The call ID.
* @param __ec The error code.
* @param __m The message.
* @param __t The cause.
* @since 2019/10/21
*/
public
SystemCallException
(
int
__sid
,
int
__ec
,
String
__m
,
Throwable
__t
)
{
super
(
__m
,
__t
);
this
.
callid
=
__sid
;
this
.
code
=
__ec
;
}
/**
* Initializes the exception with the given cause and no message.
*
* @param __sid The call ID.
* @param __ec The error code.
* @param __t The cause.
* @since 2019/10/21
*/
public
SystemCallException
(
int
__sid
,
int
__ec
,
Throwable
__t
)
{
super
(
__t
);
this
.
callid
=
__sid
;
this
.
code
=
__ec
;
}
/**
* {@inheritDoc}
* @since 2020/01/12
*/
@Override
public
String
getMessage
()
{
return
"[SID="
+
this
.
callid
+
", ERR="
+
SystemCallError
.
toString
(
this
.
code
)
+
"]: "
+
super
.
getMessage
();
}
}
modules/cldc-compact/src/main/java/cc/squirreljme/jvm/summercoat/constants/ClassProperty.java
0 → 100644
View file @
ddfa630b
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
cc.squirreljme.jvm.summercoat.constants
;
import
cc.squirreljme.jvm.mle.brackets.TypeBracket
;
/**
* This contains properties of class info for {@link TypeBracket}.
*
* Static properties are declared in {@link StaticClassProperty}.
*
* @since 2019/11/30
*/
public
interface
ClassProperty
extends
StaticClassProperty
{
/** The pointer to the class name (in descriptor form). */
byte
MEMHANDLE_THIS_NAME_DESC
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
1
;
/** The allocation size of this class to store all of its fields. */
byte
SIZE_ALLOCATION
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
2
;
/** The base offset for instance fields in this class. */
byte
OFFSETBASE_INSTANCE_FIELDS
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
3
;
/** The super class data. */
byte
TYPEBRACKET_SUPER
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
4
;
/** Interfaces. */
byte
TYPEBRACKETS_INTERFACE_CLASSES
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
5
;
/** The component class. */
byte
TYPEBRACKET_COMPONENT
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
6
;
/** Pointer to a {@link Class} instance. */
byte
MEMHANDLE_LANG_CLASS_INSTANCE
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
7
;
/** The pointer to the constant pool of this class. */
byte
POOLHANDLE_POOL
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
8
;
/** The depth of this class. */
byte
INT_CLASSDEPTH
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
9
;
/** Memory handle base for static fields. */
byte
MEMHANDLE_STATIC_FIELDS
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
10
;
/** The pointer to the class name (in {@link Class#getName()} form). */
byte
MEMHANDLE_THIS_NAME_RUNTIME
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
11
;
/** All interfaces that are implemented by this class. */
byte
TYPEBRACKET_ALL_INTERFACECLASSES
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
12
;
/** The JAR that this class is within. */
byte
INT_JARDX
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
13
;
/** The function pointer for the default new method, if any (low). */
byte
FUNCPTR_DEFAULT_NEW_LO
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
14
;
/** The function pointer for the default new method, if any (high). */
byte
FUNCPTR_DEFAULT_NEW_HI
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
15
;
/** The memory pointer to the ROM class in memory (low). */
byte
MEMPTR_ROM_CLASS_LO
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
16
;
/** The memory pointer to the ROM class in memory (high). */
byte
MEMPTR_ROM_CLASS_HI
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
17
;
/** The cell size for array components, if this is an array. */
byte
INT_COMPONENT_CELL_SIZE
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
18
;
/** The allocation kind for the memory handle. */
byte
INT_MEMHANDLE_KIND
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
19
;
/** The VTable of the class. */
byte
MEMHANDLE_VTABLE
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
20
;
/** The interface tables that are available for a class. */
byte
MEMHANDLE_I2XTABLE
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
21
;
/** The static invocation table. */
byte
MEMHANDLE_STABLE
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
22
;
/** The mask potential for the I2X Table. */
byte
MASK_I2XTABLE
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
23
;
/** The root component class information. */
byte
TYPEBRACKET_ROOT_COMPONENT
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
24
;
/** Is this class initialized? */
byte
BOOLEAN_IS_INITIALIZED
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
25
;
/** The method pointer to the class static initializer (low). */
byte
FUNCPTR_CLINIT_LO
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
26
;
/** The method pointer to the class static initializer (high). */
byte
FUNCPTR_CLINIT_HI
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
27
;
/** The previous class in the class chain. */
byte
TYPEBRACKET_LINK_CLASS_PREV
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
28
;
/** The next class in the class chain. */
byte
TYPEBRACKET_LINK_CLASS_NEXT
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
29
;
/** Size of the ROM data. */
byte
SIZEOF_ROM_CLASS
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
30
;
/** The number of properties available. */
byte
NUM_RUNTIME_PROPERTIES
=
StaticClassProperty
.
NUM_STATIC_PROPERTIES
+
31
;
}
modules/cldc-compact/src/main/java/cc/squirreljme/jvm/summercoat/constants/JarProperty.java
0 → 100644
View file @
ddfa630b
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
cc.squirreljme.jvm.summercoat.constants
;
/**
* Properties that are associated with JAR files.
*
* @since 2020/12/07
*/
public
interface
JarProperty
{
/** The property based version ID. */
byte
INT_JAR_VERSION_ID
=
0
;
/** Number of resources. */
byte
COUNT_TOC
=
1
;
/** Table of contents offset. */
byte
OFFSET_TOC
=
2
;
/** Table of contents size. */
byte
SIZE_TOC
=
3
;
/** The manifest index. */
byte
RCDX_MANIFEST
=
4
;
/** Boot initializer offset. */
byte
OFFSET_BOOT_INIT
=
5
;
/** Boot initializer size. */
byte
SIZE_BOOT_INIT
=
6
;
/** The entry pool for the starting class, used to reference data. */
byte
MEMHANDLEID_START_POOL
=
7
;
/**
* The class with the start method
* ({@link StaticClassProperty#INDEX_BOOT_METHOD}.
*/
byte
RCDX_START_CLASS
=
8
;
/** Static constant pool offset. */
byte
OFFSET_STATIC_POOL
=
9
;
/** Static constant pool size. */
byte
SIZE_STATIC_POOL
=
10
;
/** Runtime constant pool offset. */
byte
OFFSET_RUNTIME_POOL
=
11
;
/** Runtime constant pool size. */
byte
SIZE_RUNTIME_POOL
=
12
;
/** The base allocation size of arrays. */
byte
SIZE_BASE_ARRAY
=
13
;
/** Attributes for the virtual machine. */
byte
MEMHANDLEID_VM_ATTRIBUTES
=
14
;
/** The number of properties in the JAR. */
byte
NUM_JAR_PROPERTIES
=
15
;
}
modules/cldc-compact/src/main/java/cc/squirreljme/jvm/summercoat/constants/StaticClassProperty.java
0 → 100644
View file @
ddfa630b
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
// Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------
package
cc.squirreljme.jvm.summercoat.constants
;
/**
* Static class information properties, these are properties that are stored
* within minimized class files.
*
* Run-time properties are handled in {@link ClassProperty}.
*
* @since 2020/11/29
*/
public
interface
StaticClassProperty
{
/** The property based version ID. */
byte
INT_CLASS_VERSION_ID
=
0
;
/** The index of the method which is the bootstrap entry point. */
byte
INDEX_BOOT_METHOD
=
1
;
/**
* The data type of the class
* {@code dev.shadowtail.classfile.xlate.DataType}.
*/
byte
INT_DATA_TYPE
=
2
;
/** Class flags. */
byte
INT_CLASS_FLAGS
=
3
;
/** Name of class. */
byte
SPOOL_THIS_CLASS_NAME
=
4
;
/** Super class name. */
byte
SPOOL_SUPER_CLASS_NAME
=
5
;
/** Interfaces in class. */
byte
SPOOL_INTERFACES
=
6
;
/** Class type ({@code net.multiphasicapps.classfile.ClassType}). */
byte
INT_CLASS_TYPE
=
7
;
/** Class version {@code net.multiphasicapps.classfile.ClassVersion}. */
byte
INT_CLASS_VERSION
=
8
;
/** Class source filename. */
byte
SPOOL_SOURCE_FILENAME
=
9
;
/** Static field count. */
byte
INT_STATIC_FIELD_COUNT
=
10
;
/** Static field bytes. */
byte
INT_STATIC_FIELD_BYTES
=
11
;
/** Static field objects. */
byte
INT_STATIC_FIELD_OBJECTS
=
12
;
/** Static field data offset. */
@Deprecated
byte
OFFSET_STATIC_FIELD_DATA
=
13
;
/** Static field data size. */
@Deprecated
byte
SIZE_STATIC_FIELD_DATA
=
14
;
/** Instance field count. */
byte
INT_INSTANCE_FIELD_COUNT
=
15
;
/** Instance field bytes. */
@Deprecated
byte
INT_INSTANCE_FIELD_BYTES
=
16
;
/** Instance field objects. */
byte
INT_INSTANCE_FIELD_OBJECTS
=
17
;
/** Instance field data offset. */
@Deprecated
byte
OFFSET_INSTANCE_FIELD_DATA
=
18
;
/** Instance field data size. */
@Deprecated
byte
SIZE_INSTANCE_FIELD_DATA
=
19
;
/** Static method count. */
byte
INT_STATIC_METHOD_COUNT
=
20
;
/** Static method data offset. */
@Deprecated
byte
OFFSET_STATIC_METHOD_DATA
=
21
;
/** Static method data size. */
@Deprecated
byte
SIZE_STATIC_METHOD_DATA
=
22
;
/** Instance method count. */
byte
INT_INSTANCE_METHOD_COUNT
=
23
;
/** Instance method data offset. */
@Deprecated
byte
OFFSET_INSTANCE_METHOD_DATA
=
24
;
/** Instance method data size. */
@Deprecated
byte
SIZE_INSTANCE_METHOD_DATA
=
25
;
/** High bits for UUID. */
byte
INT_UUID_HI
=
26
;
/** Low bits for UUID. */
byte
INT_UUID_LO
=
27
;
/** File size. */
byte
INT_FILE_SIZE
=
28
;
/** Static constant pool offset. */
byte
OFFSET_STATIC_POOL
=
29
;
/** Static constant pool size. */
byte
SIZE_STATIC_POOL
=
30
;
/** Runtime constant pool offset. */
byte
OFFSET_RUNTIME_POOL
=
31
;
/** Runtime constant pool size. */
byte
SIZE_RUNTIME_POOL
=
32
;
/** The offset to the boot class. */
byte
OFFSET_BOOT_METHOD
=
33
;
/** The number of dimensions used. */
byte
NUM_DIMENSIONS
=
34
;
/** Is the component type the {@link Object} or one of its arrays? */
byte
BOOLEAN_ROOT_IS_OBJECT
=