mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWasm: Remove some dead code
This commit is contained in:
parent
368dad54ef
commit
56ae6b3968
Notes:
sideshowbarker
2024-07-19 15:29:21 +09:00
Author: https://github.com/dzfrias
Commit: 56ae6b3968
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/702
Reviewed-by: https://github.com/alimpfard ✅
2 changed files with 0 additions and 51 deletions
|
@ -489,51 +489,6 @@ double BytecodeInterpreter::read_value<double>(ReadonlyBytes data)
|
||||||
return bit_cast<double>(static_cast<u64>(raw_value));
|
return bit_cast<double>(static_cast<u64>(raw_value));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename V, typename T>
|
|
||||||
MakeSigned<T> BytecodeInterpreter::checked_signed_truncate(V value)
|
|
||||||
{
|
|
||||||
if (isnan(value) || isinf(value)) { // "undefined", let's just trap.
|
|
||||||
m_trap = Trap { "Signed truncation undefined behavior" };
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
double truncated;
|
|
||||||
if constexpr (IsSame<float, V>)
|
|
||||||
truncated = truncf(value);
|
|
||||||
else
|
|
||||||
truncated = trunc(value);
|
|
||||||
|
|
||||||
using SignedT = MakeSigned<T>;
|
|
||||||
if (NumericLimits<SignedT>::min() <= truncated && static_cast<double>(NumericLimits<SignedT>::max()) >= truncated)
|
|
||||||
return static_cast<SignedT>(truncated);
|
|
||||||
|
|
||||||
dbgln_if(WASM_TRACE_DEBUG, "Truncate out of range error");
|
|
||||||
m_trap = Trap { "Signed truncation out of range" };
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename V, typename T>
|
|
||||||
MakeUnsigned<T> BytecodeInterpreter::checked_unsigned_truncate(V value)
|
|
||||||
{
|
|
||||||
if (isnan(value) || isinf(value)) { // "undefined", let's just trap.
|
|
||||||
m_trap = Trap { "Unsigned truncation undefined behavior" };
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
double truncated;
|
|
||||||
if constexpr (IsSame<float, V>)
|
|
||||||
truncated = truncf(value);
|
|
||||||
else
|
|
||||||
truncated = trunc(value);
|
|
||||||
|
|
||||||
using UnsignedT = MakeUnsigned<T>;
|
|
||||||
if (NumericLimits<UnsignedT>::min() <= truncated && static_cast<double>(NumericLimits<UnsignedT>::max()) >= truncated)
|
|
||||||
return static_cast<UnsignedT>(truncated);
|
|
||||||
|
|
||||||
dbgln_if(WASM_TRACE_DEBUG, "Truncate out of range error");
|
|
||||||
m_trap = Trap { "Unsigned truncation out of range" };
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector<Value> BytecodeInterpreter::pop_values(Configuration& configuration, size_t count)
|
Vector<Value> BytecodeInterpreter::pop_values(Configuration& configuration, size_t count)
|
||||||
{
|
{
|
||||||
Vector<Value> results;
|
Vector<Value> results;
|
||||||
|
|
|
@ -77,12 +77,6 @@ protected:
|
||||||
template<typename PopType, typename PushType, typename Operator, typename... Args>
|
template<typename PopType, typename PushType, typename Operator, typename... Args>
|
||||||
void unary_operation(Configuration&, Args&&...);
|
void unary_operation(Configuration&, Args&&...);
|
||||||
|
|
||||||
template<typename V, typename T>
|
|
||||||
MakeUnsigned<T> checked_unsigned_truncate(V);
|
|
||||||
|
|
||||||
template<typename V, typename T>
|
|
||||||
MakeSigned<T> checked_signed_truncate(V);
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T read_value(ReadonlyBytes data);
|
T read_value(ReadonlyBytes data);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue