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

Unified Diff: runtime/vm/object.cc

Issue 2987183002: [vm] Revise Dart_IntegerToHexCString to avoid dependency on Bigint (Closed)
Patch Set: Virtual methods grouped together Created 3 years, 5 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 | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index c5faed86ee98228f863825674ed14900e357236c..42775308757f8bf7bd14446a07ef7569ba056387 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -18238,6 +18238,16 @@ RawInteger* Integer::AsValidInteger() const {
return raw();
}
+const char* Integer::ToHexCString(Zone* zone) const {
+ ASSERT(IsSmi() || IsMint()); // Bigint has its own implementation.
+ int64_t value = AsInt64Value();
+ if (value < 0) {
+ return OS::SCreate(zone, "-0x%" PRIX64, static_cast<uint64_t>(-value));
zra 2017/08/01 16:21:57 We have some abbreviations for these here: https:
alexmarkov 2017/08/01 17:40:11 Introduced new short form specifier PX64, see http
+ } else {
+ return OS::SCreate(zone, "0x%" PRIX64, static_cast<uint64_t>(value));
+ }
+}
+
RawInteger* Integer::ArithmeticOp(Token::Kind operation,
const Integer& other,
Heap::Space space) const {
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698