| 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 8702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8713 | 8713 |
| 8714 void Isolate::SetCounterFunction(CounterLookupCallback callback) { | 8714 void Isolate::SetCounterFunction(CounterLookupCallback callback) { |
| 8715 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8715 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8716 isolate->stats_table()->SetCounterFunction(callback); | 8716 isolate->stats_table()->SetCounterFunction(callback); |
| 8717 } | 8717 } |
| 8718 | 8718 |
| 8719 | 8719 |
| 8720 void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) { | 8720 void Isolate::SetCreateHistogramFunction(CreateHistogramCallback callback) { |
| 8721 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8721 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8722 isolate->stats_table()->SetCreateHistogramFunction(callback); | 8722 isolate->stats_table()->SetCreateHistogramFunction(callback); |
| 8723 isolate->InitializeLoggingAndCounters(); | |
| 8724 isolate->counters()->ResetHistograms(); | |
| 8725 isolate->counters()->InitializeHistograms(); | |
| 8726 } | 8723 } |
| 8727 | 8724 |
| 8728 | 8725 |
| 8729 void Isolate::SetAddHistogramSampleFunction( | 8726 void Isolate::SetAddHistogramSampleFunction( |
| 8730 AddHistogramSampleCallback callback) { | 8727 AddHistogramSampleCallback callback) { |
| 8731 reinterpret_cast<i::Isolate*>(this) | 8728 reinterpret_cast<i::Isolate*>(this) |
| 8732 ->stats_table() | 8729 ->stats_table() |
| 8733 ->SetAddHistogramSampleFunction(callback); | 8730 ->SetAddHistogramSampleFunction(callback); |
| 8734 } | 8731 } |
| 8735 | 8732 |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10506 Address callback_address = | 10503 Address callback_address = |
| 10507 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10504 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 10508 VMState<EXTERNAL> state(isolate); | 10505 VMState<EXTERNAL> state(isolate); |
| 10509 ExternalCallbackScope call_scope(isolate, callback_address); | 10506 ExternalCallbackScope call_scope(isolate, callback_address); |
| 10510 callback(info); | 10507 callback(info); |
| 10511 } | 10508 } |
| 10512 | 10509 |
| 10513 | 10510 |
| 10514 } // namespace internal | 10511 } // namespace internal |
| 10515 } // namespace v8 | 10512 } // namespace v8 |
| OLD | NEW |