| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/profile-generator-inl.h" | 7 #include "src/profile-generator-inl.h" |
| 8 | 8 |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/debug.h" | 10 #include "src/debug.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 void CodeEntry::FillFunctionInfo(SharedFunctionInfo* shared) { | 106 void CodeEntry::FillFunctionInfo(SharedFunctionInfo* shared) { |
| 107 if (!shared->script()->IsScript()) return; | 107 if (!shared->script()->IsScript()) return; |
| 108 Script* script = Script::cast(shared->script()); | 108 Script* script = Script::cast(shared->script()); |
| 109 set_script_id(script->id()->value()); | 109 set_script_id(script->id()->value()); |
| 110 set_position(shared->start_position()); | 110 set_position(shared->start_position()); |
| 111 set_bailout_reason(GetBailoutReason(shared->disable_optimization_reason())); | 111 set_bailout_reason(GetBailoutReason(shared->disable_optimization_reason())); |
| 112 } | 112 } |
| 113 | 113 |
| 114 | 114 |
| 115 void ProfileNode::CollectDeoptInfo(CodeEntry* entry) { | 115 void ProfileNode::CollectDeoptInfo(CodeEntry* entry) { |
| 116 deopt_infos_.Add(DeoptInfo(entry->deopt_reason(), entry->deopt_location())); | 116 deopt_infos_.Add(DeoptInfo(entry->deopt_reason(), entry->deopt_position())); |
| 117 entry->clear_deopt_info(); | 117 entry->clear_deopt_info(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 | 120 |
| 121 ProfileNode* ProfileNode::FindChild(CodeEntry* entry) { | 121 ProfileNode* ProfileNode::FindChild(CodeEntry* entry) { |
| 122 HashMap::Entry* map_entry = | 122 HashMap::Entry* map_entry = |
| 123 children_.Lookup(entry, CodeEntryHash(entry), false); | 123 children_.Lookup(entry, CodeEntryHash(entry), false); |
| 124 return map_entry != NULL ? | 124 return map_entry != NULL ? |
| 125 reinterpret_cast<ProfileNode*>(map_entry->value) : NULL; | 125 reinterpret_cast<ProfileNode*>(map_entry->value) : NULL; |
| 126 } | 126 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 | 176 |
| 177 void ProfileNode::Print(int indent) { | 177 void ProfileNode::Print(int indent) { |
| 178 base::OS::Print("%5u %*s %s%s %d #%d", self_ticks_, indent, "", | 178 base::OS::Print("%5u %*s %s%s %d #%d", self_ticks_, indent, "", |
| 179 entry_->name_prefix(), entry_->name(), entry_->script_id(), | 179 entry_->name_prefix(), entry_->name(), entry_->script_id(), |
| 180 id()); | 180 id()); |
| 181 if (entry_->resource_name()[0] != '\0') | 181 if (entry_->resource_name()[0] != '\0') |
| 182 base::OS::Print(" %s:%d", entry_->resource_name(), entry_->line_number()); | 182 base::OS::Print(" %s:%d", entry_->resource_name(), entry_->line_number()); |
| 183 base::OS::Print("\n"); | 183 base::OS::Print("\n"); |
| 184 for (auto info : deopt_infos_) { | 184 for (auto info : deopt_infos_) { |
| 185 base::OS::Print("%*s deopted at %d with reason '%s'\n", indent + 10, "", | 185 if (FLAG_hydrogen_track_positions) { |
| 186 info.deopt_location, info.deopt_reason); | 186 base::OS::Print("%*s deopted at %d_%d with reason '%s'\n", indent + 10, |
| 187 "", info.deopt_position.inlining_id(), |
| 188 info.deopt_position.position(), info.deopt_reason); |
| 189 } else { |
| 190 base::OS::Print("%*s deopted at %d with reason '%s'\n", indent + 10, "", |
| 191 info.deopt_position.raw(), info.deopt_reason); |
| 192 } |
| 187 } | 193 } |
| 188 const char* bailout_reason = entry_->bailout_reason(); | 194 const char* bailout_reason = entry_->bailout_reason(); |
| 189 if (bailout_reason != GetBailoutReason(BailoutReason::kNoReason) && | 195 if (bailout_reason != GetBailoutReason(BailoutReason::kNoReason) && |
| 190 bailout_reason != CodeEntry::kEmptyBailoutReason) { | 196 bailout_reason != CodeEntry::kEmptyBailoutReason) { |
| 191 base::OS::Print("%*s bailed out due to '%s'\n", indent + 10, "", | 197 base::OS::Print("%*s bailed out due to '%s'\n", indent + 10, "", |
| 192 bailout_reason); | 198 bailout_reason); |
| 193 } | 199 } |
| 194 for (HashMap::Entry* p = children_.Start(); | 200 for (HashMap::Entry* p = children_.Start(); |
| 195 p != NULL; | 201 p != NULL; |
| 196 p = children_.Next(p)) { | 202 p = children_.Next(p)) { |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 case OTHER: | 656 case OTHER: |
| 651 case EXTERNAL: | 657 case EXTERNAL: |
| 652 return program_entry_; | 658 return program_entry_; |
| 653 case IDLE: | 659 case IDLE: |
| 654 return idle_entry_; | 660 return idle_entry_; |
| 655 default: return NULL; | 661 default: return NULL; |
| 656 } | 662 } |
| 657 } | 663 } |
| 658 | 664 |
| 659 } } // namespace v8::internal | 665 } } // namespace v8::internal |
| OLD | NEW |