Add Int32 matching to CodeAssembler::ToInt32Constant
Prior to this, ToInt32Constant only matched Int64Constant nodes within the int32_t range, but did not match actual Int32Constant nodes. Change-Id: I4e67ea57f53f3b1d4b1f2b27f11ebdeffb2bf357 Reviewed-on: https://chromium-review.googlesource.com/1012022 Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#52590}
This commit is contained in:
parent
2c7c8da127
commit
7c36eff8d5
@ -371,12 +371,21 @@ TNode<HeapNumber> CodeAssembler::NaNConstant() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CodeAssembler::ToInt32Constant(Node* node, int32_t& out_value) {
|
bool CodeAssembler::ToInt32Constant(Node* node, int32_t& out_value) {
|
||||||
Int64Matcher m(node);
|
{
|
||||||
if (m.HasValue() &&
|
Int64Matcher m(node);
|
||||||
m.IsInRange(std::numeric_limits<int32_t>::min(),
|
if (m.HasValue() && m.IsInRange(std::numeric_limits<int32_t>::min(),
|
||||||
std::numeric_limits<int32_t>::max())) {
|
std::numeric_limits<int32_t>::max())) {
|
||||||
out_value = static_cast<int32_t>(m.Value());
|
out_value = static_cast<int32_t>(m.Value());
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Int32Matcher m(node);
|
||||||
|
if (m.HasValue()) {
|
||||||
|
out_value = m.Value();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user