dont_optimize_reason_ = reason;
DisableSelfOptimization();
}
+ void DisableCrankshaft(BailoutReason reason) {
+ if (FLAG_turbo_shipping) {
+ return properties_.flags()->Add(kDontCrankshaft);
+ }
+ dont_optimize_reason_ = reason;
+ DisableSelfOptimization();
+ }
void DisableCaching(BailoutReason reason) {
dont_optimize_reason_ = reason;
DisableSelfOptimization();
void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) {
IncrementNodeCount();
if (node->var()->IsLookupSlot()) {
- DisableOptimization(kReferenceToAVariableWhichRequiresDynamicLookup);
+ DisableCrankshaft(kReferenceToAVariableWhichRequiresDynamicLookup);
}
ReserveFeedbackSlots(node);
node->set_base_id(ReserveIdRange(VariableProxy::num_ids()));
void AstNumberingVisitor::VisitWithStatement(WithStatement* node) {
IncrementNodeCount();
- DisableOptimization(kWithStatement);
+ DisableCrankshaft(kWithStatement);
node->set_base_id(ReserveIdRange(WithStatement::num_ids()));
Visit(node->expression());
Visit(node->statement());
void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) {
IncrementNodeCount();
- DisableOptimization(kForOfStatement);
+ DisableCrankshaft(kForOfStatement);
node->set_base_id(ReserveIdRange(ForOfStatement::num_ids()));
Visit(node->assign_iterator());
Visit(node->next_result());
}
if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval);
if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) {
- DisableOptimization(kContextAllocatedArguments);
+ DisableCrankshaft(kContextAllocatedArguments);
}
VisitDeclarations(scope->declarations());
enum AstPropertiesFlag {
kDontSelfOptimize,
kDontSoftInline,
+ kDontCrankshaft,
kDontCache
};
DCHECK(info()->shared_info()->has_deoptimization_support());
// Check the enabling conditions for TurboFan.
+ bool dont_crankshaft = info()->shared_info()->dont_crankshaft();
if (((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
+ (dont_crankshaft && strcmp(FLAG_turbo_filter, "~~") == 0) ||
info()->closure()->PassesFilter(FLAG_turbo_filter)) &&
(FLAG_turbo_osr || !info()->is_osr())) {
// Use TurboFan for the compilation.
}
}
- if (!isolate()->use_crankshaft()) {
+ if (!isolate()->use_crankshaft() || dont_crankshaft) {
// Crankshaft is entirely disabled.
return SetLastStatus(FAILED);
}
FunctionLiteral* lit = parse_info->function();
shared_info->set_ast_node_count(lit->ast_node_count());
MaybeDisableOptimization(shared_info, lit->dont_optimize_reason());
+ shared_info->set_dont_crankshaft(lit->flags()->Contains(kDontCrankshaft));
shared_info->set_dont_cache(lit->flags()->Contains(kDontCache));
}
return true;
// Flags for TurboFan.
DEFINE_BOOL(turbo, false, "enable TurboFan compiler")
+DEFINE_BOOL(turbo_shipping, false, "enable TurboFan compiler on subset")
DEFINE_BOOL(turbo_greedy_regalloc, false, "use the greedy register allocator")
DEFINE_IMPLICATION(turbo, turbo_asm_deoptimization)
DEFINE_STRING(turbo_filter, "~~", "optimization filter for TurboFan compiler")
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, bound, kBoundFunction)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_anonymous, kIsAnonymous)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_function, kIsFunction)
+BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_crankshaft,
+ kDontCrankshaft)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_cache, kDontCache)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_arrow, kIsArrow)
if (lit->dont_optimize_reason() != kNoReason) {
shared_info->DisableOptimization(lit->dont_optimize_reason());
}
+ shared_info->set_dont_crankshaft(
+ lit->flags()->Contains(AstPropertiesFlag::kDontCrankshaft));
shared_info->set_dont_cache(
lit->flags()->Contains(AstPropertiesFlag::kDontCache));
shared_info->set_kind(lit->kind());
// Is this a function or top-level/eval code.
DECL_BOOLEAN_ACCESSORS(is_function)
+ // Indicates that code for this function cannot be compiled with Crankshaft.
+ DECL_BOOLEAN_ACCESSORS(dont_crankshaft)
+
// Indicates that code for this function cannot be cached.
DECL_BOOLEAN_ACCESSORS(dont_cache)
kIsAnonymous,
kNameShouldPrintAsAnonymous,
kIsFunction,
+ kDontCrankshaft,
kDontCache,
kDontFlush,
kIsArrow,