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

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

Issue 11099064: Remove descriptors pointer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nits 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/x64/macro-assembler-x64.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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void TransitionArray::set_elements_transition(Map* transition_map, 77 void TransitionArray::set_elements_transition(Map* transition_map,
78 WriteBarrierMode mode) { 78 WriteBarrierMode mode) {
79 ASSERT(IsFullTransitionArray()); 79 ASSERT(IsFullTransitionArray());
80 Heap* heap = GetHeap(); 80 Heap* heap = GetHeap();
81 WRITE_FIELD(this, kElementsTransitionOffset, transition_map); 81 WRITE_FIELD(this, kElementsTransitionOffset, transition_map);
82 CONDITIONAL_WRITE_BARRIER( 82 CONDITIONAL_WRITE_BARRIER(
83 heap, this, kElementsTransitionOffset, transition_map, mode); 83 heap, this, kElementsTransitionOffset, transition_map, mode);
84 } 84 }
85 85
86 86
87 Object** TransitionArray::GetDescriptorsSlot() {
88 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this),
89 kDescriptorsOffset);
90 }
91
92
87 DescriptorArray* TransitionArray::descriptors() { 93 DescriptorArray* TransitionArray::descriptors() {
88 return DescriptorArray::cast(descriptors_pointer()->value()); 94 return DescriptorArray::cast(get(kDescriptorsIndex));
89 } 95 }
90 96
91 97
92 void TransitionArray::set_descriptors(DescriptorArray* descriptors) { 98 void TransitionArray::set_descriptors(DescriptorArray* descriptors) {
93 ASSERT(!this->descriptors()->IsDescriptorArray() || 99 ASSERT(descriptors->IsDescriptorArray());
94 descriptors->number_of_descriptors() == 0 || 100 set(kDescriptorsIndex, descriptors);
95 descriptors->HasEnumCache() ||
96 !this->descriptors()->HasEnumCache());
97 descriptors_pointer()->set_value(descriptors);
98 } 101 }
99 102
100 103
101 JSGlobalPropertyCell* TransitionArray::descriptors_pointer() {
102 return JSGlobalPropertyCell::cast(get(kDescriptorsPointerIndex));
103 }
104
105
106 void TransitionArray::set_descriptors_pointer(JSGlobalPropertyCell* pointer) {
107 set(kDescriptorsPointerIndex, pointer);
108 }
109
110
111 Object* TransitionArray::back_pointer_storage() { 104 Object* TransitionArray::back_pointer_storage() {
112 return get(kBackPointerStorageIndex); 105 return get(kBackPointerStorageIndex);
113 } 106 }
114 107
115 108
116 void TransitionArray::set_back_pointer_storage(Object* back_pointer, 109 void TransitionArray::set_back_pointer_storage(Object* back_pointer,
117 WriteBarrierMode mode) { 110 WriteBarrierMode mode) {
118 Heap* heap = GetHeap(); 111 Heap* heap = GetHeap();
119 WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer); 112 WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer);
120 CONDITIONAL_WRITE_BARRIER( 113 CONDITIONAL_WRITE_BARRIER(
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 223
231 224
232 #undef FIELD_ADDR 225 #undef FIELD_ADDR
233 #undef WRITE_FIELD 226 #undef WRITE_FIELD
234 #undef CONDITIONAL_WRITE_BARRIER 227 #undef CONDITIONAL_WRITE_BARRIER
235 228
236 229
237 } } // namespace v8::internal 230 } } // namespace v8::internal
238 231
239 #endif // V8_TRANSITIONS_INL_H_ 232 #endif // V8_TRANSITIONS_INL_H_
OLDNEW
« no previous file with comments | « src/transitions.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698