[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.
R=ishell@chromium.org, jarin@chromium.org
BUG=v8:3354,v8:5267
Committed: 1b33028607
Review-Url: https://codereview.chromium.org/2361813002
Cr-Commit-Position: refs/heads/master@{#39681}
This commit is contained in:
parent
85575cd8ee
commit
0702ea3000
@ -49,11 +49,6 @@ bool CanInlineFunction(Handle<JSFunction> function) {
|
||||
// Don't inline builtins.
|
||||
if (function->shared()->IsBuiltin()) return false;
|
||||
|
||||
// Quick check on source code length to avoid parsing large candidate.
|
||||
if (function->shared()->SourceSize() > FLAG_max_inlined_source_size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Quick check on the size of the AST to avoid parsing large candidate.
|
||||
if (function->shared()->ast_node_count() > FLAG_max_inlined_nodes) {
|
||||
return false;
|
||||
@ -287,9 +282,7 @@ void JSInliningHeuristic::PrintCandidates() {
|
||||
candidate.node->op()->mnemonic(), candidate.frequency);
|
||||
for (int i = 0; i < candidate.num_functions; ++i) {
|
||||
Handle<JSFunction> function = candidate.functions[i];
|
||||
PrintF(" - size[source]:%d, size[ast]:%d, name: %s\n",
|
||||
function->shared()->SourceSize(),
|
||||
function->shared()->ast_node_count(),
|
||||
PrintF(" - size:%d, name: %s\n", function->shared()->ast_node_count(),
|
||||
function->shared()->DebugName()->ToCString().get());
|
||||
}
|
||||
}
|
||||
|
@ -2583,6 +2583,7 @@ TEST(TrackHeapAllocationsWithInlining) {
|
||||
}
|
||||
|
||||
TEST(TrackHeapAllocationsWithoutInlining) {
|
||||
i::FLAG_turbo_inlining = false;
|
||||
i::FLAG_max_inlined_source_size = 0; // Disable inlining
|
||||
v8::HandleScope scope(v8::Isolate::GetCurrent());
|
||||
LocalContext env;
|
||||
|
@ -25,10 +25,11 @@ function checkStackTrace(expected) {
|
||||
|
||||
var CAN_INLINE_COMMENT = "// Let it be inlined.";
|
||||
var DONT_INLINE_COMMENT = (function() {
|
||||
var line = "// Don't inline. Don't inline. Don't inline. Don't inline.";
|
||||
for (var i = 0; i < 4; i++) {
|
||||
line += "\n " + line;
|
||||
var line = "1";
|
||||
for (var i = 0; i < 200; ++i) {
|
||||
line += "," + i;
|
||||
}
|
||||
line += ";\n";
|
||||
return line;
|
||||
})();
|
||||
|
||||
|
@ -191,6 +191,9 @@
|
||||
'js1_5/GC/regress-278725': [PASS, ['mode == debug', FAIL]],
|
||||
# http://b/issue?id=1206983
|
||||
'js1_5/Regress/regress-367561-03': [PASS, ['mode == debug', FAIL], NO_VARIANTS],
|
||||
'ecma/FunctionObjects/15.3.1.1-3': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
|
||||
'ecma/FunctionObjects/15.3.2.1-3': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
|
||||
'ecma/FunctionObjects/15.3.5-1': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
|
||||
'ecma/Date/15.9.5.10-2': [PASS, FAIL, ['mode == debug', TIMEOUT, NO_VARIANTS]],
|
||||
|
||||
# These tests create two Date objects just after each other and
|
||||
|
Loading…
Reference in New Issue
Block a user