OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 7933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7944 | 7944 |
7945 | 7945 |
7946 int HOptimizedGraphBuilder::InliningAstSize(Handle<JSFunction> target) { | 7946 int HOptimizedGraphBuilder::InliningAstSize(Handle<JSFunction> target) { |
7947 if (!FLAG_use_inlining) return kNotInlinable; | 7947 if (!FLAG_use_inlining) return kNotInlinable; |
7948 | 7948 |
7949 // Precondition: call is monomorphic and we have found a target with the | 7949 // Precondition: call is monomorphic and we have found a target with the |
7950 // appropriate arity. | 7950 // appropriate arity. |
7951 Handle<JSFunction> caller = current_info()->closure(); | 7951 Handle<JSFunction> caller = current_info()->closure(); |
7952 Handle<SharedFunctionInfo> target_shared(target->shared()); | 7952 Handle<SharedFunctionInfo> target_shared(target->shared()); |
7953 | 7953 |
7954 // Always inline builtins marked for inlining. | 7954 // Always inline functions that force inlining. |
| 7955 if (target_shared->force_inline()) { |
| 7956 return 0; |
| 7957 } |
7955 if (target->IsBuiltin()) { | 7958 if (target->IsBuiltin()) { |
7956 return target_shared->inline_builtin() ? 0 : kNotInlinable; | 7959 return kNotInlinable; |
7957 } | 7960 } |
7958 | 7961 |
7959 if (target_shared->IsApiFunction()) { | 7962 if (target_shared->IsApiFunction()) { |
7960 TraceInline(target, caller, "target is api function"); | 7963 TraceInline(target, caller, "target is api function"); |
7961 return kNotInlinable; | 7964 return kNotInlinable; |
7962 } | 7965 } |
7963 | 7966 |
7964 // Do a quick check on source code length to avoid parsing large | 7967 // Do a quick check on source code length to avoid parsing large |
7965 // inlining candidates. | 7968 // inlining candidates. |
7966 if (target_shared->SourceSize() > | 7969 if (target_shared->SourceSize() > |
(...skipping 5160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13127 if (ShouldProduceTraceOutput()) { | 13130 if (ShouldProduceTraceOutput()) { |
13128 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13131 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13129 } | 13132 } |
13130 | 13133 |
13131 #ifdef DEBUG | 13134 #ifdef DEBUG |
13132 graph_->Verify(false); // No full verify. | 13135 graph_->Verify(false); // No full verify. |
13133 #endif | 13136 #endif |
13134 } | 13137 } |
13135 | 13138 |
13136 } } // namespace v8::internal | 13139 } } // namespace v8::internal |
OLD | NEW |