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

Unified Diff: runtime/vm/dart_api_state.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 | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_state.h
===================================================================
--- runtime/vm/dart_api_state.h (revision 11638)
+++ runtime/vm/dart_api_state.h (working copy)
@@ -105,6 +105,7 @@
void set_raw(RawObject* ref) { raw_ = ref; }
void set_raw(const LocalHandle& ref) { raw_ = ref.raw(); }
void set_raw(const Object& object) { raw_ = object.raw(); }
+ RawObject** raw_addr() { return &raw_; }
static intptr_t raw_offset() { return OFFSET_OF(PersistentHandle, raw_); }
private:
@@ -141,6 +142,7 @@
void set_raw(RawObject* raw) { raw_ = raw; }
void set_raw(const LocalHandle& ref) { raw_ = ref.raw(); }
void set_raw(const Object& object) { raw_ = object.raw(); }
+ RawObject** raw_addr() { return &raw_; }
static intptr_t raw_offset() {
return OFFSET_OF(FinalizablePersistentHandle, raw_);
}
@@ -391,14 +393,14 @@
RawObject** get_key(intptr_t i) {
ASSERT(i >= 0);
ASSERT(i < num_keys_);
- return reinterpret_cast<RawObject**>(keys_[i]);
+ return (reinterpret_cast<PersistentHandle*>(keys_[i]))->raw_addr();
}
intptr_t num_values() const { return num_values_; }
RawObject** get_value(intptr_t i) {
ASSERT(i >= 0);
ASSERT(i < num_values_);
- return reinterpret_cast<RawObject**>(values_[i]);
+ return (reinterpret_cast<PersistentHandle*>(values_[i]))->raw_addr();
}
static WeakReferenceSet* Pop(WeakReferenceSet** queue) {
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698