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

Unified Diff: src/runtime.cc

Issue 6879108: Expose optimization info via runtime functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 7 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
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/assert-opt-and-deopt.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 6738213f9b41e466d647495f7bb40a8c43fd68bf..b32ae8a1b4b81a85c4d8e0d1737eea1b367d61b3 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7554,6 +7554,29 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) {
}
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationStatus) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ if (!V8::UseCrankshaft()) {
+ return Smi::FromInt(4); // 4 == "never".
+ }
+ if (FLAG_always_opt) {
+ return Smi::FromInt(3); // 3 == "always".
+ }
+ CONVERT_ARG_CHECKED(JSFunction, function, 0);
+ return function->IsOptimized() ? Smi::FromInt(1) // 1 == "yes".
+ : Smi::FromInt(2); // 2 == "no".
+}
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOptimizationCount) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSFunction, function, 0);
+ return Smi::FromInt(function->shared()->opt_count());
+}
+
+
RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
HandleScope scope(isolate);
ASSERT(args.length() == 1);
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/assert-opt-and-deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698