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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // To avoid confusing people, let's put all these entries into | 115 // To avoid confusing people, let's put all these entries into |
116 // one bucket. | 116 // one bucket. |
117 case OTHER: | 117 case OTHER: |
118 case EXTERNAL: | 118 case EXTERNAL: |
119 return program_entry_; | 119 return program_entry_; |
120 default: return NULL; | 120 default: return NULL; |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 | 124 |
125 #ifdef WIN32 | |
126 inline uint64_t HeapEntry::id() { | 125 inline uint64_t HeapEntry::id() { |
127 return *(reinterpret_cast<uint64_t*>(&id_)); | 126 union { |
| 127 Id stored_id; |
| 128 uint64_t returned_id; |
| 129 } id_adaptor = {id_}; |
| 130 return id_adaptor.returned_id; |
128 } | 131 } |
129 #else | |
130 inline uint64_t HeapEntry::id() { | |
131 return id_; | |
132 } | |
133 #endif | |
134 | 132 |
135 | 133 |
136 template<class Visitor> | 134 template<class Visitor> |
137 void HeapEntriesMap::UpdateEntries(Visitor* visitor) { | 135 void HeapEntriesMap::UpdateEntries(Visitor* visitor) { |
138 for (HashMap::Entry* p = entries_.Start(); | 136 for (HashMap::Entry* p = entries_.Start(); |
139 p != NULL; | 137 p != NULL; |
140 p = entries_.Next(p)) { | 138 p = entries_.Next(p)) { |
141 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value); | 139 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value); |
142 entry_info->entry = visitor->GetEntry( | 140 entry_info->entry = visitor->GetEntry( |
143 reinterpret_cast<HeapObject*>(p->key), | 141 reinterpret_cast<HeapObject*>(p->key), |
144 entry_info->children_count, | 142 entry_info->children_count, |
145 entry_info->retainers_count); | 143 entry_info->retainers_count); |
146 entry_info->children_count = 0; | 144 entry_info->children_count = 0; |
147 entry_info->retainers_count = 0; | 145 entry_info->retainers_count = 0; |
148 } | 146 } |
149 } | 147 } |
150 | 148 |
151 } } // namespace v8::internal | 149 } } // namespace v8::internal |
152 | 150 |
153 #endif // ENABLE_LOGGING_AND_PROFILING | 151 #endif // ENABLE_LOGGING_AND_PROFILING |
154 | 152 |
155 #endif // V8_PROFILE_GENERATOR_INL_H_ | 153 #endif // V8_PROFILE_GENERATOR_INL_H_ |
OLD | NEW |