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

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

Issue 1391903002: [turbofan] Separate JSInliningHeuristic into own class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining-heuristic.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/compiler/js-inlining-heuristic.h"
6
7 #include "src/compiler/node-matchers.h"
8 #include "src/objects-inl.h"
9
10 namespace v8 {
11 namespace internal {
12 namespace compiler {
13
14 Reduction JSInliningHeuristic::Reduce(Node* node) {
15 if (node->opcode() != IrOpcode::kJSCallFunction) return NoChange();
16
17 Node* callee = node->InputAt(0);
18 HeapObjectMatcher match(callee);
19 if (!match.HasValue() || !match.Value()->IsJSFunction()) return NoChange();
20 Handle<JSFunction> function = Handle<JSFunction>::cast(match.Value());
21
22 // Functions marked with %SetForceInlineFlag are immediately inlined.
23 if (function->shared()->force_inline()) {
24 return inliner_.ReduceJSCallFunction(node, function);
25 }
26
27 // All other functions are only handled with general inlining.
28 if (mode_ == kRestrictedInlining) return NoChange();
29 return inliner_.ReduceJSCallFunction(node, function);
30 }
31
32 } // namespace compiler
33 } // namespace internal
34 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-inlining-heuristic.h ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698