Commit 7cc1d19b authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[in-place weak refs] Mark suitable MaybeObject funcs const

BUG=v8:7308

Change-Id: Id05fe2480d7cda8038740aaae949cc707686171f
Reviewed-on: https://chromium-review.googlesource.com/1174439Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55123}
parent 84fe9282
...@@ -1528,7 +1528,7 @@ V8_INLINE static bool HasWeakHeapObjectTag(const Object* value) { ...@@ -1528,7 +1528,7 @@ V8_INLINE static bool HasWeakHeapObjectTag(const Object* value) {
kWeakHeapObjectTag); kWeakHeapObjectTag);
} }
V8_INLINE static bool IsClearedWeakHeapObject(MaybeObject* value) { V8_INLINE static bool IsClearedWeakHeapObject(const MaybeObject* value) {
return reinterpret_cast<intptr_t>(value) == kClearedWeakHeapObject; return reinterpret_cast<intptr_t>(value) == kClearedWeakHeapObject;
} }
......
...@@ -24,7 +24,7 @@ Smi* MaybeObject::ToSmi() { ...@@ -24,7 +24,7 @@ Smi* MaybeObject::ToSmi() {
return Smi::cast(reinterpret_cast<Object*>(this)); return Smi::cast(reinterpret_cast<Object*>(this));
} }
bool MaybeObject::IsStrongOrWeakHeapObject() { bool MaybeObject::IsStrongOrWeakHeapObject() const {
if (IsSmi() || IsClearedWeakHeapObject()) { if (IsSmi() || IsClearedWeakHeapObject()) {
return false; return false;
} }
...@@ -51,7 +51,7 @@ bool MaybeObject::ToStrongOrWeakHeapObject( ...@@ -51,7 +51,7 @@ bool MaybeObject::ToStrongOrWeakHeapObject(
return true; return true;
} }
bool MaybeObject::IsStrongHeapObject() { bool MaybeObject::IsStrongHeapObject() const {
return !HasWeakHeapObjectTag(this) && !IsSmi(); return !HasWeakHeapObjectTag(this) && !IsSmi();
} }
...@@ -68,11 +68,11 @@ HeapObject* MaybeObject::ToStrongHeapObject() { ...@@ -68,11 +68,11 @@ HeapObject* MaybeObject::ToStrongHeapObject() {
return reinterpret_cast<HeapObject*>(this); return reinterpret_cast<HeapObject*>(this);
} }
bool MaybeObject::IsWeakHeapObject() { bool MaybeObject::IsWeakHeapObject() const {
return HasWeakHeapObjectTag(this) && !IsClearedWeakHeapObject(); return HasWeakHeapObjectTag(this) && !IsClearedWeakHeapObject();
} }
bool MaybeObject::IsWeakOrClearedHeapObject() { bool MaybeObject::IsWeakOrClearedHeapObject() const {
return HasWeakHeapObjectTag(this); return HasWeakHeapObjectTag(this);
} }
...@@ -102,7 +102,7 @@ Object* MaybeObject::GetHeapObjectOrSmi() { ...@@ -102,7 +102,7 @@ Object* MaybeObject::GetHeapObjectOrSmi() {
return GetHeapObject(); return GetHeapObject();
} }
bool MaybeObject::IsObject() { return IsSmi() || IsStrongHeapObject(); } bool MaybeObject::IsObject() const { return IsSmi() || IsStrongHeapObject(); }
Object* MaybeObject::ToObject() { Object* MaybeObject::ToObject() {
DCHECK(!HasWeakHeapObjectTag(this)); DCHECK(!HasWeakHeapObjectTag(this));
......
...@@ -25,19 +25,19 @@ class MaybeObject { ...@@ -25,19 +25,19 @@ class MaybeObject {
inline bool ToSmi(Smi** value); inline bool ToSmi(Smi** value);
inline Smi* ToSmi(); inline Smi* ToSmi();
bool IsClearedWeakHeapObject() { bool IsClearedWeakHeapObject() const {
return ::v8::internal::IsClearedWeakHeapObject(this); return ::v8::internal::IsClearedWeakHeapObject(this);
} }
inline bool IsStrongOrWeakHeapObject(); inline bool IsStrongOrWeakHeapObject() const;
inline bool ToStrongOrWeakHeapObject(HeapObject** result); inline bool ToStrongOrWeakHeapObject(HeapObject** result);
inline bool ToStrongOrWeakHeapObject(HeapObject** result, inline bool ToStrongOrWeakHeapObject(HeapObject** result,
HeapObjectReferenceType* reference_type); HeapObjectReferenceType* reference_type);
inline bool IsStrongHeapObject(); inline bool IsStrongHeapObject() const;
inline bool ToStrongHeapObject(HeapObject** result); inline bool ToStrongHeapObject(HeapObject** result);
inline HeapObject* ToStrongHeapObject(); inline HeapObject* ToStrongHeapObject();
inline bool IsWeakHeapObject(); inline bool IsWeakHeapObject() const;
inline bool IsWeakOrClearedHeapObject(); inline bool IsWeakOrClearedHeapObject() const;
inline bool ToWeakHeapObject(HeapObject** result); inline bool ToWeakHeapObject(HeapObject** result);
inline HeapObject* ToWeakHeapObject(); inline HeapObject* ToWeakHeapObject();
...@@ -45,7 +45,7 @@ class MaybeObject { ...@@ -45,7 +45,7 @@ class MaybeObject {
inline HeapObject* GetHeapObject(); inline HeapObject* GetHeapObject();
inline Object* GetHeapObjectOrSmi(); inline Object* GetHeapObjectOrSmi();
inline bool IsObject(); inline bool IsObject() const;
inline Object* ToObject(); inline Object* ToObject();
static MaybeObject* FromSmi(Smi* smi) { static MaybeObject* FromSmi(Smi* smi) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment