Commit 78d6550a authored by hpayer's avatar hpayer Committed by Commit bot

Remove whiteness witness from runtime.

BUG=561449
LOG=n

Review URL: https://codereview.chromium.org/1468313007

Cr-Commit-Position: refs/heads/master@{#32284}
parent 7ba6bb4e
...@@ -3037,20 +3037,12 @@ void DescriptorArray::Get(int descriptor_number, Descriptor* desc) { ...@@ -3037,20 +3037,12 @@ void DescriptorArray::Get(int descriptor_number, Descriptor* desc) {
} }
void DescriptorArray::Set(int descriptor_number, void DescriptorArray::SetDescriptor(int descriptor_number, Descriptor* desc) {
Descriptor* desc,
const WhitenessWitness&) {
// Range check. // Range check.
DCHECK(descriptor_number < number_of_descriptors()); DCHECK(descriptor_number < number_of_descriptors());
set(ToKeyIndex(descriptor_number), *desc->GetKey());
NoIncrementalWriteBarrierSet(this, set(ToValueIndex(descriptor_number), *desc->GetValue());
ToKeyIndex(descriptor_number), set(ToDetailsIndex(descriptor_number), desc->GetDetails().AsSmi());
*desc->GetKey());
NoIncrementalWriteBarrierSet(this,
ToValueIndex(descriptor_number),
*desc->GetValue());
NoIncrementalWriteBarrierSet(this, ToDetailsIndex(descriptor_number),
desc->GetDetails().AsSmi());
} }
...@@ -3091,19 +3083,6 @@ void DescriptorArray::SwapSortedKeys(int first, int second) { ...@@ -3091,19 +3083,6 @@ void DescriptorArray::SwapSortedKeys(int first, int second) {
} }
DescriptorArray::WhitenessWitness::WhitenessWitness(DescriptorArray* array)
: marking_(array->GetHeap()->incremental_marking()) {
marking_->EnterNoMarkingScope();
DCHECK(!marking_->IsMarking() ||
Marking::Color(array) == Marking::WHITE_OBJECT);
}
DescriptorArray::WhitenessWitness::~WhitenessWitness() {
marking_->LeaveNoMarkingScope();
}
PropertyType DescriptorArray::Entry::type() { return descs_->GetType(index_); } PropertyType DescriptorArray::Entry::type() { return descs_->GetType(index_); }
......
...@@ -9085,7 +9085,6 @@ Handle<DescriptorArray> DescriptorArray::CopyUpToAddAttributes( ...@@ -9085,7 +9085,6 @@ Handle<DescriptorArray> DescriptorArray::CopyUpToAddAttributes(
Handle<DescriptorArray> descriptors = Handle<DescriptorArray> descriptors =
DescriptorArray::Allocate(desc->GetIsolate(), size, slack); DescriptorArray::Allocate(desc->GetIsolate(), size, slack);
DescriptorArray::WhitenessWitness witness(*descriptors);
if (attributes != NONE) { if (attributes != NONE) {
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
...@@ -9104,11 +9103,11 @@ Handle<DescriptorArray> DescriptorArray::CopyUpToAddAttributes( ...@@ -9104,11 +9103,11 @@ Handle<DescriptorArray> DescriptorArray::CopyUpToAddAttributes(
} }
Descriptor inner_desc( Descriptor inner_desc(
handle(key), handle(value, desc->GetIsolate()), details); handle(key), handle(value, desc->GetIsolate()), details);
descriptors->Set(i, &inner_desc, witness); descriptors->SetDescriptor(i, &inner_desc);
} }
} else { } else {
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
descriptors->CopyFrom(i, *desc, witness); descriptors->CopyFrom(i, *desc);
} }
} }
...@@ -9867,21 +9866,16 @@ void DescriptorArray::SetEnumCache(Handle<DescriptorArray> descriptors, ...@@ -9867,21 +9866,16 @@ void DescriptorArray::SetEnumCache(Handle<DescriptorArray> descriptors,
} }
void DescriptorArray::CopyFrom(int index, DescriptorArray* src, void DescriptorArray::CopyFrom(int index, DescriptorArray* src) {
const WhitenessWitness& witness) {
Object* value = src->GetValue(index); Object* value = src->GetValue(index);
PropertyDetails details = src->GetDetails(index); PropertyDetails details = src->GetDetails(index);
Descriptor desc(handle(src->GetKey(index)), Descriptor desc(handle(src->GetKey(index)),
handle(value, src->GetIsolate()), handle(value, src->GetIsolate()),
details); details);
Set(index, &desc, witness); SetDescriptor(index, &desc);
} }
// We need the whiteness witness since sort will reshuffle the entries in the
// descriptor array. If the descriptor array were to be black, the shuffling
// would move a slot that was already recorded as pointing into an evacuation
// candidate. This would result in missing updates upon evacuation.
void DescriptorArray::Sort() { void DescriptorArray::Sort() {
// In-place heap sort. // In-place heap sort.
int len = number_of_descriptors(); int len = number_of_descriptors();
......
...@@ -2972,23 +2972,6 @@ class DescriptorArray: public FixedArray { ...@@ -2972,23 +2972,6 @@ class DescriptorArray: public FixedArray {
} }
private: private:
// WhitenessWitness is used to prove that a descriptor array is white
// (unmarked), so incremental write barriers can be skipped because the
// marking invariant cannot be broken and slots pointing into evacuation
// candidates will be discovered when the object is scanned. A witness is
// always stack-allocated right after creating an array. By allocating a
// witness, incremental marking is globally disabled. The witness is then
// passed along wherever needed to statically prove that the array is known to
// be white.
class WhitenessWitness {
public:
inline explicit WhitenessWitness(DescriptorArray* array);
inline ~WhitenessWitness();
private:
IncrementalMarking* marking_;
};
// An entry in a DescriptorArray, represented as an (array, index) pair. // An entry in a DescriptorArray, represented as an (array, index) pair.
class Entry { class Entry {
public: public:
...@@ -3024,11 +3007,9 @@ class DescriptorArray: public FixedArray { ...@@ -3024,11 +3007,9 @@ class DescriptorArray: public FixedArray {
// Transfer a complete descriptor from the src descriptor array to this // Transfer a complete descriptor from the src descriptor array to this
// descriptor array. // descriptor array.
void CopyFrom(int index, DescriptorArray* src, const WhitenessWitness&); void CopyFrom(int index, DescriptorArray* src);
inline void Set(int descriptor_number, inline void SetDescriptor(int descriptor_number, Descriptor* desc);
Descriptor* desc,
const WhitenessWitness&);
// Swap first and second descriptor. // Swap first and second descriptor.
inline void SwapSortedKeys(int first, int second); inline void SwapSortedKeys(int first, int second);
......
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