Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: src/compiler/js-inlining.cc

Issue 1415133002: Introduce a reference to the code object of inlined functions in CompilationInfo. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweak Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index fb1a722ab858eea7e3cb298b6b07924e5c03de0e..0888944852da3d36e52cc44198b302177517946e 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -348,6 +348,14 @@ Reduction JSInliner::ReduceJSCallFunction(Node* node,
info_->shared_info()->DebugName()->ToCString().get());
return NoChange();
}
+ // Remember that we inlined this function. This needs to be called right
+ // after we ensure deoptimization support so that the code flusher
+ // does not remove the code with the deoptimization support.
+ info_->AddInlinedFunction(info.shared_info());
+
+ // ----------------------------------------------------------------
+ // After this point, we've made a decision to inline this function.
+ // We shall not bailout from inlining if we got here.
TRACE("Inlining %s into %s\n",
function->shared()->DebugName()->ToCString().get(),
@@ -399,6 +407,8 @@ Reduction JSInliner::ReduceJSCallFunction(Node* node,
if (call.formal_arguments() != inlinee_formal_parameters) {
// In strong mode, in case of too few arguments we need to throw a
// TypeError so we must not inline this call.
+ // TODO(jarin) This check should be moved before the decision point
+ // above so that we do not compile the function uselessly.
if (is_strong(info.language_mode()) &&
call.formal_arguments() < inlinee_formal_parameters) {
return NoChange();
@@ -407,9 +417,6 @@ Reduction JSInliner::ReduceJSCallFunction(Node* node,
info.zone());
}
- // Remember that we inlined this function.
- info_->AddInlinedFunction(info.shared_info());
-
return InlineCall(node, context, frame_state, start, end);
}
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/crankshaft/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698