mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove unneccessary masking of tags.
This commit is contained in:
parent
76d3e579bc
commit
d3abbd5610
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
Compiler Features:
|
Compiler Features:
|
||||||
* Code Generator: Evaluate ``keccak256`` of string literals at compile-time.
|
* Code Generator: Evaluate ``keccak256`` of string literals at compile-time.
|
||||||
|
* Peephole Optimizer: Remove unnecessary masking of tags.
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
* Type Checker: Fix overload resolution in combination with ``{value: ...}``.
|
* Type Checker: Fix overload resolution in combination with ``{value: ...}``.
|
||||||
|
@ -266,9 +266,10 @@ struct TagConjunctions: SimplePeepholeOptimizerMethod<TagConjunctions, 3>
|
|||||||
std::back_insert_iterator<AssemblyItems> _out
|
std::back_insert_iterator<AssemblyItems> _out
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (_and != Instruction::AND)
|
||||||
|
return false;
|
||||||
if (
|
if (
|
||||||
_pushTag.type() == PushTag &&
|
_pushTag.type() == PushTag &&
|
||||||
_and == Instruction::AND &&
|
|
||||||
_pushConstant.type() == Push &&
|
_pushConstant.type() == Push &&
|
||||||
(_pushConstant.data() & u256(0xFFFFFFFF)) == u256(0xFFFFFFFF)
|
(_pushConstant.data() & u256(0xFFFFFFFF)) == u256(0xFFFFFFFF)
|
||||||
)
|
)
|
||||||
@ -276,6 +277,16 @@ struct TagConjunctions: SimplePeepholeOptimizerMethod<TagConjunctions, 3>
|
|||||||
*_out = _pushTag;
|
*_out = _pushTag;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if (
|
||||||
|
// tag and constant are swapped
|
||||||
|
_pushConstant.type() == PushTag &&
|
||||||
|
_pushTag.type() == Push &&
|
||||||
|
(_pushTag.data() & u256(0xFFFFFFFF)) == u256(0xFFFFFFFF)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
*_out = _pushConstant;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user