OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 void VisitPointer(Object** o) { | 143 void VisitPointer(Object** o) { |
144 if ((*o)->IsFixedArray() && !inside_array_) { | 144 if ((*o)->IsFixedArray() && !inside_array_) { |
145 // Traverse one level deep for data members that are fixed arrays. | 145 // Traverse one level deep for data members that are fixed arrays. |
146 // This covers the case of 'elements' and 'properties' of JSObject, | 146 // This covers the case of 'elements' and 'properties' of JSObject, |
147 // and function contexts. | 147 // and function contexts. |
148 inside_array_ = true; | 148 inside_array_ = true; |
149 FixedArray::cast(*o)->Iterate(this); | 149 FixedArray::cast(*o)->Iterate(this); |
150 inside_array_ = false; | 150 inside_array_ = false; |
151 } else { | 151 } else if ((*o)->IsHeapObject()) { |
152 profile_->StoreReference(cluster_, HeapObject::cast(*o)); | 152 profile_->StoreReference(cluster_, HeapObject::cast(*o)); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 void VisitPointers(Object** start, Object** end) { | 156 void VisitPointers(Object** start, Object** end) { |
157 for (Object** p = start; p < end; p++) VisitPointer(p); | 157 for (Object** p = start; p < end; p++) VisitPointer(p); |
158 } | 158 } |
159 | 159 |
160 private: | 160 private: |
161 const JSObjectsCluster& cluster_; | 161 const JSObjectsCluster& cluster_; |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 GlobalHandles::MakeWeak(handle.location(), | 685 GlobalHandles::MakeWeak(handle.location(), |
686 static_cast<void*>(stack.start()), | 686 static_cast<void*>(stack.start()), |
687 StackWeakReferenceCallback); | 687 StackWeakReferenceCallback); |
688 } | 688 } |
689 | 689 |
690 | 690 |
691 #endif // ENABLE_LOGGING_AND_PROFILING | 691 #endif // ENABLE_LOGGING_AND_PROFILING |
692 | 692 |
693 | 693 |
694 } } // namespace v8::internal | 694 } } // namespace v8::internal |
OLD | NEW |