[crankshaft] Eliminate unnecessary ToNumber call

This is a fix for a regression that started ~6 months ago when
https://codereview.chromium.org/1757013002 landed. This patch will remove the
unnecessary Change/CallWithDescriptor/Change opcodes causing the regression.

BUG=v8:5373
R=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2423923002
Cr-Commit-Position: refs/heads/master@{#40345}
This commit is contained in:
sander 2016-10-17 02:27:19 -07:00 committed by Commit bot
parent e0b4b1b63f
commit f87d19c42e
2 changed files with 3 additions and 1 deletions

View File

@ -110,6 +110,7 @@ Robert Mustacchi <rm@fingolfin.org>
Robert Nagy <robert.nagy@gmail.com>
Ryan Dahl <ry@tinyclouds.org>
Sakthipriyan Vairamani (thefourtheye) <thechargingvolcano@gmail.com>
Sander Mathijs van Veen <sander@leaningtech.com>
Sandro Santilli <strk@keybit.net>
Sanjoy Das <sanjoy@playingwithpointers.com>
Seo Sanghyeon <sanxiyn@gmail.com>

View File

@ -2232,7 +2232,8 @@ HValue* HGraphBuilder::BuildNumberToString(HValue* object, AstType* type) {
}
HValue* HGraphBuilder::BuildToNumber(HValue* input) {
if (input->type().IsTaggedNumber()) {
if (input->type().IsTaggedNumber() ||
input->representation().IsSpecialization()) {
return input;
}
Callable callable = CodeFactory::ToNumber(isolate());