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

Side by Side Diff: src/api.cc

Issue 2459903003: [Tracing] Use TracingCategoryObserver in gc statistics (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « no previous file | src/bootstrapper.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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 i::PrintF("Warming up snapshot took %0.3f ms\n", 651 i::PrintF("Warming up snapshot took %0.3f ms\n",
652 timer.Elapsed().InMillisecondsF()); 652 timer.Elapsed().InMillisecondsF());
653 } 653 }
654 timer.Stop(); 654 timer.Stop();
655 return result; 655 return result;
656 } 656 }
657 657
658 658
659 void V8::SetFlagsFromString(const char* str, int length) { 659 void V8::SetFlagsFromString(const char* str, int length) {
660 i::FlagList::SetFlagsFromString(str, length); 660 i::FlagList::SetFlagsFromString(str, length);
661 i::FlagList::EnforceFlagImplications();
661 } 662 }
662 663
663 664
664 void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) { 665 void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
665 i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags); 666 i::FlagList::SetFlagsFromCommandLine(argc, argv, remove_flags);
666 } 667 }
667 668
668 669
669 RegisteredExtension* RegisteredExtension::first_extension_ = NULL; 670 RegisteredExtension* RegisteredExtension::first_extension_ = NULL;
670 671
(...skipping 7409 matching lines...) Expand 10 before | Expand all | Expand 10 after
8080 size_t Isolate::NumberOfTrackedHeapObjectTypes() { 8081 size_t Isolate::NumberOfTrackedHeapObjectTypes() {
8081 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 8082 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
8082 i::Heap* heap = isolate->heap(); 8083 i::Heap* heap = isolate->heap();
8083 return heap->NumberOfTrackedHeapObjectTypes(); 8084 return heap->NumberOfTrackedHeapObjectTypes();
8084 } 8085 }
8085 8086
8086 8087
8087 bool Isolate::GetHeapObjectStatisticsAtLastGC( 8088 bool Isolate::GetHeapObjectStatisticsAtLastGC(
8088 HeapObjectStatistics* object_statistics, size_t type_index) { 8089 HeapObjectStatistics* object_statistics, size_t type_index) {
8089 if (!object_statistics) return false; 8090 if (!object_statistics) return false;
8090 if (!i::FLAG_track_gc_object_stats) return false; 8091 if (V8_LIKELY(!i::FLAG_gc_stats)) return false;
8091 8092
8092 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 8093 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
8093 i::Heap* heap = isolate->heap(); 8094 i::Heap* heap = isolate->heap();
8094 if (type_index >= heap->NumberOfTrackedHeapObjectTypes()) return false; 8095 if (type_index >= heap->NumberOfTrackedHeapObjectTypes()) return false;
8095 8096
8096 const char* object_type; 8097 const char* object_type;
8097 const char* object_sub_type; 8098 const char* object_sub_type;
8098 size_t object_count = heap->ObjectCountAtLastGC(type_index); 8099 size_t object_count = heap->ObjectCountAtLastGC(type_index);
8099 size_t object_size = heap->ObjectSizeAtLastGC(type_index); 8100 size_t object_size = heap->ObjectSizeAtLastGC(type_index);
8100 if (!heap->GetObjectTypeName(type_index, &object_type, &object_sub_type)) { 8101 if (!heap->GetObjectTypeName(type_index, &object_type, &object_sub_type)) {
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
9770 Address callback_address = 9771 Address callback_address =
9771 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9772 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9772 VMState<EXTERNAL> state(isolate); 9773 VMState<EXTERNAL> state(isolate);
9773 ExternalCallbackScope call_scope(isolate, callback_address); 9774 ExternalCallbackScope call_scope(isolate, callback_address);
9774 callback(info); 9775 callback(info);
9775 } 9776 }
9776 9777
9777 9778
9778 } // namespace internal 9779 } // namespace internal
9779 } // namespace v8 9780 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698