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

Unified Diff: runtime/vm/object.cc

Issue 2985423002: [vm] Revise Dart_IntegerToHexCString to avoid dependency on Bigint, v.2 (Closed)
Patch Set: 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 2cac9f950c190b2a57177b881cffb6db21bb2538..d1b188a1065a65122be9dafa4072899cb07673fc 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -18241,6 +18241,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%" PX64, static_cast<uint64_t>(-value));
+ } else {
+ return OS::SCreate(zone, "0x%" PX64, 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