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

Unified Diff: runtime/vm/dart_api_impl.h

Issue 10915015: Make fewer assumptions about the layout of api handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.h
===================================================================
--- runtime/vm/dart_api_impl.h (revision 11638)
+++ 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.
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;
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698