/** Get the version string. */
static const char* GetVersion();
- /**
- * Enables the host application to provide a mechanism for recording
- * statistics counters.
- *
- * Deprecated, use Isolate::SetCounterFunction instead.
- */
- static void SetCounterFunction(CounterLookupCallback);
-
- /**
- * Enables the host application to provide a mechanism for recording
- * histograms. The CreateHistogram function returns a
- * histogram which will later be passed to the AddHistogramSample
- * function.
- *
- * Deprecated, use Isolate::SetCreateHistogramFunction instead.
- * Isolate::SetAddHistogramSampleFunction instead.
- */
- static void SetCreateHistogramFunction(CreateHistogramCallback);
-
- /** Deprecated, use Isolate::SetAddHistogramSampleFunction instead. */
- static void SetAddHistogramSampleFunction(AddHistogramSampleCallback);
-
/** Callback function for reporting failed access checks.*/
static void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback);
}
-void V8::SetCounterFunction(CounterLookupCallback callback) {
- i::Isolate* isolate = i::Isolate::UncheckedCurrent();
- // TODO(svenpanne) The Isolate should really be a parameter.
- if (isolate == NULL) return;
- isolate->stats_table()->SetCounterFunction(callback);
-}
-
-
-void V8::SetCreateHistogramFunction(CreateHistogramCallback callback) {
- i::Isolate* isolate = i::Isolate::UncheckedCurrent();
- // TODO(svenpanne) The Isolate should really be a parameter.
- if (isolate == NULL) return;
- isolate->stats_table()->SetCreateHistogramFunction(callback);
- isolate->InitializeLoggingAndCounters();
- isolate->counters()->ResetHistograms();
-}
-
-
-void V8::SetAddHistogramSampleFunction(AddHistogramSampleCallback callback) {
- i::Isolate* isolate = i::Isolate::UncheckedCurrent();
- // TODO(svenpanne) The Isolate should really be a parameter.
- if (isolate == NULL) return;
- isolate->stats_table()->
- SetAddHistogramSampleFunction(callback);
-}
-
void V8::SetFailedAccessCheckCallbackFunction(
FailedAccessCheckCallback callback) {
i::Isolate* isolate = i::Isolate::Current();
if (i::StrLength(i::FLAG_map_counters) != 0)
MapCounters(isolate, i::FLAG_map_counters);
if (i::FLAG_dump_counters || i::FLAG_track_gc_object_stats) {
- V8::SetCounterFunction(LookupCounter);
- V8::SetCreateHistogramFunction(CreateHistogram);
- V8::SetAddHistogramSampleFunction(AddHistogramSample);
+ isolate->SetCounterFunction(LookupCounter);
+ isolate->SetCreateHistogramFunction(CreateHistogram);
+ isolate->SetAddHistogramSampleFunction(AddHistogramSample);
}
#endif // !V8_SHARED
}