Index: runtime/vm/dart_api_impl.h |
=================================================================== |
--- runtime/vm/dart_api_impl.h (revision 11628) |
+++ runtime/vm/dart_api_impl.h (working copy) |
@@ -113,17 +113,20 @@ |
// Returns true if the handle holds a Smi. |
static bool IsSmi(Dart_Handle handle) { |
+ // TODO(turnidge): Assumes RawObject* is at offset zero. Fix. |
cshapiro
2012/08/30 18:18:55
Is there a straight forward fix? Since the handle
turnidge
2012/08/30 18:24:30
I see us always forcing LocalHandle, PersistentHan
|
RawObject* raw = *(reinterpret_cast<RawObject**>(handle)); |
return !raw->IsHeapObject(); |
} |
// Returns the value of a Smi. |
static intptr_t SmiValue(Dart_Handle handle) { |
+ // TODO(turnidge): Assumes RawObject* is at offset zero. Fix. |
uword value = *(reinterpret_cast<uword*>(handle)); |
return Smi::ValueFromRaw(value); |
} |
static intptr_t ClassId(Dart_Handle handle) { |
+ // TODO(turnidge): Assumes RawObject* is at offset zero. Fix. |
RawObject* raw = *(reinterpret_cast<RawObject**>(handle)); |
if (!raw->IsHeapObject()) { |
return kSmiCid; |