mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
toString() for debugging
This commit is contained in:
parent
5a22c94b29
commit
20c6516b59
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2018 - 2021 Volker Berlin (i-net software)
|
Copyright 2018 - 2022 Volker Berlin (i-net software)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -103,6 +103,7 @@ class WasmBlockInstruction extends WasmInstruction {
|
|||||||
AnyType getPushValueType() {
|
AnyType getPushValueType() {
|
||||||
switch( op ) {
|
switch( op ) {
|
||||||
case IF:
|
case IF:
|
||||||
|
case BLOCK:
|
||||||
return data != ValueType.empty ? (AnyType)data : null;
|
return data != ValueType.empty ? (AnyType)data : null;
|
||||||
case RETURN:
|
case RETURN:
|
||||||
return (AnyType)data;
|
return (AnyType)data;
|
||||||
@ -151,4 +152,12 @@ class WasmBlockInstruction extends WasmInstruction {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only used for debugging
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getSimpleName() + ": " + op + (data == null || data == ValueType.empty ? "" : " " + data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2018 - 2021 Volker Berlin (i-net software)
|
Copyright 2018 - 2022 Volker Berlin (i-net software)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -129,4 +129,12 @@ class WasmConstInstruction extends WasmInstruction {
|
|||||||
AnyType[] getPopValueTypes() {
|
AnyType[] getPopValueTypes() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only used for debugging
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getSimpleName() + ": " + value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,4 +150,12 @@ class WasmLocalInstruction extends WasmInstruction {
|
|||||||
AnyType[] getPopValueTypes() {
|
AnyType[] getPopValueTypes() {
|
||||||
return op == get ? null : new AnyType[] { localVariables.getValueType( getIndex() ) };
|
return op == get ? null : new AnyType[] { localVariables.getValueType( getIndex() ) };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only used for debugging
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getSimpleName() + ": local." + op + ' ' + idx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2018 - 2021 Volker Berlin (i-net software)
|
Copyright 2018 - 2022 Volker Berlin (i-net software)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -133,4 +133,12 @@ class WasmNumericInstruction extends WasmInstruction {
|
|||||||
return new AnyType[] { valueType, valueType };
|
return new AnyType[] { valueType, valueType };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Only used for debugging
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getSimpleName() + ": " + valueType + '.' + numOp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user