| Index: runtime/vm/raw_object.h
|
| diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
|
| index 3f5a507d3a67dc74476be205e77057f4a596ccf5..296f21a682f6d12222ac1c28983c7e60d74337b6 100644
|
| --- a/runtime/vm/raw_object.h
|
| +++ b/runtime/vm/raw_object.h
|
| @@ -61,6 +61,7 @@ namespace dart {
|
| V(Smi) \
|
| V(Mint) \
|
| V(Bigint) \
|
| + V(Fraction) \
|
| V(Double) \
|
| V(Bool) \
|
| V(GrowableObjectArray) \
|
| @@ -1805,6 +1806,20 @@ class RawBigint : public RawInteger {
|
| };
|
|
|
|
|
| +class RawFraction : public RawNumber {
|
| + RAW_HEAP_OBJECT_IMPLEMENTATION(Fraction);
|
| +
|
| + RawObject** from() {
|
| + return reinterpret_cast<RawObject**>(&ptr()->numerator_);
|
| + }
|
| + RawInteger* numerator_;
|
| + RawInteger* denominator_;
|
| + RawObject** to() {
|
| + return reinterpret_cast<RawObject**>(&ptr()->denominator_);
|
| + }
|
| +};
|
| +
|
| +
|
| class RawDouble : public RawNumber {
|
| RAW_HEAP_OBJECT_IMPLEMENTATION(Double);
|
|
|
| @@ -2237,7 +2252,8 @@ inline bool RawObject::IsNumberClassId(intptr_t index) {
|
| kSmiCid == kNumberCid + 2 &&
|
| kMintCid == kNumberCid + 3 &&
|
| kBigintCid == kNumberCid + 4 &&
|
| - kDoubleCid == kNumberCid + 5);
|
| + kFractionCid == kNumberCid + 5 &&
|
| + kDoubleCid == kNumberCid + 6);
|
| return (index >= kNumberCid && index < kBoolCid);
|
| }
|
|
|
| @@ -2247,8 +2263,8 @@ inline bool RawObject::IsIntegerClassId(intptr_t index) {
|
| COMPILE_ASSERT(kSmiCid == kIntegerCid + 1 &&
|
| kMintCid == kIntegerCid + 2 &&
|
| kBigintCid == kIntegerCid + 3 &&
|
| - kDoubleCid == kIntegerCid + 4);
|
| - return (index >= kIntegerCid && index < kDoubleCid);
|
| + kFractionCid == kIntegerCid + 4);
|
| + return (index >= kIntegerCid && index < kFractionCid);
|
| }
|
|
|
|
|
| @@ -2416,7 +2432,7 @@ inline bool RawObject::IsVariableSizeClassId(intptr_t index) {
|
| // is defined by the VM but are used in the VM code by computing the
|
| // implicit field offsets of the various fields in the dart object.
|
| inline bool RawObject::IsImplicitFieldClassId(intptr_t index) {
|
| - return (IsTypedDataViewClassId(index) || index == kByteBufferCid);
|
| + return (IsTypedDataViewClassId(index) || (index == kByteBufferCid));
|
| }
|
|
|
|
|
|
|