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

Unified Diff: src/objects-inl.h

Issue 10692185: Couple the enumeration index of a property to the size of the descriptor array where it first appea… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use the enumeration index of the LastAdded descriptor for appending. Created 8 years, 5 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
« no previous file with comments | « src/objects.cc ('k') | src/property.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index fbb0183815083b93fe410b498c968372f7f71df4..4a7f8a4a602842bb049c1b32e94945e64a9cfa8e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2095,6 +2095,7 @@ void DescriptorArray::Set(int descriptor_number,
const WhitenessWitness&) {
// Range check.
ASSERT(descriptor_number < number_of_descriptors());
+ ASSERT(desc->GetDetails().index() <= number_of_descriptors());
ASSERT(desc->GetDetails().index() > 0);
NoIncrementalWriteBarrierSet(this,
@@ -2109,6 +2110,16 @@ void DescriptorArray::Set(int descriptor_number,
}
+void DescriptorArray::Append(Descriptor* desc,
+ const WhitenessWitness& witness) {
+ int descriptor_number = NumberOfSetDescriptors();
+ int enumeration_index = descriptor_number + 1;
+ desc->SetEnumerationIndex(enumeration_index);
+ Set(descriptor_number, desc, witness);
+ SetLastAdded(descriptor_number);
+}
+
+
void DescriptorArray::NoIncrementalWriteBarrierSwapDescriptors(
int first, int second) {
NoIncrementalWriteBarrierSwap(this, ToKeyIndex(first), ToKeyIndex(second));
« no previous file with comments | « src/objects.cc ('k') | src/property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698