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

Side by Side Diff: src/api.cc

Issue 2918703002: Localize counter class member functions. (Closed)
Patch Set: Move ctors back to private. Created 3 years, 6 months 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/counters.h » ('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 8712 matching lines...) Expand 10 before | Expand all | Expand 10 after
8723 } 8723 }
8724 8724
8725 8725
8726 void Isolate::SetUseCounterCallback(UseCounterCallback callback) { 8726 void Isolate::SetUseCounterCallback(UseCounterCallback callback) {
8727 reinterpret_cast<i::Isolate*>(this)->SetUseCounterCallback(callback); 8727 reinterpret_cast<i::Isolate*>(this)->SetUseCounterCallback(callback);
8728 } 8728 }
8729 8729
8730 8730
8731 void Isolate::SetCounterFunction(CounterLookupCallback callback) { 8731 void Isolate::SetCounterFunction(CounterLookupCallback callback) {
8732 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 8732 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
8733 isolate->stats_table()->SetCounterFunction(callback); 8733 isolate->counters()->ResetCounterFunction(callback);
8734 } 8734 }
8735 8735
8736 8736
8737 void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) { 8737 void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) {
8738 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 8738 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
8739 isolate->stats_table()->SetCreateHistogramFunction(callback); 8739 isolate->counters()->ResetCreateHistogramFunction(callback);
8740 isolate->InitializeLoggingAndCounters();
8741 isolate->counters()->ResetHistograms();
8742 isolate->counters()->InitializeHistograms();
8743 } 8740 }
8744 8741
8745 8742
8746 void Isolate::SetAddHistogramSampleFunction( 8743 void Isolate::SetAddHistogramSampleFunction(
8747 AddHistogramSampleCallback callback) { 8744 AddHistogramSampleCallback callback) {
8748 reinterpret_cast<i::Isolate*>(this) 8745 reinterpret_cast<i::Isolate*>(this)
8749 ->stats_table() 8746 ->counters()
8750 ->SetAddHistogramSampleFunction(callback); 8747 ->SetAddHistogramSampleFunction(callback);
8751 } 8748 }
8752 8749
8753 8750
8754 bool Isolate::IdleNotification(int idle_time_in_ms) { 8751 bool Isolate::IdleNotification(int idle_time_in_ms) {
8755 // Returning true tells the caller that it need not 8752 // Returning true tells the caller that it need not
8756 // continue to call IdleNotification. 8753 // continue to call IdleNotification.
8757 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 8754 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
8758 if (!i::FLAG_use_idle_notification) return true; 8755 if (!i::FLAG_use_idle_notification) return true;
8759 return isolate->heap()->IdleNotification(idle_time_in_ms); 8756 return isolate->heap()->IdleNotification(idle_time_in_ms);
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after
10536 Address callback_address = 10533 Address callback_address =
10537 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 10534 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
10538 VMState<EXTERNAL> state(isolate); 10535 VMState<EXTERNAL> state(isolate);
10539 ExternalCallbackScope call_scope(isolate, callback_address); 10536 ExternalCallbackScope call_scope(isolate, callback_address);
10540 callback(info); 10537 callback(info);
10541 } 10538 }
10542 10539
10543 10540
10544 } // namespace internal 10541 } // namespace internal
10545 } // namespace v8 10542 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698