[Turbofan] Intrinsic lowering of ToString(<str>) should provide <str>
BUG=v8:6103, chromium:700294 R=bmeurer@chromium.org Review-Url: https://codereview.chromium.org/2756463002 Cr-Commit-Position: refs/heads/master@{#43838}
This commit is contained in:
parent
339bb9ff46
commit
7b76d52083
@ -298,6 +298,12 @@ Reduction JSIntrinsicLowering::ReduceToObject(Node* node) {
|
||||
|
||||
|
||||
Reduction JSIntrinsicLowering::ReduceToString(Node* node) {
|
||||
// ToString is unnecessary if the input is a string.
|
||||
HeapObjectMatcher m(NodeProperties::GetValueInput(node, 0));
|
||||
if (m.HasValue() && m.Value()->IsString()) {
|
||||
ReplaceWithValue(node, m.node());
|
||||
return Replace(m.node());
|
||||
}
|
||||
NodeProperties::ChangeOp(node, javascript()->ToString());
|
||||
return Changed(node);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user