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

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

Issue 10816005: Swapped transition array and descriptor array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments, and updated additional code comments. Created 8 years, 4 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
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
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() {
86 return DescriptorArray::cast(get(kDescriptorsIndex));
87 }
88
89
90 void TransitionArray::set_descriptors(DescriptorArray* descriptors,
91 WriteBarrierMode mode) {
92 Heap* heap = GetHeap();
93 WRITE_FIELD(this, kDescriptorsOffset, descriptors);
94 CONDITIONAL_WRITE_BARRIER(
95 heap, this, kDescriptorsOffset, descriptors, mode);
96 }
97
98
99 Object** TransitionArray::GetDescriptorsSlot() {
100 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this),
101 kDescriptorsOffset);
102 }
103
104
105 Object* TransitionArray::back_pointer_storage() {
106 return get(kBackPointerStorageIndex);
107 }
108
109
110 void TransitionArray::set_back_pointer_storage(Object* back_pointer,
111 WriteBarrierMode mode) {
112 Heap* heap = GetHeap();
113 WRITE_FIELD(this, kBackPointerStorageOffset, back_pointer);
114 CONDITIONAL_WRITE_BARRIER(
115 heap, this, kBackPointerStorageOffset, back_pointer, mode);
116 }
117
118
85 bool TransitionArray::HasPrototypeTransitions() { 119 bool TransitionArray::HasPrototypeTransitions() {
86 Object* prototype_transitions = get(kPrototypeTransitionsIndex); 120 Object* prototype_transitions = get(kPrototypeTransitionsIndex);
87 return prototype_transitions != Smi::FromInt(0); 121 return prototype_transitions != Smi::FromInt(0);
88 } 122 }
89 123
90 124
91 FixedArray* TransitionArray::GetPrototypeTransitions() { 125 FixedArray* TransitionArray::GetPrototypeTransitions() {
92 Object* prototype_transitions = get(kPrototypeTransitionsIndex); 126 Object* prototype_transitions = get(kPrototypeTransitionsIndex);
93 return FixedArray::cast(prototype_transitions); 127 return FixedArray::cast(prototype_transitions);
94 } 128 }
95 129
96 130
97 HeapObject* TransitionArray::UncheckedPrototypeTransitions() { 131 HeapObject* TransitionArray::UncheckedPrototypeTransitions() {
98 Object* prototype_transitions = get(kPrototypeTransitionsIndex); 132 ASSERT(HasPrototypeTransitions());
99 if (prototype_transitions == Smi::FromInt(0)) return NULL; 133 return reinterpret_cast<HeapObject*>(get(kPrototypeTransitionsIndex));
100 return reinterpret_cast<HeapObject*>(prototype_transitions);
101 } 134 }
102 135
103 136
104 void TransitionArray::SetPrototypeTransitions(FixedArray* transitions, 137 void TransitionArray::SetPrototypeTransitions(FixedArray* transitions,
105 WriteBarrierMode mode) { 138 WriteBarrierMode mode) {
106 ASSERT(this != NULL); 139 ASSERT(this != NULL);
107 ASSERT(transitions->IsFixedArray()); 140 ASSERT(transitions->IsFixedArray());
108 Heap* heap = GetHeap(); 141 Heap* heap = GetHeap();
109 WRITE_FIELD(this, kPrototypeTransitionsOffset, transitions); 142 WRITE_FIELD(this, kPrototypeTransitionsOffset, transitions);
110 CONDITIONAL_WRITE_BARRIER( 143 CONDITIONAL_WRITE_BARRIER(
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 211
179 212
180 #undef FIELD_ADDR 213 #undef FIELD_ADDR
181 #undef WRITE_FIELD 214 #undef WRITE_FIELD
182 #undef CONDITIONAL_WRITE_BARRIER 215 #undef CONDITIONAL_WRITE_BARRIER
183 216
184 217
185 } } // namespace v8::internal 218 } } // namespace v8::internal
186 219
187 #endif // V8_TRANSITIONS_INL_H_ 220 #endif // V8_TRANSITIONS_INL_H_
OLDNEW
« src/bootstrapper.cc ('K') | « 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