var bucket = ORDERED_HASH_TABLE_HASH_TO_BUCKET(hash, numBuckets);
return ORDERED_HASH_TABLE_BUCKET_AT(table, bucket);
}
-%SetInlineBuiltinFlag(HashToEntry);
+%SetForceInlineFlag(HashToEntry);
function SetFindEntry(table, numBuckets, key, hash) {
}
return NOT_FOUND;
}
-%SetInlineBuiltinFlag(SetFindEntry);
+%SetForceInlineFlag(SetFindEntry);
function MapFindEntry(table, numBuckets, key, hash) {
}
return NOT_FOUND;
}
-%SetInlineBuiltinFlag(MapFindEntry);
+%SetForceInlineFlag(MapFindEntry);
function ComputeIntegerHash(key, seed) {
hash = hash ^ (hash >>> 16);
return hash;
}
-%SetInlineBuiltinFlag(ComputeIntegerHash);
+%SetForceInlineFlag(ComputeIntegerHash);
function GetHash(key) {
}
return %GenericHash(key);
}
-%SetInlineBuiltinFlag(GetHash);
+%SetForceInlineFlag(GetHash);
// -------------------------------------------------------------------
if (isolate_->debug()->is_active()) MarkAsDebug();
if (FLAG_context_specialization) MarkAsContextSpecializing();
- if (FLAG_turbo_builtin_inlining) MarkAsBuiltinInliningEnabled();
if (FLAG_turbo_deoptimization) MarkAsDeoptimizationEnabled();
if (FLAG_turbo_inlining) MarkAsInliningEnabled();
if (FLAG_turbo_source_positions) MarkAsSourcePositionsEnabled();
kTypingEnabled = 1 << 11,
kDisableFutureOptimization = 1 << 12,
kSplittingEnabled = 1 << 13,
- kBuiltinInliningEnabled = 1 << 14,
- kTypeFeedbackEnabled = 1 << 15,
- kDeoptimizationEnabled = 1 << 16,
- kSourcePositionsEnabled = 1 << 17
+ kTypeFeedbackEnabled = 1 << 14,
+ kDeoptimizationEnabled = 1 << 15,
+ kSourcePositionsEnabled = 1 << 16
};
explicit CompilationInfo(ParseInfo* parse_info);
bool is_inlining_enabled() const { return GetFlag(kInliningEnabled); }
- void MarkAsBuiltinInliningEnabled() { SetFlag(kBuiltinInliningEnabled); }
-
- bool is_builtin_inlining_enabled() const {
- return GetFlag(kBuiltinInliningEnabled);
- }
-
void MarkAsTypingEnabled() { SetFlag(kTypingEnabled); }
bool is_typing_enabled() const { return GetFlag(kTypingEnabled); }
Handle<JSFunction> function = match.Value().handle();
if (!function->IsJSFunction()) return NoChange();
- if (mode_ == kBuiltinsInlining && !function->shared()->inline_builtin()) {
+ if (mode_ == kRestrictedInlining && !function->shared()->force_inline()) {
return NoChange();
}
class JSInliner final : public AdvancedReducer {
public:
- enum Mode { kBuiltinsInlining, kGeneralInlining };
+ enum Mode { kRestrictedInlining, kGeneralInlining };
JSInliner(Editor* editor, Mode mode, Zone* local_zone, CompilationInfo* info,
JSGraph* jsgraph)
GraphReducer graph_reducer(data->graph(), temp_zone);
JSInliner inliner(&graph_reducer, data->info()->is_inlining_enabled()
? JSInliner::kGeneralInlining
- : JSInliner::kBuiltinsInlining,
+ : JSInliner::kRestrictedInlining,
temp_zone, data->info(), data->jsgraph());
AddReducer(data, &graph_reducer, &inliner);
graph_reducer.ReduceGraph();
RunPrintAndVerify("Context specialized", true);
}
- if (info()->is_builtin_inlining_enabled() || info()->is_inlining_enabled()) {
- Run<InliningPhase>();
- RunPrintAndVerify("Inlined", true);
- }
+ Run<InliningPhase>();
+ RunPrintAndVerify("Inlined", true);
if (FLAG_print_turbo_replay) {
// Print a replay of the initial graph.
"enable context specialization in TurboFan")
DEFINE_BOOL(turbo_deoptimization, false, "enable deoptimization in TurboFan")
DEFINE_BOOL(turbo_inlining, false, "enable inlining in TurboFan")
-DEFINE_BOOL(turbo_builtin_inlining, true, "enable builtin inlining in TurboFan")
DEFINE_BOOL(trace_turbo_inlining, false, "trace TurboFan inlining")
DEFINE_BOOL(loop_assignment_analysis, true, "perform loop assignment analysis")
DEFINE_BOOL(turbo_profiling, false, "enable profiling in TurboFan")
Handle<JSFunction> caller = current_info()->closure();
Handle<SharedFunctionInfo> target_shared(target->shared());
- // Always inline builtins marked for inlining.
+ // Always inline functions that force inlining.
+ if (target_shared->force_inline()) {
+ return 0;
+ }
if (target->IsBuiltin()) {
- return target_shared->inline_builtin() ? 0 : kNotInlinable;
+ return kNotInlinable;
}
if (target_shared->IsApiFunction()) {
"cbrt", MathCbrt
]);
-%SetInlineBuiltinFlag(MathAbs);
-%SetInlineBuiltinFlag(MathAcosJS);
-%SetInlineBuiltinFlag(MathAsinJS);
-%SetInlineBuiltinFlag(MathAtanJS);
-%SetInlineBuiltinFlag(MathAtan2JS);
-%SetInlineBuiltinFlag(MathCeil);
-%SetInlineBuiltinFlag(MathClz32JS);
-%SetInlineBuiltinFlag(MathFloorJS);
-%SetInlineBuiltinFlag(MathRandom);
-%SetInlineBuiltinFlag(MathSign);
-%SetInlineBuiltinFlag(MathSqrtJS);
-%SetInlineBuiltinFlag(MathTrunc);
+%SetForceInlineFlag(MathAbs);
+%SetForceInlineFlag(MathAcosJS);
+%SetForceInlineFlag(MathAsinJS);
+%SetForceInlineFlag(MathAtanJS);
+%SetForceInlineFlag(MathAtan2JS);
+%SetForceInlineFlag(MathCeil);
+%SetForceInlineFlag(MathClz32JS);
+%SetForceInlineFlag(MathFloorJS);
+%SetForceInlineFlag(MathRandom);
+%SetForceInlineFlag(MathSign);
+%SetForceInlineFlag(MathSqrtJS);
+%SetForceInlineFlag(MathTrunc);
// Expose to the global scope.
$abs = MathAbs;
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, uses_super_property,
kUsesSuperProperty)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, native, kNative)
-BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, inline_builtin,
- kInlineBuiltin)
+BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline, kForceInline)
BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints,
name_should_print_as_anonymous,
kNameShouldPrintAsAnonymous)
// global object.
DECL_BOOLEAN_ACCESSORS(native)
- // Indicate that this builtin needs to be inlined in crankshaft.
- DECL_BOOLEAN_ACCESSORS(inline_builtin)
+ // Indicate that this function should always be inlined in optimized code.
+ DECL_BOOLEAN_ACCESSORS(force_inline)
// Indicates that the function was created by the Function function.
// Though it's anonymous, toString should treat it as if it had the name
kUsesSuperProperty,
kHasDuplicateParameters,
kNative,
- kInlineBuiltin,
+ kForceInline,
kBoundFunction,
kIsAnonymous,
kNameShouldPrintAsAnonymous,
}
-RUNTIME_FUNCTION(Runtime_SetInlineBuiltinFlag) {
+RUNTIME_FUNCTION(Runtime_SetForceInlineFlag) {
SealHandleScope shs(isolate);
RUNTIME_ASSERT(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
if (object->IsJSFunction()) {
JSFunction* func = JSFunction::cast(*object);
- func->shared()->set_inline_builtin(true);
+ func->shared()->set_force_inline(true);
}
return isolate->heap()->undefined_value();
}
F(SetNativeFlag, 1, 1) \
F(ThrowStrongModeTooFewArguments, 0, 1) \
F(IsConstructor, 1, 1) \
- F(SetInlineBuiltinFlag, 1, 1) \
+ F(SetForceInlineFlag, 1, 1) \
F(FunctionBindArguments, 4, 1) \
F(BoundFunctionGetBindings, 1, 1) \
F(NewObjectFromBound, 1, 1) \
"expm1", MathExpm1
]);
-%SetInlineBuiltinFlag(MathSin);
-%SetInlineBuiltinFlag(MathCos);
+%SetForceInlineFlag(MathSin);
+%SetForceInlineFlag(MathCos);
})
"parseFloat", GlobalParseFloat
]);
-%SetInlineBuiltinFlag(NumberIsNaN);
+%SetForceInlineFlag(NumberIsNaN);
// ----------------------------------------------------------------------------
flags_(flags) {
Compile(function);
const uint32_t supported_flags = CompilationInfo::kContextSpecializing |
- CompilationInfo::kBuiltinInliningEnabled |
CompilationInfo::kInliningEnabled |
CompilationInfo::kTypingEnabled;
CHECK_EQ(0u, flags_ & ~supported_flags);
}
-const uint32_t kBuiltinInlineFlags = CompilationInfo::kBuiltinInliningEnabled |
- CompilationInfo::kContextSpecializing |
- CompilationInfo::kTypingEnabled;
+const uint32_t kRestrictedInliningFlags =
+ CompilationInfo::kContextSpecializing | CompilationInfo::kTypingEnabled;
const uint32_t kInlineFlags = CompilationInfo::kInliningEnabled |
CompilationInfo::kContextSpecializing |
"(function () {"
" function foo(s,t,u) { AssertInlineCount(2); return true; }"
" function bar() { return foo(); };"
- " %SetInlineBuiltinFlag(foo);"
+ " %SetForceInlineFlag(foo);"
" return bar;"
"})();",
- kBuiltinInlineFlags);
+ kRestrictedInliningFlags);
InstallAssertInlineCountHelper(CcTest::isolate());
T.CheckCall(T.true_value());
" function foo(s,t,u) { AssertInlineCount(3); return true; }"
" function baz(s,t,u) { return foo(s,t,u); }"
" function bar() { return baz(); };"
- " %SetInlineBuiltinFlag(foo);"
- " %SetInlineBuiltinFlag(baz);"
+ " %SetForceInlineFlag(foo);"
+ " %SetForceInlineFlag(baz);"
" return bar;"
"})();",
- kBuiltinInlineFlags);
+ kRestrictedInliningFlags);
InstallAssertInlineCountHelper(CcTest::isolate());
T.CheckCall(T.true_value());