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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 const char* const CodeEntry::kEmptyBailoutReason = ""; |
137 | 137 |
138 | 138 |
139 CodeEntry::~CodeEntry() { | 139 CodeEntry::~CodeEntry() { |
140 delete no_frame_ranges_; | 140 delete no_frame_ranges_; |
141 } | 141 } |
142 | 142 |
143 | 143 |
144 void CodeEntry::CopyData(const CodeEntry& source) { | |
145 tag_ = source.tag_; | |
146 name_prefix_ = source.name_prefix_; | |
147 name_ = source.name_; | |
148 resource_name_ = source.resource_name_; | |
149 line_number_ = source.line_number_; | |
150 } | |
151 | |
152 | |
153 uint32_t CodeEntry::GetCallUid() const { | 144 uint32_t CodeEntry::GetCallUid() const { |
154 uint32_t hash = ComputeIntegerHash(tag_, v8::internal::kZeroHashSeed); | 145 uint32_t hash = ComputeIntegerHash(tag_, v8::internal::kZeroHashSeed); |
155 if (shared_id_ != 0) { | 146 if (shared_id_ != 0) { |
156 hash ^= ComputeIntegerHash(static_cast<uint32_t>(shared_id_), | 147 hash ^= ComputeIntegerHash(static_cast<uint32_t>(shared_id_), |
157 v8::internal::kZeroHashSeed); | 148 v8::internal::kZeroHashSeed); |
158 } else { | 149 } else { |
159 hash ^= ComputeIntegerHash( | 150 hash ^= ComputeIntegerHash( |
160 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_prefix_)), | 151 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_prefix_)), |
161 v8::internal::kZeroHashSeed); | 152 v8::internal::kZeroHashSeed); |
162 hash ^= ComputeIntegerHash( | 153 hash ^= ComputeIntegerHash( |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 // If no frames were symbolized, put the VM state entry in. | 646 // If no frames were symbolized, put the VM state entry in. |
656 if (no_symbolized_entries) { | 647 if (no_symbolized_entries) { |
657 *entry++ = EntryForVMState(sample.state); | 648 *entry++ = EntryForVMState(sample.state); |
658 } | 649 } |
659 } | 650 } |
660 | 651 |
661 profiles_->AddPathToCurrentProfiles(entries); | 652 profiles_->AddPathToCurrentProfiles(entries); |
662 } | 653 } |
663 | 654 |
664 | 655 |
| 656 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { |
| 657 switch (tag) { |
| 658 case GC: |
| 659 return gc_entry_; |
| 660 case JS: |
| 661 case COMPILER: |
| 662 // DOM events handlers are reported as OTHER / EXTERNAL entries. |
| 663 // To avoid confusing people, let's put all these entries into |
| 664 // one bucket. |
| 665 case OTHER: |
| 666 case EXTERNAL: |
| 667 return program_entry_; |
| 668 case IDLE: |
| 669 return idle_entry_; |
| 670 default: return NULL; |
| 671 } |
| 672 } |
| 673 |
665 } } // namespace v8::internal | 674 } } // namespace v8::internal |
OLD | NEW |