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) {
kWeakHeapObjectTag);
}
V8_INLINE static bool IsClearedWeakHeapObject(MaybeObject* value) {
V8_INLINE static bool IsClearedWeakHeapObject(const MaybeObject* value) {
return reinterpret_cast<intptr_t>(value) == kClearedWeakHeapObject;
}
......
......@@ -24,7 +24,7 @@ Smi* MaybeObject::ToSmi() {
return Smi::cast(reinterpret_cast<Object*>(this));
}
bool MaybeObject::IsStrongOrWeakHeapObject() {
bool MaybeObject::IsStrongOrWeakHeapObject() const {
if (IsSmi() || IsClearedWeakHeapObject()) {
return false;
}
......@@ -51,7 +51,7 @@ bool MaybeObject::ToStrongOrWeakHeapObject(
return true;
}
bool MaybeObject::IsStrongHeapObject() {
bool MaybeObject::IsStrongHeapObject() const {
return !HasWeakHeapObjectTag(this) && !IsSmi();
}
......@@ -68,11 +68,11 @@ HeapObject* MaybeObject::ToStrongHeapObject() {
return reinterpret_cast<HeapObject*>(this);
}
bool MaybeObject::IsWeakHeapObject() {
bool MaybeObject::IsWeakHeapObject() const {
return HasWeakHeapObjectTag(this) && !IsClearedWeakHeapObject();
}
bool MaybeObject::IsWeakOrClearedHeapObject() {
bool MaybeObject::IsWeakOrClearedHeapObject() const {
return HasWeakHeapObjectTag(this);
}
......@@ -102,7 +102,7 @@ Object* MaybeObject::GetHeapObjectOrSmi() {
return GetHeapObject();
}
bool MaybeObject::IsObject() { return IsSmi() || IsStrongHeapObject(); }
bool MaybeObject::IsObject() const { return IsSmi() || IsStrongHeapObject(); }
Object* MaybeObject::ToObject() {
DCHECK(!HasWeakHeapObjectTag(this));
......
......@@ -25,19 +25,19 @@ class MaybeObject {
inline bool ToSmi(Smi** value);
inline Smi* ToSmi();
bool IsClearedWeakHeapObject() {
bool IsClearedWeakHeapObject() const {
return ::v8::internal::IsClearedWeakHeapObject(this);
}
inline bool IsStrongOrWeakHeapObject();
inline bool IsStrongOrWeakHeapObject() const;
inline bool ToStrongOrWeakHeapObject(HeapObject** result);
inline bool ToStrongOrWeakHeapObject(HeapObject** result,
HeapObjectReferenceType* reference_type);
inline bool IsStrongHeapObject();
inline bool IsStrongHeapObject() const;
inline bool ToStrongHeapObject(HeapObject** result);
inline HeapObject* ToStrongHeapObject();
inline bool IsWeakHeapObject();
inline bool IsWeakOrClearedHeapObject();
inline bool IsWeakHeapObject() const;
inline bool IsWeakOrClearedHeapObject() const;
inline bool ToWeakHeapObject(HeapObject** result);
inline HeapObject* ToWeakHeapObject();
......@@ -45,7 +45,7 @@ class MaybeObject {
inline HeapObject* GetHeapObject();
inline Object* GetHeapObjectOrSmi();
inline bool IsObject();
inline bool IsObject() const;
inline Object* ToObject();
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