OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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-heuristic.h" | 5 #include "src/compiler/js-inlining-heuristic.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 break; | 41 break; |
42 } | 42 } |
43 | 43 |
44 // --------------------------------------------------------------------------- | 44 // --------------------------------------------------------------------------- |
45 // Everything below this line is part of the inlining heuristic. | 45 // Everything below this line is part of the inlining heuristic. |
46 // --------------------------------------------------------------------------- | 46 // --------------------------------------------------------------------------- |
47 | 47 |
48 // Built-in functions are handled by the JSBuiltinReducer. | 48 // Built-in functions are handled by the JSBuiltinReducer. |
49 if (function->shared()->HasBuiltinFunctionId()) return NoChange(); | 49 if (function->shared()->HasBuiltinFunctionId()) return NoChange(); |
50 | 50 |
| 51 // Don't inline builtins. |
| 52 if (function->shared()->IsBuiltin()) return NoChange(); |
| 53 |
51 // Quick check on source code length to avoid parsing large candidate. | 54 // Quick check on source code length to avoid parsing large candidate. |
52 if (function->shared()->SourceSize() > FLAG_max_inlined_source_size) { | 55 if (function->shared()->SourceSize() > FLAG_max_inlined_source_size) { |
53 return NoChange(); | 56 return NoChange(); |
54 } | 57 } |
55 | 58 |
56 // Quick check on the size of the AST to avoid parsing large candidate. | 59 // Quick check on the size of the AST to avoid parsing large candidate. |
57 if (function->shared()->ast_node_count() > FLAG_max_inlined_nodes) { | 60 if (function->shared()->ast_node_count() > FLAG_max_inlined_nodes) { |
58 return NoChange(); | 61 return NoChange(); |
59 } | 62 } |
60 | 63 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 candidate.node->id(), candidate.calls, | 119 candidate.node->id(), candidate.calls, |
117 candidate.function->shared()->SourceSize(), | 120 candidate.function->shared()->SourceSize(), |
118 candidate.function->shared()->ast_node_count(), | 121 candidate.function->shared()->ast_node_count(), |
119 candidate.function->shared()->DebugName()->ToCString().get()); | 122 candidate.function->shared()->DebugName()->ToCString().get()); |
120 } | 123 } |
121 } | 124 } |
122 | 125 |
123 } // namespace compiler | 126 } // namespace compiler |
124 } // namespace internal | 127 } // namespace internal |
125 } // namespace v8 | 128 } // namespace v8 |
OLD | NEW |