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

Side by Side Diff: src/compiler/js-inlining.cc

Issue 1211243007: [turbofan] Disable recursive inlining for now. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-inlining.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-inlining.h" 5 #include "src/compiler/js-inlining.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/compiler/all-nodes.h" 9 #include "src/compiler/all-nodes.h"
10 #include "src/compiler/ast-graph-builder.h" 10 #include "src/compiler/ast-graph-builder.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 HeapObjectMatcher match(call.jsfunction()); 244 HeapObjectMatcher match(call.jsfunction());
245 if (!match.HasValue()) return NoChange(); 245 if (!match.HasValue()) return NoChange();
246 246
247 if (!match.Value().handle()->IsJSFunction()) return NoChange(); 247 if (!match.Value().handle()->IsJSFunction()) return NoChange();
248 Handle<JSFunction> function = 248 Handle<JSFunction> function =
249 Handle<JSFunction>::cast(match.Value().handle()); 249 Handle<JSFunction>::cast(match.Value().handle());
250 if (mode_ == kRestrictedInlining && !function->shared()->force_inline()) { 250 if (mode_ == kRestrictedInlining && !function->shared()->force_inline()) {
251 return NoChange(); 251 return NoChange();
252 } 252 }
253 253
254 // TODO(turbofan): TranslatedState::GetAdaptedArguments() currently relies on
255 // not inlining recursive functions. We might want to relax that at some
256 // point.
257 for (Node* frame_state = call.frame_state();
258 frame_state->opcode() == IrOpcode::kFrameState;
259 frame_state = frame_state->InputAt(kFrameStateOuterStateInput)) {
260 FrameStateInfo const& info = OpParameter<FrameStateInfo>(frame_state);
261 Handle<SharedFunctionInfo> shared_info;
262 if (info.shared_info().ToHandle(&shared_info) &&
263 *shared_info == function->shared()) {
264 TRACE("Not inlining %s into %s because call is recursive\n",
265 function->shared()->DebugName()->ToCString().get(),
266 info_->shared_info()->DebugName()->ToCString().get());
267 return NoChange();
268 }
269 }
270
254 Zone zone; 271 Zone zone;
255 ParseInfo parse_info(&zone, function); 272 ParseInfo parse_info(&zone, function);
256 CompilationInfo info(&parse_info); 273 CompilationInfo info(&parse_info);
257 if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled(); 274 if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled();
258 275
259 if (!Compiler::ParseAndAnalyze(info.parse_info())) return NoChange(); 276 if (!Compiler::ParseAndAnalyze(info.parse_info())) return NoChange();
260 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange(); 277 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange();
261 278
262 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) { 279 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) {
263 // For now do not inline functions that use their arguments array. 280 // For now do not inline functions that use their arguments array.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 321
305 // Remember that we inlined this function. 322 // Remember that we inlined this function.
306 info_->AddInlinedFunction(info.shared_info()); 323 info_->AddInlinedFunction(info.shared_info());
307 324
308 return InlineCall(node, frame_state, start, end); 325 return InlineCall(node, frame_state, start, end);
309 } 326 }
310 327
311 } // namespace compiler 328 } // namespace compiler
312 } // namespace internal 329 } // namespace internal
313 } // namespace v8 330 } // namespace v8
OLDNEW
« 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