Revision: 15184
Author:   [email protected]
Date:     Mon Jun 17 09:27:18 2013
Log: Allow running mjsunit/manual-parallel-recompile on single-core systems.

- Add an %IsParallelSupported() builtin function to make possible to check support of parallel processing from JavaScripts. - Change the test script that if parallel recompilation is forced on a single core CPU, expect that it won't be recompiled in parallel. - Change the JSFunction::MarkForParallelRecompilation() to fall back gracefully if parallel recompilation is not supported.

BUG=v8:2733
TEST=mjsunit/manual-parallel-recompile

Review URL: https://codereview.chromium.org/17277002
Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=15184

Modified:
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/src/runtime.h
 /branches/bleeding_edge/test/mjsunit/manual-parallel-recompile.js

=======================================
--- /branches/bleeding_edge/src/objects.cc      Fri Jun 14 09:06:12 2013
+++ /branches/bleeding_edge/src/objects.cc      Mon Jun 17 09:27:18 2013
@@ -9198,7 +9198,10 @@
 void JSFunction::MarkForParallelRecompilation() {
   ASSERT(is_compiled() && !IsOptimized());
   ASSERT(shared()->allows_lazy_compilation() || code()->optimizable());
-  ASSERT(FLAG_parallel_recompilation);
+  if (!FLAG_parallel_recompilation) {
+    JSFunction::MarkForLazyRecompilation();
+    return;
+  }
   if (FLAG_trace_parallel_recompilation) {
     PrintF("  ** Marking ");
     PrintName();
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Fri Jun 14 09:06:12 2013
+++ /branches/bleeding_edge/src/runtime.cc      Mon Jun 17 09:27:18 2013
@@ -8068,6 +8068,13 @@
   return isolate->heap()->false_value();
 #endif
 }
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_IsParallelRecompilationSupported) {
+  HandleScope scope(isolate);
+  return FLAG_parallel_recompilation
+      ? isolate->heap()->true_value() : isolate->heap()->false_value();
+}


 RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) {
=======================================
--- /branches/bleeding_edge/src/runtime.h       Wed Jun 12 02:43:22 2013
+++ /branches/bleeding_edge/src/runtime.h       Mon Jun 17 09:27:18 2013
@@ -95,6 +95,7 @@
   F(DeoptimizeFunction, 1, 1) \
   F(ClearFunctionTypeFeedback, 1, 1) \
   F(RunningInSimulator, 0, 1) \
+  F(IsParallelRecompilationSupported, 0, 1) \
   F(OptimizeFunctionOnNextCall, -1, 1) \
   F(CompleteOptimization, 1, 1) \
   F(GetOptimizationStatus, 1, 1) \
=======================================
--- /branches/bleeding_edge/test/mjsunit/manual-parallel-recompile.js Wed Jun 12 02:43:22 2013 +++ /branches/bleeding_edge/test/mjsunit/manual-parallel-recompile.js Mon Jun 17 09:27:18 2013
@@ -60,8 +60,10 @@
 %OptimizeFunctionOnNextCall(g, "parallel");
 f(g(2));  // Trigger optimization.

-assertUnoptimized(f);  // Not yet optimized.
-assertUnoptimized(g);
+if (%IsParallelRecompilationSupported()) {
+  assertUnoptimized(f);  // Not yet optimized.
+  assertUnoptimized(g);
+}

 %CompleteOptimization(f);  // Wait till optimized code is installed.
 %CompleteOptimization(g);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to