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

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: fix --stress-opt, --nocrankshaft, --always-opt Created 9 years, 8 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
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 42357d6cd329a8c5c7ac5a9fa99ed453c632ad60..19b32854e807b2c7631014ce572fab0b1199d08b 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7424,6 +7424,29 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) {
}
+RUNTIME_FUNCTION(MaybeObject*, Runtime_IsOptimizedFunction) {
danno 2011/05/04 07:47:04 Perhaps this should be called FunctionOptimization
Jakob Kummerow 2011/05/06 15:58:15 Done.
+ 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);

Powered by Google App Engine
This is Rietveld 408576698