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/profiler/profile-generator.h" | 5 #include "src/profiler/profile-generator.h" |
6 | 6 |
7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/global-handles.h" | 10 #include "src/global-handles.h" |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 757 |
758 CodeEntry* ProfileGenerator::FindEntry(void* address) { | 758 CodeEntry* ProfileGenerator::FindEntry(void* address) { |
759 CodeEntry* entry = code_map_.FindEntry(reinterpret_cast<Address>(address)); | 759 CodeEntry* entry = code_map_.FindEntry(reinterpret_cast<Address>(address)); |
760 if (!entry) { | 760 if (!entry) { |
761 RuntimeCallStats* rcs = isolate_->counters()->runtime_call_stats(); | 761 RuntimeCallStats* rcs = isolate_->counters()->runtime_call_stats(); |
762 void* start = reinterpret_cast<void*>(rcs); | 762 void* start = reinterpret_cast<void*>(rcs); |
763 void* end = reinterpret_cast<void*>(rcs + 1); | 763 void* end = reinterpret_cast<void*>(rcs + 1); |
764 if (start <= address && address < end) { | 764 if (start <= address && address < end) { |
765 RuntimeCallCounter* counter = | 765 RuntimeCallCounter* counter = |
766 reinterpret_cast<RuntimeCallCounter*>(address); | 766 reinterpret_cast<RuntimeCallCounter*>(address); |
767 CHECK(counter->name()); | 767 CHECK(counter->name); |
768 entry = new CodeEntry(CodeEventListener::FUNCTION_TAG, counter->name(), | 768 entry = new CodeEntry(CodeEventListener::FUNCTION_TAG, counter->name, |
769 CodeEntry::kEmptyNamePrefix, "native V8Runtime"); | 769 CodeEntry::kEmptyNamePrefix, "native V8Runtime"); |
770 code_map_.AddCode(reinterpret_cast<Address>(address), entry, 1); | 770 code_map_.AddCode(reinterpret_cast<Address>(address), entry, 1); |
771 } | 771 } |
772 } | 772 } |
773 return entry; | 773 return entry; |
774 } | 774 } |
775 | 775 |
776 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { | 776 CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) { |
777 switch (tag) { | 777 switch (tag) { |
778 case GC: | 778 case GC: |
779 return CodeEntry::gc_entry(); | 779 return CodeEntry::gc_entry(); |
780 case JS: | 780 case JS: |
781 case COMPILER: | 781 case COMPILER: |
782 // DOM events handlers are reported as OTHER / EXTERNAL entries. | 782 // DOM events handlers are reported as OTHER / EXTERNAL entries. |
783 // To avoid confusing people, let's put all these entries into | 783 // To avoid confusing people, let's put all these entries into |
784 // one bucket. | 784 // one bucket. |
785 case OTHER: | 785 case OTHER: |
786 case EXTERNAL: | 786 case EXTERNAL: |
787 return CodeEntry::program_entry(); | 787 return CodeEntry::program_entry(); |
788 case IDLE: | 788 case IDLE: |
789 return CodeEntry::idle_entry(); | 789 return CodeEntry::idle_entry(); |
790 default: return NULL; | 790 default: return NULL; |
791 } | 791 } |
792 } | 792 } |
793 | 793 |
794 } // namespace internal | 794 } // namespace internal |
795 } // namespace v8 | 795 } // namespace v8 |
OLD | NEW |