Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: src/crankshaft/hydrogen-instructions.cc

Issue 1704833002: [crankshaft] Make sure +x is as fast as Number(x). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/crankshaft/hydrogen.cc ('K') | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.cc
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc
index bbe70874d79a76cbfac8feb21ccddbedbdf1ff5b..f21bc9a7ebd4a39c4abfa30d954f938c50c678ef 100644
--- a/src/crankshaft/hydrogen-instructions.cc
+++ b/src/crankshaft/hydrogen-instructions.cc
@@ -2958,6 +2958,8 @@ Maybe<HConstant*> HConstant::CopyToTruncatedNumber(Isolate* isolate,
res = new (zone) HConstant(std::numeric_limits<double>::quiet_NaN());
} else if (handle->IsNull()) {
res = new(zone) HConstant(0);
+ } else if (handle->IsString()) {
+ res = new(zone) HConstant(String::ToNumber(Handle<String>::cast(handle)));
}
return res != NULL ? Just(res) : Nothing<HConstant*>();
}
« src/crankshaft/hydrogen.cc ('K') | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698