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

Unified Diff: src/transitions-inl.h

Issue 10909007: Sharing of descriptor arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 8 years, 3 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/transitions.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/transitions-inl.h
diff --git a/src/transitions-inl.h b/src/transitions-inl.h
index 385bdd11998526d5e7b6ff6b516d70db0a5baaf5..fd97ad25ab57d3946245b9e40c618083e2cbd1c4 100644
--- a/src/transitions-inl.h
+++ b/src/transitions-inl.h
@@ -83,22 +83,26 @@ void TransitionArray::set_elements_transition(Map* transition_map,
DescriptorArray* TransitionArray::descriptors() {
- return DescriptorArray::cast(get(kDescriptorsIndex));
+ return DescriptorArray::cast(descriptors_pointer()->value());
}
-void TransitionArray::set_descriptors(DescriptorArray* descriptors,
- WriteBarrierMode mode) {
- Heap* heap = GetHeap();
- WRITE_FIELD(this, kDescriptorsOffset, descriptors);
- CONDITIONAL_WRITE_BARRIER(
- heap, this, kDescriptorsOffset, descriptors, mode);
+void TransitionArray::set_descriptors(DescriptorArray* descriptors) {
+ ASSERT(!this->descriptors()->IsDescriptorArray() ||
+ descriptors->number_of_descriptors() == 0 ||
+ descriptors->HasEnumCache() ||
+ !this->descriptors()->HasEnumCache());
+ descriptors_pointer()->set_value(descriptors);
}
-Object** TransitionArray::GetDescriptorsSlot() {
- return HeapObject::RawField(reinterpret_cast<HeapObject*>(this),
- kDescriptorsOffset);
+JSGlobalPropertyCell* TransitionArray::descriptors_pointer() {
+ return JSGlobalPropertyCell::cast(get(kDescriptorsPointerIndex));
+}
+
+
+void TransitionArray::set_descriptors_pointer(JSGlobalPropertyCell* pointer) {
+ set(kDescriptorsPointerIndex, pointer);
}
@@ -192,7 +196,7 @@ PropertyDetails TransitionArray::GetTargetDetails(int transition_number) {
int TransitionArray::Search(String* name) {
- return internal::Search(this, name);
+ return internal::Search<ALL_ENTRIES>(this, name);
}
« no previous file with comments | « src/transitions.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698