| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 461 |
| 462 void ProfileTree::ShortPrint() { | 462 void ProfileTree::ShortPrint() { |
| 463 OS::Print("root: %u %u %.2fms %.2fms\n", | 463 OS::Print("root: %u %u %.2fms %.2fms\n", |
| 464 root_->total_ticks(), root_->self_ticks(), | 464 root_->total_ticks(), root_->self_ticks(), |
| 465 root_->GetTotalMillis(), root_->GetSelfMillis()); | 465 root_->GetTotalMillis(), root_->GetSelfMillis()); |
| 466 } | 466 } |
| 467 | 467 |
| 468 | 468 |
| 469 void CpuProfile::AddPath(const Vector<CodeEntry*>& path) { | 469 void CpuProfile::AddPath(const Vector<CodeEntry*>& path) { |
| 470 top_down_.AddPathFromEnd(path); | 470 top_down_.AddPathFromEnd(path); |
| 471 bottom_up_.AddPathFromStart(path); | |
| 472 } | 471 } |
| 473 | 472 |
| 474 | 473 |
| 475 void CpuProfile::CalculateTotalTicks() { | 474 void CpuProfile::CalculateTotalTicks() { |
| 476 top_down_.CalculateTotalTicks(); | 475 top_down_.CalculateTotalTicks(); |
| 477 bottom_up_.CalculateTotalTicks(); | |
| 478 } | 476 } |
| 479 | 477 |
| 480 | 478 |
| 481 void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) { | 479 void CpuProfile::SetActualSamplingRate(double actual_sampling_rate) { |
| 482 top_down_.SetTickRatePerMs(actual_sampling_rate); | 480 top_down_.SetTickRatePerMs(actual_sampling_rate); |
| 483 bottom_up_.SetTickRatePerMs(actual_sampling_rate); | |
| 484 } | 481 } |
| 485 | 482 |
| 486 | 483 |
| 487 CpuProfile* CpuProfile::FilteredClone(int security_token_id) { | 484 CpuProfile* CpuProfile::FilteredClone(int security_token_id) { |
| 488 ASSERT(security_token_id != TokenEnumerator::kNoSecurityToken); | 485 ASSERT(security_token_id != TokenEnumerator::kNoSecurityToken); |
| 489 CpuProfile* clone = new CpuProfile(title_, uid_); | 486 CpuProfile* clone = new CpuProfile(title_, uid_); |
| 490 clone->top_down_.FilteredClone(&top_down_, security_token_id); | 487 clone->top_down_.FilteredClone(&top_down_, security_token_id); |
| 491 clone->bottom_up_.FilteredClone(&bottom_up_, security_token_id); | |
| 492 return clone; | 488 return clone; |
| 493 } | 489 } |
| 494 | 490 |
| 495 | 491 |
| 496 void CpuProfile::ShortPrint() { | 492 void CpuProfile::ShortPrint() { |
| 497 OS::Print("top down "); | 493 OS::Print("top down "); |
| 498 top_down_.ShortPrint(); | 494 top_down_.ShortPrint(); |
| 499 OS::Print("bottom up "); | |
| 500 bottom_up_.ShortPrint(); | |
| 501 } | 495 } |
| 502 | 496 |
| 503 | 497 |
| 504 void CpuProfile::Print() { | 498 void CpuProfile::Print() { |
| 505 OS::Print("[Top down]:\n"); | 499 OS::Print("[Top down]:\n"); |
| 506 top_down_.Print(); | 500 top_down_.Print(); |
| 507 OS::Print("[Bottom up]:\n"); | |
| 508 bottom_up_.Print(); | |
| 509 } | 501 } |
| 510 | 502 |
| 511 | 503 |
| 512 CodeEntry* const CodeMap::kSharedFunctionCodeEntry = NULL; | 504 CodeEntry* const CodeMap::kSharedFunctionCodeEntry = NULL; |
| 513 const CodeMap::CodeTreeConfig::Key CodeMap::CodeTreeConfig::kNoKey = NULL; | 505 const CodeMap::CodeTreeConfig::Key CodeMap::CodeTreeConfig::kNoKey = NULL; |
| 514 | 506 |
| 515 | 507 |
| 516 void CodeMap::AddCode(Address addr, CodeEntry* entry, unsigned size) { | 508 void CodeMap::AddCode(Address addr, CodeEntry* entry, unsigned size) { |
| 517 DeleteAllCoveredCode(addr, addr + size); | 509 DeleteAllCoveredCode(addr, addr + size); |
| 518 CodeTree::Locator locator; | 510 CodeTree::Locator locator; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 if (no_symbolized_entries) { | 931 if (no_symbolized_entries) { |
| 940 *entry++ = EntryForVMState(sample.state); | 932 *entry++ = EntryForVMState(sample.state); |
| 941 } | 933 } |
| 942 } | 934 } |
| 943 | 935 |
| 944 profiles_->AddPathToCurrentProfiles(entries); | 936 profiles_->AddPathToCurrentProfiles(entries); |
| 945 } | 937 } |
| 946 | 938 |
| 947 | 939 |
| 948 } } // namespace v8::internal | 940 } } // namespace v8::internal |
| OLD | NEW |