| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 size += sizeof(HashMap::Entry) * names_.capacity(); | 126 size += sizeof(HashMap::Entry) * names_.capacity(); |
| 127 for (HashMap::Entry* p = names_.Start(); p != NULL; p = names_.Next(p)) { | 127 for (HashMap::Entry* p = names_.Start(); p != NULL; p = names_.Next(p)) { |
| 128 size += strlen(reinterpret_cast<const char*>(p->value)) + 1; | 128 size += strlen(reinterpret_cast<const char*>(p->value)) + 1; |
| 129 } | 129 } |
| 130 return size; | 130 return size; |
| 131 } | 131 } |
| 132 | 132 |
| 133 | 133 |
| 134 const char* const CodeEntry::kEmptyNamePrefix = ""; | 134 const char* const CodeEntry::kEmptyNamePrefix = ""; |
| 135 const char* const CodeEntry::kEmptyResourceName = ""; | 135 const char* const CodeEntry::kEmptyResourceName = ""; |
| 136 const char* const CodeEntry::kEmptyBailoutReason = ""; |
| 136 | 137 |
| 137 | 138 |
| 138 CodeEntry::~CodeEntry() { | 139 CodeEntry::~CodeEntry() { |
| 139 delete no_frame_ranges_; | 140 delete no_frame_ranges_; |
| 140 } | 141 } |
| 141 | 142 |
| 142 | 143 |
| 143 void CodeEntry::CopyData(const CodeEntry& source) { | 144 void CodeEntry::CopyData(const CodeEntry& source) { |
| 144 tag_ = source.tag_; | 145 tag_ = source.tag_; |
| 145 name_prefix_ = source.name_prefix_; | 146 name_prefix_ = source.name_prefix_; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // New node added. | 204 // New node added. |
| 204 ProfileNode* new_node = new ProfileNode(tree_, entry); | 205 ProfileNode* new_node = new ProfileNode(tree_, entry); |
| 205 map_entry->value = new_node; | 206 map_entry->value = new_node; |
| 206 children_list_.Add(new_node); | 207 children_list_.Add(new_node); |
| 207 } | 208 } |
| 208 return reinterpret_cast<ProfileNode*>(map_entry->value); | 209 return reinterpret_cast<ProfileNode*>(map_entry->value); |
| 209 } | 210 } |
| 210 | 211 |
| 211 | 212 |
| 212 void ProfileNode::Print(int indent) { | 213 void ProfileNode::Print(int indent) { |
| 213 OS::Print("%5u %*c %s%s %d #%d", | 214 OS::Print("%5u %*c %s%s %d #%d %s", |
| 214 self_ticks_, | 215 self_ticks_, |
| 215 indent, ' ', | 216 indent, ' ', |
| 216 entry_->name_prefix(), | 217 entry_->name_prefix(), |
| 217 entry_->name(), | 218 entry_->name(), |
| 218 entry_->script_id(), | 219 entry_->script_id(), |
| 219 id()); | 220 id(), |
| 221 entry_->bailout_reason()); |
| 220 if (entry_->resource_name()[0] != '\0') | 222 if (entry_->resource_name()[0] != '\0') |
| 221 OS::Print(" %s:%d", entry_->resource_name(), entry_->line_number()); | 223 OS::Print(" %s:%d", entry_->resource_name(), entry_->line_number()); |
| 222 OS::Print("\n"); | 224 OS::Print("\n"); |
| 223 for (HashMap::Entry* p = children_.Start(); | 225 for (HashMap::Entry* p = children_.Start(); |
| 224 p != NULL; | 226 p != NULL; |
| 225 p = children_.Next(p)) { | 227 p = children_.Next(p)) { |
| 226 reinterpret_cast<ProfileNode*>(p->value)->Print(indent + 2); | 228 reinterpret_cast<ProfileNode*>(p->value)->Print(indent + 2); |
| 227 } | 229 } |
| 228 } | 230 } |
| 229 | 231 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 if (no_symbolized_entries) { | 653 if (no_symbolized_entries) { |
| 652 *entry++ = EntryForVMState(sample.state); | 654 *entry++ = EntryForVMState(sample.state); |
| 653 } | 655 } |
| 654 } | 656 } |
| 655 | 657 |
| 656 profiles_->AddPathToCurrentProfiles(entries); | 658 profiles_->AddPathToCurrentProfiles(entries); |
| 657 } | 659 } |
| 658 | 660 |
| 659 | 661 |
| 660 } } // namespace v8::internal | 662 } } // namespace v8::internal |
| OLD | NEW |