Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: src/profiler/profile-generator.cc

Issue 2526843002: Revert of [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/log.cc ('k') | test/unittests/counters-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/log.cc ('k') | test/unittests/counters-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698