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

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

Issue 1340313003: [turbofan] Make arguments object materialization inlinable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-arguments-2
Patch Set: Rebased Created 5 years, 3 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/js-generic-lowering.cc ('k') | src/compiler/js-operator.h » ('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 8e9854765837c6319c153c525a4719d8e248939a..5f978358e27d7d4bb960cbc8297ff3da455c0834 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -138,18 +138,17 @@ Reduction JSInliner::InlineCall(Node* call, Node* context, Node* frame_state,
switch (use->opcode()) {
case IrOpcode::kParameter: {
int index = 1 + ParameterIndexOf(use->op());
+ DCHECK_LE(index, inlinee_context_index);
if (index < inliner_inputs && index < inlinee_context_index) {
// There is an input from the call, and the index is a value
// projection but not the context, so rewire the input.
Replace(use, call->InputAt(index));
} else if (index == inlinee_context_index) {
+ // The projection is requesting the inlinee function context.
Replace(use, context);
- } else if (index < inlinee_context_index) {
+ } else {
// Call has fewer arguments than required, fill with undefined.
Replace(use, jsgraph_->UndefinedConstant());
- } else {
- // We got too many arguments, discard for now.
- // TODO(sigurds): Fix to treat arguments array correctly.
}
break;
}
@@ -319,14 +318,6 @@ Reduction JSInliner::Reduce(Node* node) {
return NoChange();
}
- if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) {
- // For now do not inline functions that use their arguments array.
- TRACE("Not inlining %s into %s because inlinee uses arguments array\n",
- function->shared()->DebugName()->ToCString().get(),
- info_->shared_info()->DebugName()->ToCString().get());
- return NoChange();
- }
-
TRACE("Inlining %s into %s\n",
function->shared()->DebugName()->ToCString().get(),
info_->shared_info()->DebugName()->ToCString().get());
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698