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

Unified Diff: runtime/vm/object.h

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/dart_api_impl_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 84573dd74838202957876db183d3513ade50aff2..b188d6cf8842254ba95e03f8703cb4f91cdc09dc 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -6465,6 +6465,11 @@ class Integer : public Number {
// Returns 0, -1 or 1.
virtual int CompareWith(const Integer& other) const;
+ // Converts integer to hex string.
+ // TODO(alexmarkov): this method can become non-virtual once Bigint class is
+ // decoupled from Integer hierarchy.
+ virtual const char* ToHexCString(Zone* zone) const;
+
// Return the most compact presentation of an integer.
RawInteger* AsValidInteger() const;
@@ -6622,6 +6627,8 @@ class Bigint : public Integer {
virtual int CompareWith(const Integer& other) const;
+ virtual const char* ToHexCString(Zone* zone) const;
+
virtual bool CheckAndCanonicalizeFields(Thread* thread,
const char** error_str) const;
@@ -6650,7 +6657,6 @@ class Bigint : public Integer {
uint32_t DigitAt(intptr_t index) const;
const char* ToDecCString(Zone* zone) const;
- const char* ToHexCString(Zone* zone) const;
static const intptr_t kBitsPerDigit = 32; // Same as _Bigint._DIGIT_BITS
static const intptr_t kBytesPerDigit = 4;
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698