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

Side by Side Diff: src/transitions-inl.h

Issue 11093026: Reapply descriptor array sharing. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: fix long line Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/transitions.cc ('k') | src/version.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 void TransitionArray::set_elements_transition(Map* transition_map, 76 void TransitionArray::set_elements_transition(Map* transition_map,
77 WriteBarrierMode mode) { 77 WriteBarrierMode mode) {
78 Heap* heap = GetHeap(); 78 Heap* heap = GetHeap();
79 WRITE_FIELD(this, kElementsTransitionOffset, transition_map); 79 WRITE_FIELD(this, kElementsTransitionOffset, transition_map);
80 CONDITIONAL_WRITE_BARRIER( 80 CONDITIONAL_WRITE_BARRIER(
81 heap, this, kElementsTransitionOffset, transition_map, mode); 81 heap, this, kElementsTransitionOffset, transition_map, mode);
82 } 82 }
83 83
84 84
85 DescriptorArray* TransitionArray::descriptors() { 85 DescriptorArray* TransitionArray::descriptors() {
86 return DescriptorArray::cast(get(kDescriptorsIndex)); 86 return DescriptorArray::cast(descriptors_pointer()->value());
87 } 87 }
88 88
89 89
90 void TransitionArray::set_descriptors(DescriptorArray* descriptors, 90 void TransitionArray::set_descriptors(DescriptorArray* descriptors) {
91 WriteBarrierMode mode) { 91 ASSERT(!this->descriptors()->IsDescriptorArray() ||
92 Heap* heap = GetHeap(); 92 descriptors->number_of_descriptors() == 0 ||
93 WRITE_FIELD(this, kDescriptorsOffset, descriptors); 93 descriptors->HasEnumCache() ||
94 CONDITIONAL_WRITE_BARRIER( 94 !this->descriptors()->HasEnumCache());
95 heap, this, kDescriptorsOffset, descriptors, mode); 95 descriptors_pointer()->set_value(descriptors);
96 } 96 }
97 97
98 98
99 Object** TransitionArray::GetDescriptorsSlot() { 99 JSGlobalPropertyCell* TransitionArray::descriptors_pointer() {
100 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), 100 return JSGlobalPropertyCell::cast(get(kDescriptorsPointerIndex));
101 kDescriptorsOffset);
102 } 101 }
103 102
104 103
104 void TransitionArray::set_descriptors_pointer(JSGlobalPropertyCell* pointer) {
105 set(kDescriptorsPointerIndex, pointer);
106 }
107
108
105 Object* TransitionArray::back_pointer_storage() { 109 Object* TransitionArray::back_pointer_storage() {
106 return get(kBackPointerStorageIndex); 110 return get(kBackPointerStorageIndex);
107 } 111 }
108 112
109 113
110 void TransitionArray::set_back_pointer_storage(Object* back_pointer, 114 void TransitionArray::set_back_pointer_storage(Object* back_pointer,
111 WriteBarrierMode mode) { 115 WriteBarrierMode mode) {
112 Heap* heap = GetHeap(); 116 Heap* heap = GetHeap();
113 WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer); 117 WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer);
114 CONDITIONAL_WRITE_BARRIER( 118 CONDITIONAL_WRITE_BARRIER(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 189
186 PropertyDetails TransitionArray::GetTargetDetails(int transition_number) { 190 PropertyDetails TransitionArray::GetTargetDetails(int transition_number) {
187 Map* map = GetTarget(transition_number); 191 Map* map = GetTarget(transition_number);
188 DescriptorArray* descriptors = map->instance_descriptors(); 192 DescriptorArray* descriptors = map->instance_descriptors();
189 int descriptor = map->LastAdded(); 193 int descriptor = map->LastAdded();
190 return descriptors->GetDetails(descriptor); 194 return descriptors->GetDetails(descriptor);
191 } 195 }
192 196
193 197
194 int TransitionArray::Search(String* name) { 198 int TransitionArray::Search(String* name) {
195 return internal::Search(this, name); 199 return internal::Search<ALL_ENTRIES>(this, name);
196 } 200 }
197 201
198 202
199 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number, 203 void TransitionArray::NoIncrementalWriteBarrierSet(int transition_number,
200 String* key, 204 String* key,
201 Map* target) { 205 Map* target) {
202 FixedArray::NoIncrementalWriteBarrierSet( 206 FixedArray::NoIncrementalWriteBarrierSet(
203 this, ToKeyIndex(transition_number), key); 207 this, ToKeyIndex(transition_number), key);
204 FixedArray::NoIncrementalWriteBarrierSet( 208 FixedArray::NoIncrementalWriteBarrierSet(
205 this, ToTargetIndex(transition_number), target); 209 this, ToTargetIndex(transition_number), target);
206 } 210 }
207 211
208 212
209 #undef FIELD_ADDR 213 #undef FIELD_ADDR
210 #undef WRITE_FIELD 214 #undef WRITE_FIELD
211 #undef CONDITIONAL_WRITE_BARRIER 215 #undef CONDITIONAL_WRITE_BARRIER
212 216
213 217
214 } } // namespace v8::internal 218 } } // namespace v8::internal
215 219
216 #endif // V8_TRANSITIONS_INL_H_ 220 #endif // V8_TRANSITIONS_INL_H_
OLDNEW
« no previous file with comments | « src/transitions.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698