mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
skip the length of the instanceof list
This commit is contained in:
parent
d2cf5eaaaf
commit
af5f713a70
@ -49,7 +49,8 @@ class ReplacementForClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replacement for {@link Object#getClass()}
|
* Replacement for {@link Object#getClass()}. The documentation of the memory of the type description is done in method:
|
||||||
|
* {@link TypeManager.StructType#writeToStream(java.io.ByteArrayOutputStream, java.util.function.ToIntFunction)}
|
||||||
*
|
*
|
||||||
* @param obj
|
* @param obj
|
||||||
* the instance
|
* the instance
|
||||||
@ -63,7 +64,9 @@ class ReplacementForClass {
|
|||||||
+ "call $java/lang/Class.getIntFromMemory(I)I " //
|
+ "call $java/lang/Class.getIntFromMemory(I)I " //
|
||||||
+ "local.get 1 " // get the vtable location
|
+ "local.get 1 " // get the vtable location
|
||||||
+ "i32.add " //
|
+ "i32.add " //
|
||||||
+ "call $java/lang/Class.getIntFromMemory(I)I " //
|
+ "i32.const 4 " // length of instanceof
|
||||||
|
+ "i32.add " //
|
||||||
|
+ "call $java/lang/Class.getIntFromMemory(I)I " // first entry in instanceof is ever the id of the Class self
|
||||||
+ "call $java/lang/Class.classConstant(I)Lde/inetsoftware/jwebassembly/module/ReplacementForClass; " //
|
+ "call $java/lang/Class.classConstant(I)Lde/inetsoftware/jwebassembly/module/ReplacementForClass; " //
|
||||||
+ "return " //
|
+ "return " //
|
||||||
)
|
)
|
||||||
@ -120,12 +123,12 @@ class ReplacementForClass {
|
|||||||
/**
|
/**
|
||||||
* WASM code
|
* WASM code
|
||||||
* <p>
|
* <p>
|
||||||
* Set a string from the string table. Should be inlined from the optimizer.
|
* Set a Class instance in the Class table. Should be inlined from the optimizer.
|
||||||
*
|
*
|
||||||
* @param strIdx
|
* @param strIdx
|
||||||
* the id/index of the string.
|
* the id/index of the string.
|
||||||
* @param str
|
* @param clazz
|
||||||
* the string
|
* the Class instance
|
||||||
*/
|
*/
|
||||||
@WasmTextCode( "local.get 0 " + //
|
@WasmTextCode( "local.get 0 " + //
|
||||||
"local.get 1 " + //
|
"local.get 1 " + //
|
||||||
|
Loading…
x
Reference in New Issue
Block a user