| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/compilation-info.h" | 5 #include "src/compilation-info.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 int CompilationInfo::num_parameters_including_this() const { | 117 int CompilationInfo::num_parameters_including_this() const { |
| 118 return num_parameters() + (is_this_defined() ? 1 : 0); | 118 return num_parameters() + (is_this_defined() ? 1 : 0); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool CompilationInfo::is_this_defined() const { return !IsStub(); } | 121 bool CompilationInfo::is_this_defined() const { return !IsStub(); } |
| 122 | 122 |
| 123 // Primitive functions are unlikely to be picked up by the stack-walking | 123 // Primitive functions are unlikely to be picked up by the stack-walking |
| 124 // profiler, so they trigger their own optimization when they're called | 124 // profiler, so they trigger their own optimization when they're called |
| 125 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. | 125 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. |
| 126 bool CompilationInfo::ShouldSelfOptimize() { | 126 bool CompilationInfo::ShouldSelfOptimize() { |
| 127 return FLAG_crankshaft && | 127 return FLAG_opt && FLAG_crankshaft && |
| 128 !(literal()->flags() & AstProperties::kDontSelfOptimize) && | 128 !(literal()->flags() & AstProperties::kDontSelfOptimize) && |
| 129 !literal()->dont_optimize() && | 129 !literal()->dont_optimize() && |
| 130 literal()->scope()->AllowsLazyCompilation() && | 130 literal()->scope()->AllowsLazyCompilation() && |
| 131 !shared_info()->optimization_disabled(); | 131 !shared_info()->optimization_disabled(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void CompilationInfo::ReopenHandlesInNewHandleScope() { | 134 void CompilationInfo::ReopenHandlesInNewHandleScope() { |
| 135 closure_ = Handle<JSFunction>(*closure_); | 135 closure_ = Handle<JSFunction>(*closure_); |
| 136 } | 136 } |
| 137 | 137 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 inlined_function, handle(inlined_function->code()), pos)); | 231 inlined_function, handle(inlined_function->code()), pos)); |
| 232 return id; | 232 return id; |
| 233 } | 233 } |
| 234 | 234 |
| 235 Code::Kind CompilationInfo::output_code_kind() const { | 235 Code::Kind CompilationInfo::output_code_kind() const { |
| 236 return Code::ExtractKindFromFlags(code_flags_); | 236 return Code::ExtractKindFromFlags(code_flags_); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace internal | 239 } // namespace internal |
| 240 } // namespace v8 | 240 } // namespace v8 |
| OLD | NEW |