mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Fix getTempI32() that it work without the removed prepare phase.
This commit is contained in:
parent
fcaa15d22d
commit
758557f76b
@ -83,13 +83,6 @@ class LocaleVariableManager {
|
||||
var.valueType = valueType;
|
||||
}
|
||||
|
||||
/**
|
||||
* We need an extra temporary variable inn the WebAssembly code.
|
||||
*/
|
||||
void useTempI32() {
|
||||
needTempI32 = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the WebAssembly index position on the consumed data.
|
||||
*/
|
||||
@ -131,7 +124,8 @@ class LocaleVariableManager {
|
||||
* @return the slot
|
||||
*/
|
||||
int getTempI32() {
|
||||
return size - 1;
|
||||
needTempI32 = true;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,6 +136,9 @@ class LocaleVariableManager {
|
||||
* @return the variable index in WebAssembly
|
||||
*/
|
||||
int get( int slot ) {
|
||||
if( slot < 0 ) {
|
||||
slot = size - 1; // temp i32
|
||||
}
|
||||
return variables[slot].idx;
|
||||
}
|
||||
|
||||
|
@ -751,7 +751,6 @@ public class ModuleGenerator {
|
||||
int[] keys;
|
||||
int[] positions;
|
||||
if( isLookupSwitch ) { // lookupswitch
|
||||
localVariables.useTempI32(); //TODO
|
||||
int count = byteCode.readInt();
|
||||
keys = new int[count];
|
||||
positions = new int[count];
|
||||
|
Loading…
x
Reference in New Issue
Block a user