OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 | 115 |
116 uint64_t HeapEntry::id() { | 116 uint64_t HeapEntry::id() { |
117 union { | 117 union { |
118 Id stored_id; | 118 Id stored_id; |
119 uint64_t returned_id; | 119 uint64_t returned_id; |
120 } id_adaptor = {id_}; | 120 } id_adaptor = {id_}; |
121 return id_adaptor.returned_id; | 121 return id_adaptor.returned_id; |
122 } | 122 } |
123 | 123 |
124 | |
125 template<class Visitor> | |
126 void HeapEntriesMap::UpdateEntries(Visitor* visitor) { | |
127 for (HashMap::Entry* p = entries_.Start(); | |
128 p != NULL; | |
129 p = entries_.Next(p)) { | |
130 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value); | |
131 entry_info->entry = visitor->GetEntry( | |
132 reinterpret_cast<HeapObject*>(p->key), | |
133 entry_info->children_count, | |
134 entry_info->retainers_count); | |
135 entry_info->children_count = 0; | |
136 entry_info->retainers_count = 0; | |
137 } | |
138 } | |
139 | |
140 | |
141 bool HeapSnapshotGenerator::ReportProgress(bool force) { | |
142 const int kProgressReportGranularity = 10000; | |
143 if (control_ != NULL | |
144 && (force || progress_counter_ % kProgressReportGranularity == 0)) { | |
145 return | |
146 control_->ReportProgressValue(progress_counter_, progress_total_) == | |
147 v8::ActivityControl::kContinue; | |
148 } | |
149 return true; | |
150 } | |
151 | |
152 } } // namespace v8::internal | 124 } } // namespace v8::internal |
153 | 125 |
154 #endif // ENABLE_LOGGING_AND_PROFILING | 126 #endif // ENABLE_LOGGING_AND_PROFILING |
155 | 127 |
156 #endif // V8_PROFILE_GENERATOR_INL_H_ | 128 #endif // V8_PROFILE_GENERATOR_INL_H_ |
OLD | NEW |