Skip to content

Commit 0702ea3

Browse files
bmeurerCommit bot
authored andcommitted
[turbofan] Don't take into account source size for inlining heuristics.
The source size is not a real indicator for whether or not to inline a certain function. [email protected], [email protected] BUG=v8:3354,v8:5267 Committed: https://chromium.googlesource.com/v8/v8/+/1b33028607637ba8cb2d60433811f825b00a0cc1 Review-Url: https://codereview.chromium.org/2361813002 Cr-Commit-Position: refs/heads/master@{#39681}
1 parent 85575cd commit 0702ea3

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

src/compiler/js-inlining-heuristic.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ bool CanInlineFunction(Handle<JSFunction> function) {
4949
// Don't inline builtins.
5050
if (function->shared()->IsBuiltin()) return false;
5151

52-
// Quick check on source code length to avoid parsing large candidate.
53-
if (function->shared()->SourceSize() > FLAG_max_inlined_source_size) {
54-
return false;
55-
}
56-
5752
// Quick check on the size of the AST to avoid parsing large candidate.
5853
if (function->shared()->ast_node_count() > FLAG_max_inlined_nodes) {
5954
return false;
@@ -287,9 +282,7 @@ void JSInliningHeuristic::PrintCandidates() {
287282
candidate.node->op()->mnemonic(), candidate.frequency);
288283
for (int i = 0; i < candidate.num_functions; ++i) {
289284
Handle<JSFunction> function = candidate.functions[i];
290-
PrintF(" - size[source]:%d, size[ast]:%d, name: %s\n",
291-
function->shared()->SourceSize(),
292-
function->shared()->ast_node_count(),
285+
PrintF(" - size:%d, name: %s\n", function->shared()->ast_node_count(),
293286
function->shared()->DebugName()->ToCString().get());
294287
}
295288
}

test/cctest/test-heap-profiler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,6 +2583,7 @@ TEST(TrackHeapAllocationsWithInlining) {
25832583
}
25842584

25852585
TEST(TrackHeapAllocationsWithoutInlining) {
2586+
i::FLAG_turbo_inlining = false;
25862587
i::FLAG_max_inlined_source_size = 0; // Disable inlining
25872588
v8::HandleScope scope(v8::Isolate::GetCurrent());
25882589
LocalContext env;

test/mjsunit/es6/tail-call-megatest.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ function checkStackTrace(expected) {
2525

2626
var CAN_INLINE_COMMENT = "// Let it be inlined.";
2727
var DONT_INLINE_COMMENT = (function() {
28-
var line = "// Don't inline. Don't inline. Don't inline. Don't inline.";
29-
for (var i = 0; i < 4; i++) {
30-
line += "\n " + line;
28+
var line = "1";
29+
for (var i = 0; i < 200; ++i) {
30+
line += "," + i;
3131
}
32+
line += ";\n";
3233
return line;
3334
})();
3435

test/mozilla/mozilla.status

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@
191191
'js1_5/GC/regress-278725': [PASS, ['mode == debug', FAIL]],
192192
# http://b/issue?id=1206983
193193
'js1_5/Regress/regress-367561-03': [PASS, ['mode == debug', FAIL], NO_VARIANTS],
194+
'ecma/FunctionObjects/15.3.1.1-3': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
195+
'ecma/FunctionObjects/15.3.2.1-3': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
196+
'ecma/FunctionObjects/15.3.5-1': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
194197
'ecma/Date/15.9.5.10-2': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
195198

196199
# These tests create two Date objects just after each other and

0 commit comments

Comments
 (0)