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

Unified Diff: src/hydrogen-types.cc

Issue 556563005: Fix Smi vs. HeapObject confusion in HConstants. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | test/mjsunit/regress/regress-crbug-412215.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-types.cc
diff --git a/src/hydrogen-types.cc b/src/hydrogen-types.cc
index c83ff3cf89037ab184bee97819e32d08c347b82a..87047a2552e0daf934cb2b1aa60a6eba107c0d11 100644
--- a/src/hydrogen-types.cc
+++ b/src/hydrogen-types.cc
@@ -42,7 +42,10 @@ HType HType::FromType<HeapType>(Handle<HeapType> type);
HType HType::FromValue(Handle<Object> value) {
if (value->IsSmi()) return HType::Smi();
if (value->IsNull()) return HType::Null();
- if (value->IsHeapNumber()) return HType::HeapNumber();
+ if (value->IsHeapNumber()) {
+ double n = Handle<v8::internal::HeapNumber>::cast(value)->value();
+ return IsSmiDouble(n) ? HType::Smi() : HType::HeapNumber();
+ }
if (value->IsString()) return HType::String();
if (value->IsBoolean()) return HType::Boolean();
if (value->IsUndefined()) return HType::Undefined();
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | test/mjsunit/regress/regress-crbug-412215.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698