Commit 0944553e authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

Global handles: Remove independent handle infrastructure

Bug: chromium:780749
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I4c993e2147494795402f141049eed30801dfb913
Reviewed-on: https://chromium-review.googlesource.com/782519Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49568}
parent cede838f
......@@ -9113,7 +9113,6 @@ class Internals {
static const int kNodeStateIsWeakValue = 2;
static const int kNodeStateIsPendingValue = 3;
static const int kNodeStateIsNearDeathValue = 4;
static const int kNodeIsIndependentShift = 3;
static const int kNodeIsActiveShift = 4;
static const int kFirstNonstringType = 0x80;
......@@ -9312,16 +9311,11 @@ void Persistent<T, M>::Copy(const Persistent<S, M2>& that) {
M::Copy(that, this);
}
template <class T>
bool PersistentBase<T>::IsIndependent() const {
typedef internal::Internals I;
if (this->IsEmpty()) return false;
return I::GetNodeFlag(reinterpret_cast<internal::Object**>(this->val_),
I::kNodeIsIndependentShift);
return true;
}
template <class T>
bool PersistentBase<T>::IsNearDeath() const {
typedef internal::Internals I;
......@@ -9402,13 +9396,7 @@ void PersistentBase<T>::RegisterExternalReference(Isolate* isolate) const {
}
template <class T>
void PersistentBase<T>::MarkIndependent() {
typedef internal::Internals I;
if (this->IsEmpty()) return;
I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_),
true,
I::kNodeIsIndependentShift);
}
void PersistentBase<T>::MarkIndependent() {}
template <class T>
void PersistentBase<T>::MarkActive() {
......
......@@ -41,8 +41,6 @@ class GlobalHandles::Node {
STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue);
STATIC_ASSERT(PENDING == Internals::kNodeStateIsPendingValue);
STATIC_ASSERT(NEAR_DEATH == Internals::kNodeStateIsNearDeathValue);
STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) ==
Internals::kNodeIsIndependentShift);
STATIC_ASSERT(static_cast<int>(IsActive::kShift) ==
Internals::kNodeIsActiveShift);
}
......@@ -54,7 +52,6 @@ class GlobalHandles::Node {
object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue);
class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
index_ = 0;
set_independent(false);
set_active(false);
set_in_new_space_list(false);
parameter_or_next_free_.next_free = nullptr;
......@@ -76,7 +73,6 @@ class GlobalHandles::Node {
DCHECK(state() == FREE);
object_ = object;
class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
set_independent(false);
set_active(false);
set_state(NORMAL);
parameter_or_next_free_.parameter = nullptr;
......@@ -96,7 +92,6 @@ class GlobalHandles::Node {
// Zap the values for eager trapping.
object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue);
class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
set_independent(false);
set_active(false);
weak_callback_ = nullptr;
DecreaseBlockUses();
......@@ -123,13 +118,6 @@ class GlobalHandles::Node {
flags_ = NodeState::update(flags_, state);
}
bool is_independent() {
return IsIndependent::decode(flags_);
}
void set_independent(bool v) {
flags_ = IsIndependent::update(flags_, v);
}
bool is_active() {
return IsActive::decode(flags_);
}
......@@ -194,12 +182,6 @@ class GlobalHandles::Node {
set_state(PENDING);
}
// Independent flag accessors.
void MarkIndependent() {
DCHECK(IsInUse());
set_independent(true);
}
// Callback parameter accessors.
void set_parameter(void* parameter) {
DCHECK(IsInUse());
......@@ -344,7 +326,7 @@ class GlobalHandles::Node {
// Placed first to avoid offset computation.
Object* object_;
// Next word stores class_id, index, state, and independent.
// Next word stores class_id, index, and state.
// Note: the most aligned fields should go first.
// Wrapper class ID.
......@@ -353,10 +335,7 @@ class GlobalHandles::Node {
// Index in the containing handle block.
uint8_t index_;
// This stores three flags (independent, partially_dependent and
// in_new_space_list) and a State.
class NodeState : public BitField<State, 0, 3> {};
class IsIndependent : public BitField<bool, 3, 1> {};
// The following two fields are mutually exclusive
class IsActive : public BitField<bool, 4, 1> {};
class IsInNewSpaceList : public BitField<bool, 5, 1> {};
......@@ -600,16 +579,6 @@ void* GlobalHandles::ClearWeakness(Object** location) {
return Node::FromLocation(location)->ClearWeakness();
}
void GlobalHandles::MarkIndependent(Object** location) {
Node::FromLocation(location)->MarkIndependent();
}
bool GlobalHandles::IsIndependent(Object** location) {
return Node::FromLocation(location)->is_independent();
}
bool GlobalHandles::IsNearDeath(Object** location) {
return Node::FromLocation(location)->IsNearDeath();
}
......
......@@ -97,11 +97,6 @@ class GlobalHandles {
// Clear the weakness of a global handle.
static void* ClearWeakness(Object** location);
// Mark the reference to this object independent.
static void MarkIndependent(Object** location);
static bool IsIndependent(Object** location);
// Tells whether global handle is near death.
static bool IsNearDeath(Object** location);
......@@ -158,8 +153,7 @@ class GlobalHandles {
void MarkNewSpaceWeakUnmodifiedObjectsPending(
WeakSlotCallbackWithHeap is_dead);
// Iterates over weak independent or unmodified handles.
// See the note above.
// Iterates over weak unmodified handles. See the note above.
void IterateNewSpaceWeakUnmodifiedRootsForFinalizers(RootVisitor* v);
void IterateNewSpaceWeakUnmodifiedRootsForPhantomHandles(
RootVisitor* v, WeakSlotCallbackWithHeap should_reset_handle);
......
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