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

Unified Diff: src/isolate.cc

Issue 346233002: Add a use counter API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« include/v8.h ('K') | « src/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index a4b311f6ecacd7d4b4a760931475bf4d9405c2ec..0210f19d4f51728431f81639da067f6edfe76a3d 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2343,6 +2343,18 @@ void Isolate::RunMicrotasks() {
}
+void Isolate::SetUseCounterCallback(v8::Isolate::UseCounterCallback callback) {
+ ASSERT(!use_counter_callback_);
+ use_counter_callback_ = callback;
+}
+
+
+void Isolate::CountUsage(v8::Isolate::UseCounterFeature feature) {
+ if (use_counter_callback_)
Sven Panne 2014/06/23 09:29:39 Following the good example of the Heartbleed bug h
+ use_counter_callback_(reinterpret_cast<v8::Isolate*>(this), feature);
+}
+
+
bool StackLimitCheck::JsHasOverflowed() const {
StackGuard* stack_guard = isolate_->stack_guard();
#ifdef USE_SIMULATOR
« include/v8.h ('K') | « src/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698