Reviewers: titzer,

Description:
Make compiler more acceptive wrt Isolate::use_crankshaft.

This allows using %OptimizeFunctionOnNextCall and friends even when
Crankshaft is disabled. Note that this should only affect code paths
that are not relevant to performance. By now we have a single bailout
point in place within OptimizedCompileJob::CreateGraph that ensures
Crankshaft is only used when enabled and supported.

[email protected]

Please review this at https://codereview.chromium.org/999173007/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+2, -9 lines):
  M src/factory.cc
  M src/objects.cc
  M src/runtime/runtime-compiler.cc
  M src/runtime/runtime-test.cc


Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index d999cd5034849f773774b5beff7efad3f892bee5..5dac6a1ada3454980e348caf6a76b8268d51ee0d 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1353,8 +1353,8 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {

 static bool ShouldOptimizeNewClosure(Isolate* isolate,
                                      Handle<SharedFunctionInfo> info) {
-  return isolate->use_crankshaft() && !info->is_toplevel() &&
-         info->is_compiled() && info->allows_lazy_compilation();
+  return !info->is_toplevel() && info->is_compiled() &&
+         info->allows_lazy_compilation();
 }


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 10e45b510b734fe951f995e8792482d97caded3c..ae69d811ec1bace6ed2dba0bbe73a5d494b79217 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9602,7 +9602,6 @@ void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {

 void JSFunction::MarkForOptimization() {
   Isolate* isolate = GetIsolate();
-  DCHECK(isolate->use_crankshaft());
   DCHECK(!IsOptimized());
   DCHECK(shared()->allows_lazy_compilation() || code()->optimizable());
   set_code_no_write_barrier(
@@ -9626,7 +9625,6 @@ void JSFunction::AttemptConcurrentOptimization() {
     // recompilation race.  This goes away as soon as OSR becomes one-shot.
     return;
   }
-  DCHECK(isolate->use_crankshaft());
   DCHECK(!IsInOptimizationQueue());
   DCHECK(is_compiled() || isolate->debug()->has_break_points());
   DCHECK(!IsOptimized());
Index: src/runtime/runtime-compiler.cc
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc index 0958da13a10ed550f9c5213442571d98af1e1dc9..52fe1e7a8b91ec7e391e30e3e1b074492444da23 100644
--- a/src/runtime/runtime-compiler.cc
+++ b/src/runtime/runtime-compiler.cc
@@ -47,7 +47,6 @@ RUNTIME_FUNCTION(Runtime_CompileOptimized) {
   DCHECK(args.length() == 2);
   CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
   CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1);
-  DCHECK(isolate->use_crankshaft());

   Compiler::ConcurrencyMode mode =
       concurrent ? Compiler::CONCURRENT : Compiler::NOT_CONCURRENT;
Index: src/runtime/runtime-test.cc
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc
index c5e3f15f32174a4789f46b3287ef03d1285ca3c9..8b402f9b2aba1f725ed3125dff85555bffc5cf03 100644
--- a/src/runtime/runtime-test.cc
+++ b/src/runtime/runtime-test.cc
@@ -89,8 +89,6 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
                  (function->code()->kind() == Code::FUNCTION &&
                   function->code()->optimizable()));

- if (!isolate->use_crankshaft()) return isolate->heap()->undefined_value();
-
   // If the function is already optimized, just return.
   if (function->IsOptimized()) return isolate->heap()->undefined_value();

@@ -136,8 +134,6 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
                  (function->code()->kind() == Code::FUNCTION &&
                   function->code()->optimizable()));

- if (!isolate->use_crankshaft()) return isolate->heap()->undefined_value();
-
   // If the function is already optimized, just return.
   if (function->IsOptimized()) return isolate->heap()->undefined_value();



--
--
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/d/optout.

Reply via email to