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

Unified Diff: src/objects.h

Issue 893073006: Add map-based read barrier to WeakCell Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index d1e5acff893d65b008606969db7241a873602656..899a31ab3287667470836f978d2fadbdff8f56d2 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2602,7 +2602,7 @@ class WeakFixedArray : public FixedArray {
void Remove(Handle<HeapObject> value);
- inline Object* Get(int index) const;
+ inline Object* Get(Heap* heap, int index) const;
inline int Length() const;
DECLARE_CAST(WeakFixedArray)
@@ -2616,6 +2616,7 @@ class WeakFixedArray : public FixedArray {
static void Set(Handle<WeakFixedArray> array, int index,
Handle<HeapObject> value);
+ inline bool EqualAt(int index, Object* object) const;
inline void clear(int index);
inline bool IsEmptySlot(int index) const;
@@ -9762,7 +9763,8 @@ class PropertyCell: public Cell {
class WeakCell : public HeapObject {
public:
- inline Object* value() const;
+ inline Object* value(Heap* heap);
+ inline Object* ValueNoReadBarrier();
// This should not be called by anyone except GC.
inline void clear();
@@ -9780,11 +9782,16 @@ class WeakCell : public HeapObject {
DECLARE_VERIFIER(WeakCell)
// Layout description.
- static const int kValueOffset = HeapObject::kHeaderSize;
- static const int kNextOffset = kValueOffset + kPointerSize;
+ static const int kValueOffsetDontForgetTheReadBarrier =
+ HeapObject::kHeaderSize;
+ static const int kNextOffset =
+ kValueOffsetDontForgetTheReadBarrier + kPointerSize;
static const int kSize = kNextOffset + kPointerSize;
- typedef FixedBodyDescriptor<kValueOffset, kSize, kSize> BodyDescriptor;
+ static inline void TriggerReadBarrier(Object* possible_weak_cell);
+
+ typedef FixedBodyDescriptor<kValueOffsetDontForgetTheReadBarrier, kSize,
+ kSize> BodyDescriptor;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(WeakCell);

Powered by Google App Engine
This is Rietveld 408576698