| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 node->IncrementSelfTicks(); | 320 node->IncrementSelfTicks(); |
| 321 if (src_line != v8::CpuProfileNode::kNoLineNumberInfo) { | 321 if (src_line != v8::CpuProfileNode::kNoLineNumberInfo) { |
| 322 node->IncrementLineTicks(src_line); | 322 node->IncrementLineTicks(src_line); |
| 323 } | 323 } |
| 324 return node; | 324 return node; |
| 325 } | 325 } |
| 326 | 326 |
| 327 | 327 |
| 328 void ProfileTree::AddPathFromStart(const Vector<CodeEntry*>& path, | |
| 329 int src_line) { | |
| 330 ProfileNode* node = root_; | |
| 331 for (CodeEntry** entry = path.start(); | |
| 332 entry != path.start() + path.length(); | |
| 333 ++entry) { | |
| 334 if (*entry != NULL) { | |
| 335 node = node->FindOrAddChild(*entry); | |
| 336 } | |
| 337 } | |
| 338 node->IncrementSelfTicks(); | |
| 339 if (src_line != v8::CpuProfileNode::kNoLineNumberInfo) { | |
| 340 node->IncrementLineTicks(src_line); | |
| 341 } | |
| 342 } | |
| 343 | |
| 344 | |
| 345 struct NodesPair { | 328 struct NodesPair { |
| 346 NodesPair(ProfileNode* src, ProfileNode* dst) | 329 NodesPair(ProfileNode* src, ProfileNode* dst) |
| 347 : src(src), dst(dst) { } | 330 : src(src), dst(dst) { } |
| 348 ProfileNode* src; | 331 ProfileNode* src; |
| 349 ProfileNode* dst; | 332 ProfileNode* dst; |
| 350 }; | 333 }; |
| 351 | 334 |
| 352 | 335 |
| 353 class Position { | 336 class Position { |
| 354 public: | 337 public: |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 case OTHER: | 738 case OTHER: |
| 756 case EXTERNAL: | 739 case EXTERNAL: |
| 757 return program_entry_; | 740 return program_entry_; |
| 758 case IDLE: | 741 case IDLE: |
| 759 return idle_entry_; | 742 return idle_entry_; |
| 760 default: return NULL; | 743 default: return NULL; |
| 761 } | 744 } |
| 762 } | 745 } |
| 763 | 746 |
| 764 } } // namespace v8::internal | 747 } } // namespace v8::internal |
| OLD | NEW |