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

Side by Side Diff: src/profile-generator-inl.h

Issue 5274002: Version 2.5.8... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « src/profile-generator.cc ('k') | src/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 if (!IsAlias(p->value)) {
114 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value);
115 entry_info->entry = visitor->GetEntry(
116 reinterpret_cast<HeapObject*>(p->key),
117 entry_info->children_count,
118 entry_info->retainers_count);
119 entry_info->children_count = 0;
120 entry_info->retainers_count = 0;
121 }
122 }
123 }
124
125
126 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { 108 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
127 switch (tag) { 109 switch (tag) {
128 case GC: 110 case GC:
129 return gc_entry_; 111 return gc_entry_;
130 case JS: 112 case JS:
131 case COMPILER: 113 case COMPILER:
132 // DOM events handlers are reported as OTHER / EXTERNAL entries. 114 // DOM events handlers are reported as OTHER / EXTERNAL entries.
133 // To avoid confusing people, let's put all these entries into 115 // To avoid confusing people, let's put all these entries into
134 // one bucket. 116 // one bucket.
135 case OTHER: 117 case OTHER:
136 case EXTERNAL: 118 case EXTERNAL:
137 return program_entry_; 119 return program_entry_;
138 default: return NULL; 120 default: return NULL;
139 } 121 }
140 } 122 }
141 123
124
125 inline uint64_t HeapEntry::id() {
126 union {
127 Id stored_id;
128 uint64_t returned_id;
129 } id_adaptor = {id_};
130 return id_adaptor.returned_id;
131 }
132
133
134 template<class Visitor>
135 void HeapEntriesMap::UpdateEntries(Visitor* visitor) {
136 for (HashMap::Entry* p = entries_.Start();
137 p != NULL;
138 p = entries_.Next(p)) {
139 EntryInfo* entry_info = reinterpret_cast<EntryInfo*>(p->value);
140 entry_info->entry = visitor->GetEntry(
141 reinterpret_cast<HeapObject*>(p->key),
142 entry_info->children_count,
143 entry_info->retainers_count);
144 entry_info->children_count = 0;
145 entry_info->retainers_count = 0;
146 }
147 }
148
142 } } // namespace v8::internal 149 } } // namespace v8::internal
143 150
144 #endif // ENABLE_LOGGING_AND_PROFILING 151 #endif // ENABLE_LOGGING_AND_PROFILING
145 152
146 #endif // V8_PROFILE_GENERATOR_INL_H_ 153 #endif // V8_PROFILE_GENERATOR_INL_H_
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698