Chromium Code Reviews| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 | 98 |
| 99 void CodeMap::MoveCode(Address from, Address to) { | 99 void CodeMap::MoveCode(Address from, Address to) { |
| 100 tree_.Move(from, to); | 100 tree_.Move(from, to); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void CodeMap::DeleteCode(Address addr) { | 103 void CodeMap::DeleteCode(Address addr) { |
| 104 tree_.Remove(addr); | 104 tree_.Remove(addr); |
| 105 } | 105 } |
| 106 | 106 |
| 107 | 107 |
| 108 template<class Visitor> | |
| 109 void HeapEntriesMap::UpdateEntries(Visitor* visitor) { | |
| 110 for (HashMap::Entry* p = entries_.Start(); | |
| 111 p != NULL; | |
| 112 p = entries_.Next(p)) { | |
| 113 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value); | |
| 114 entry_info->entry = visitor->GetEntry( | |
| 115 reinterpret_cast<HeapObject*>(p->key), | |
| 116 entry_info->children_count, | |
| 117 entry_info->retainers_count); | |
| 118 entry_info->children_count = 0; | |
| 119 entry_info->retainers_count = 0; | |
| 120 } | |
| 121 } | |
| 122 | |
| 123 | |
| 124 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { | 108 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { |
| 125 switch (tag) { | 109 switch (tag) { |
| 126 case GC: | 110 case GC: |
| 127 return gc_entry_; | 111 return gc_entry_; |
| 128 case JS: | 112 case JS: |
| 129 case COMPILER: | 113 case COMPILER: |
| 130 // DOM events handlers are reported as OTHER / EXTERNAL entries. | 114 // DOM events handlers are reported as OTHER / EXTERNAL entries. |
| 131 // To avoid confusing people, let's put all these entries into | 115 // To avoid confusing people, let's put all these entries into |
| 132 // one bucket. | 116 // one bucket. |
| 133 case OTHER: | 117 case OTHER: |
| 134 case EXTERNAL: | 118 case EXTERNAL: |
| 135 return program_entry_; | 119 return program_entry_; |
| 136 default: return NULL; | 120 default: return NULL; |
| 137 } | 121 } |
| 138 } | 122 } |
| 139 | 123 |
| 124 | |
| 125 template<class Visitor> | |
| 126 void HeapEntriesMap::UpdateEntries(Visitor* visitor) { | |
|
mnaganov (inactive)
2010/11/19 16:56:27
Just moved this code down to match classes declara
| |
| 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 } } // namespace v8::internal | 140 } } // namespace v8::internal |
| 141 | 141 |
| 142 #endif // ENABLE_LOGGING_AND_PROFILING | 142 #endif // ENABLE_LOGGING_AND_PROFILING |
| 143 | 143 |
| 144 #endif // V8_PROFILE_GENERATOR_INL_H_ | 144 #endif // V8_PROFILE_GENERATOR_INL_H_ |
| OLD | NEW |