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

Unified Diff: runtime/lib/typed_data.cc

Issue 14962008: Fix issue 5275: The VM must always generate the most compact form of an integer (Smi, Mint or Bigin… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
Index: runtime/lib/typed_data.cc
===================================================================
--- runtime/lib/typed_data.cc (revision 22813)
+++ runtime/lib/typed_data.cc (working copy)
@@ -258,10 +258,8 @@
Integer& result = Integer::Handle(); \
if (value > static_cast<uint64_t>(Mint::kMaxValue)) { \
result = BigintOperations::NewFromUint64(value); \
- } else if (value > static_cast<uint64_t>(Smi::kMaxValue)) { \
- result = Mint::New(value); \
} else { \
- result = Smi::New(value); \
+ result = Integer::New(value); \
} \
return result.raw(); \
} \
@@ -409,10 +407,8 @@
}
if (value > static_cast<uint64_t>(Mint::kMaxValue)) {
return BigintOperations::NewFromUint64(value);
- } else if (value > static_cast<uint64_t>(Smi::kMaxValue)) {
- return Mint::New(value);
}
- return Smi::New(value);
+ return Integer::New(value);
}

Powered by Google App Engine
This is Rietveld 408576698