Commit 5114f14c authored by Mythri's avatar Mythri Committed by Commit Bot

[TurboFan] Remove SetForceInline

SetForceInline flag is no longer used. This flag was added for
inlining some of the javascript builtins. They are now ported to
TurboFan builtins. This cl removes SetForceInline runtime function
and the corresponding bits in the SharedFunctionInfo. Also update
inlining heuristics to not look for this bit.

Bug: v8:6682
Change-Id: Ie8df9648332b765a556e24609c38b4e55b810527
Reviewed-on: https://chromium-review.googlesource.com/668436Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48065}
parent d6ff0822
......@@ -103,8 +103,7 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
return NoChange();
}
// Functions marked with %SetForceInlineFlag are immediately inlined.
bool can_inline = false, force_inline = true, small_inline = true;
bool can_inline = false, small_inline = true;
candidate.total_size = 0;
Node* frame_state = NodeProperties::GetFrameStateInput(node);
FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state);
......@@ -114,9 +113,6 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
candidate.functions[i].is_null()
? candidate.shared_info
: handle(candidate.functions[i]->shared());
if (!shared->force_inline()) {
force_inline = false;
}
candidate.can_inline_function[i] = CanInlineFunction(shared);
// Do not allow direct recursion i.e. f() -> f(). We still allow indirect
// recurion like f() -> g() -> f(). The indirect recursion is helpful in
......@@ -141,7 +137,6 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
small_inline = false;
}
}
if (force_inline) return InlineCandidate(candidate, true);
if (!can_inline) return NoChange();
// Stop inlining once the maximum allowed level is reached.
......@@ -613,7 +608,7 @@ void JSInliningHeuristic::CreateOrReuseDispatch(Node* node, Node* callee,
}
Reduction JSInliningHeuristic::InlineCandidate(Candidate const& candidate,
bool force_inline) {
bool small_function) {
int const num_calls = candidate.num_functions;
Node* const node = candidate.node;
if (num_calls == 1) {
......@@ -684,7 +679,7 @@ Reduction JSInliningHeuristic::InlineCandidate(Candidate const& candidate,
for (int i = 0; i < num_calls; ++i) {
Handle<JSFunction> function = candidate.functions[i];
Node* node = calls[i];
if (force_inline ||
if (small_function ||
(candidate.can_inline_function[i] &&
cumulative_count_ < FLAG_max_inlined_bytecode_size_cumulative)) {
Reduction const reduction = inliner_.ReduceJSCall(node);
......
......@@ -63,7 +63,7 @@ class JSInliningHeuristic final : public AdvancedReducer {
// Dumps candidates to console.
void PrintCandidates();
Reduction InlineCandidate(Candidate const& candidate, bool force_inline);
Reduction InlineCandidate(Candidate const& candidate, bool small_function);
void CreateOrReuseDispatch(Node* node, Node* callee,
Candidate const& candidate, Node** if_successes,
Node** calls, Node** inputs, int input_count);
......
......@@ -94,8 +94,6 @@ BIT_FIELD_ACCESSORS(SharedFunctionInfo, compiler_hints, is_declaration,
BIT_FIELD_ACCESSORS(SharedFunctionInfo, compiler_hints, native,
SharedFunctionInfo::IsNativeBit)
BIT_FIELD_ACCESSORS(SharedFunctionInfo, compiler_hints, force_inline,
SharedFunctionInfo::ForceInlineBit)
BIT_FIELD_ACCESSORS(SharedFunctionInfo, compiler_hints, is_asm_wasm_broken,
SharedFunctionInfo::IsAsmWasmBrokenBit)
......
......@@ -302,9 +302,6 @@ class SharedFunctionInfo : public HeapObject {
// global object.
DECL_BOOLEAN_ACCESSORS(native)
// Indicate that this function should always be inlined in optimized code.
DECL_BOOLEAN_ACCESSORS(force_inline)
// Whether this function was created from a FunctionDeclaration.
DECL_BOOLEAN_ACCESSORS(is_declaration)
......@@ -473,7 +470,6 @@ class SharedFunctionInfo : public HeapObject {
V(AllowLazyCompilationBit, bool, 1, _) \
V(UsesArgumentsBit, bool, 1, _) \
V(NeedsHomeObjectBit, bool, 1, _) \
V(ForceInlineBit, bool, 1, _) \
V(IsDeclarationBit, bool, 1, _) \
V(IsAsmWasmBrokenBit, bool, 1, _) \
V(FunctionMapIndexBits, int, 5, _) \
......
......@@ -205,18 +205,6 @@ RUNTIME_FUNCTION(Runtime_IsConstructor) {
return isolate->heap()->ToBoolean(object->IsConstructor());
}
RUNTIME_FUNCTION(Runtime_SetForceInlineFlag) {
SealHandleScope shs(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_CHECKED(Object, object, 0);
if (object->IsJSFunction()) {
JSFunction* func = JSFunction::cast(object);
func->shared()->set_force_inline(true);
}
return isolate->heap()->undefined_value();
}
RUNTIME_FUNCTION(Runtime_Call) {
HandleScope scope(isolate);
......
......@@ -227,7 +227,6 @@ namespace internal {
F(SetCode, 2, 1) \
F(SetNativeFlag, 1, 1) \
F(IsConstructor, 1, 1) \
F(SetForceInlineFlag, 1, 1) \
F(Call, -1 /* >= 2 */, 1) \
F(ConvertReceiver, 1, 1) \
F(IsFunction, 1, 1) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment