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

Unified Diff: src/objects-inl.h

Issue 10800033: Append to descriptors over map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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.h ('k') | no next file » | 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 e48787b03856d7e24a6cd8e496f525d0bab94a29..d4f27dedf7ba1eaeef693abd703e0f6909843724 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2110,9 +2110,10 @@ void DescriptorArray::Set(int descriptor_number,
}
-void DescriptorArray::Append(Descriptor* desc,
- const WhitenessWitness& witness) {
- int descriptor_number = NumberOfSetDescriptors();
+int DescriptorArray::Append(Descriptor* desc,
+ const WhitenessWitness& witness,
+ int number_of_set_descriptors) {
+ int descriptor_number = number_of_set_descriptors;
int enumeration_index = descriptor_number + 1;
desc->SetEnumerationIndex(enumeration_index);
@@ -2128,7 +2129,7 @@ void DescriptorArray::Append(Descriptor* desc,
}
Set(descriptor_number, desc, witness);
- SetLastAdded(descriptor_number);
+ return descriptor_number;
}
@@ -3554,6 +3555,14 @@ void Map::ClearDescriptorArray(Heap* heap, WriteBarrierMode mode) {
}
+void Map::AppendDescriptor(Descriptor* desc,
+ const DescriptorArray::WhitenessWitness& witness) {
+ DescriptorArray* descriptors = instance_descriptors();
+ int set_descriptors = descriptors->NumberOfSetDescriptors();
+ int new_last_added = descriptors->Append(desc, witness, set_descriptors);
+ descriptors->SetLastAdded(new_last_added);
+}
+
Object* Map::GetBackPointer() {
Object* object = READ_FIELD(this, kInstanceDescriptorsOrBackPointerOffset);
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698