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

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

Issue 962963006: [turbofan] Support inlining of unguarded loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | test/cctest/compiler/test-run-inlining.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 135e6a1c8319abc828d302754dda491f650853c6..e1d3fcbc0465dfd47ddea53208adff2b53025188 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -79,6 +79,11 @@ class Inlinee {
Node* value_output() {
return NodeProperties::GetValueInput(unique_return(), 0);
}
+ // Return the control output of the graph,
+ // that is the control input of the return statement of the inlinee.
+ Node* control_output() {
+ return NodeProperties::GetControlInput(unique_return(), 0);
+ }
// Return the unique return statement of the graph.
Node* unique_return() {
Node* unique_return = NodeProperties::GetControlInput(end_);
@@ -263,7 +268,19 @@ Reduction Inlinee::InlineAtCall(JSGraph* jsgraph, Node* call) {
}
}
- NodeProperties::ReplaceWithValue(call, value_output(), effect_output());
+ for (Edge edge : call->use_edges()) {
+ if (NodeProperties::IsControlEdge(edge)) {
+ // TODO(turbofan): Handle kIfException uses.
+ DCHECK_EQ(IrOpcode::kIfSuccess, edge.from()->opcode());
+ edge.from()->ReplaceUses(control_output());
+ edge.UpdateTo(nullptr);
+ } else if (NodeProperties::IsEffectEdge(edge)) {
+ edge.UpdateTo(effect_output());
+ } else {
+ edge.UpdateTo(value_output());
+ }
+ }
+
return Reducer::Replace(value_output());
}
@@ -312,16 +329,6 @@ Reduction JSInliner::Reduce(Node* node) {
Handle<JSFunction> function = match.Value().handle();
- if (function->shared()->native()) {
- if (FLAG_trace_turbo_inlining) {
- SmartArrayPointer<char> name =
- function->shared()->DebugName()->ToCString();
- PrintF("Not Inlining %s into %s because inlinee is native\n", name.get(),
- info_->shared_info()->DebugName()->ToCString().get());
- }
- return NoChange();
- }
-
CompilationInfoWithZone info(function);
if (!Compiler::ParseAndAnalyze(&info)) return NoChange();
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-inlining.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698