| Index: runtime/bin/dartutils.h
|
| ===================================================================
|
| --- runtime/bin/dartutils.h (revision 39937)
|
| +++ runtime/bin/dartutils.h (working copy)
|
| @@ -268,12 +268,14 @@
|
| static Dart_CObject* NewInt32(int32_t value);
|
| static Dart_CObject* NewInt64(int64_t value);
|
| static Dart_CObject* NewIntptr(intptr_t value);
|
| - // TODO(sgjesse): Add support for kBigint.
|
| + static Dart_CObject* NewBigint(const char* hex_value);
|
| + static char* BigintToHexValue(Dart_CObject* bigint);
|
| static Dart_CObject* NewDouble(double value);
|
| static Dart_CObject* NewString(intptr_t length);
|
| static Dart_CObject* NewString(const char* str);
|
| static Dart_CObject* NewArray(intptr_t length);
|
| static Dart_CObject* NewUint8Array(intptr_t length);
|
| + static Dart_CObject* NewUint32Array(intptr_t length);
|
| static Dart_CObject* NewExternalUint8Array(
|
| intptr_t length, uint8_t* data, void* peer,
|
| Dart_WeakPersistentHandleFinalizer callback);
|
| @@ -418,9 +420,20 @@
|
| public:
|
| DECLARE_COBJECT_CONSTRUCTORS(Bigint)
|
|
|
| - char* Value() const { return cobject_->value.as_bigint; }
|
| + char* Value() {
|
| + if (hex_value_ == NULL) {
|
| + hex_value_ = BigintToHexValue(cobject_);
|
| + }
|
| + ASSERT(hex_value_ != NULL);
|
| + return hex_value_;
|
| + }
|
|
|
| + ~CObjectBigint() {
|
| + free(hex_value_);
|
| + }
|
| +
|
| private:
|
| + char* hex_value_;
|
| DISALLOW_COPY_AND_ASSIGN(CObjectBigint);
|
| };
|
|
|
|
|