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

Unified Diff: runtime/vm/heap.h

Issue 18051007: - Revert r24564 and r24563 due to unexplained malloc corruption. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/gc_marker.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.h
===================================================================
--- runtime/vm/heap.h (revision 24564)
+++ runtime/vm/heap.h (working copy)
@@ -11,7 +11,6 @@
#include "vm/globals.h"
#include "vm/pages.h"
#include "vm/scavenger.h"
-#include "vm/weak_table.h"
namespace dart {
@@ -34,12 +33,6 @@
kCode,
};
- enum WeakSelector {
- kPeers = 0,
- kHashes,
- kNumWeakSelectors
- };
-
enum ApiCallbacks {
kIgnoreApiCallbacks,
kInvokeApiCallbacks
@@ -175,45 +168,17 @@
static const char* GCReasonToString(GCReason gc_reason);
- // Associate a peer with an object. A non-existent peer is equal to NULL.
- void SetPeer(RawObject* raw_obj, void* peer) {
- SetWeakEntry(raw_obj, kPeers, reinterpret_cast<intptr_t>(peer));
- }
- void* GetPeer(RawObject* raw_obj) const {
- return reinterpret_cast<void*>(GetWeakEntry(raw_obj, kPeers));
- }
- int64_t PeerCount() const;
+ // Associates a peer with an object. If an object has a peer, it is
+ // replaced. A value of NULL disassociate an object from its peer.
+ void SetPeer(RawObject* raw_obj, void* peer);
- // Associate an identity hashCode with an object. An non-existent hashCode
- // is equal to 0.
- void SetHash(RawObject* raw_obj, intptr_t hash) {
- SetWeakEntry(raw_obj, kHashes, hash);
- }
- intptr_t GetHash(RawObject* raw_obj) const {
- return GetWeakEntry(raw_obj, kHashes);
- }
- int64_t HashCount() const;
+ // Retrieves the peer associated with an object. Returns NULL if
+ // there is no association.
+ void* GetPeer(RawObject* raw_obj);
- // Used by the GC algorithms to propagate weak entries.
- intptr_t GetWeakEntry(RawObject* raw_obj, WeakSelector sel) const;
- void SetWeakEntry(RawObject* raw_obj, WeakSelector sel, intptr_t val);
+ // Returns the number of objects with a peer.
+ int64_t PeerCount() const;
- WeakTable* GetWeakTable(Space space, WeakSelector selector) const {
- if (space == kNew) {
- return new_weak_tables_[selector];
- }
- ASSERT(space ==kOld);
- return old_weak_tables_[selector];
- }
- void SetWeakTable(Space space, WeakSelector selector, WeakTable* value) {
- if (space == kNew) {
- new_weak_tables_[selector] = value;
- } else {
- ASSERT(space == kOld);
- old_weak_tables_[selector] = value;
- }
- }
-
// Stats collection.
void RecordTime(int id, int64_t micros) {
ASSERT((id >= 0) && (id < GCStats::kDataEntries));
@@ -281,9 +246,6 @@
Scavenger* new_space_;
PageSpace* old_space_;
- WeakTable* new_weak_tables_[kNumWeakSelectors];
- WeakTable* old_weak_tables_[kNumWeakSelectors];
-
// GC stats collection.
GCStats stats_;
« no previous file with comments | « runtime/vm/gc_marker.cc ('k') | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698