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/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 8700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8711 } | 8711 } |
8712 | 8712 |
8713 | 8713 |
8714 void Isolate::SetUseCounterCallback(UseCounterCallback callback) { | 8714 void Isolate::SetUseCounterCallback(UseCounterCallback callback) { |
8715 reinterpret_cast<i::Isolate*>(this)->SetUseCounterCallback(callback); | 8715 reinterpret_cast<i::Isolate*>(this)->SetUseCounterCallback(callback); |
8716 } | 8716 } |
8717 | 8717 |
8718 | 8718 |
8719 void Isolate::SetCounterFunction(CounterLookupCallback callback) { | 8719 void Isolate::SetCounterFunction(CounterLookupCallback callback) { |
8720 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8720 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8721 isolate->stats_table()->SetCounterFunction(callback); | 8721 isolate->stats_table()->SetCounterFunction(callback, isolate); |
8722 isolate->InitializeLoggingAndCounters(); | |
8723 isolate->counters()->ResetCounters(); | |
8724 } | 8722 } |
8725 | 8723 |
8726 | 8724 |
8727 void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) { | 8725 void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) { |
8728 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8726 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
8729 isolate->stats_table()->SetCreateHistogramFunction(callback); | 8727 isolate->stats_table()->SetCreateHistogramFunction(callback); |
8730 isolate->InitializeLoggingAndCounters(); | 8728 isolate->InitializeLoggingAndCounters(); |
8731 isolate->counters()->ResetHistograms(); | 8729 isolate->counters()->ResetHistograms(); |
8732 isolate->counters()->InitializeHistograms(); | 8730 isolate->counters()->InitializeHistograms(); |
8733 } | 8731 } |
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10513 Address callback_address = | 10511 Address callback_address = |
10514 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10512 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10515 VMState<EXTERNAL> state(isolate); | 10513 VMState<EXTERNAL> state(isolate); |
10516 ExternalCallbackScope call_scope(isolate, callback_address); | 10514 ExternalCallbackScope call_scope(isolate, callback_address); |
10517 callback(info); | 10515 callback(info); |
10518 } | 10516 } |
10519 | 10517 |
10520 | 10518 |
10521 } // namespace internal | 10519 } // namespace internal |
10522 } // namespace v8 | 10520 } // namespace v8 |
OLD | NEW |