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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // its type feedback. To avoid this, always compile functions in the snapshot | 65 // its type feedback. To avoid this, always compile functions in the snapshot |
66 // with deoptimization support. | 66 // with deoptimization support. |
67 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); | 67 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); |
68 | 68 |
69 if (FLAG_function_context_specialization) MarkAsFunctionContextSpecializing(); | 69 if (FLAG_function_context_specialization) MarkAsFunctionContextSpecializing(); |
70 if (FLAG_turbo_splitting) MarkAsSplittingEnabled(); | 70 if (FLAG_turbo_splitting) MarkAsSplittingEnabled(); |
71 | 71 |
72 // Collect source positions for optimized code when profiling or if debugger | 72 // Collect source positions for optimized code when profiling or if debugger |
73 // is active, to be able to get more precise source positions at the price of | 73 // is active, to be able to get more precise source positions at the price of |
74 // more memory consumption. | 74 // more memory consumption. |
75 if (FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph || | 75 if (isolate_->NeedsSourcePositionsForProfiling()) { |
76 FLAG_turbo_profiling || isolate_->is_profiling() || | |
77 isolate_->debug()->is_active()) { | |
78 MarkAsSourcePositionsEnabled(); | 76 MarkAsSourcePositionsEnabled(); |
79 } | 77 } |
80 } | 78 } |
81 | 79 |
82 CompilationInfo::CompilationInfo(Vector<const char> debug_name, | 80 CompilationInfo::CompilationInfo(Vector<const char> debug_name, |
83 Isolate* isolate, Zone* zone, | 81 Isolate* isolate, Zone* zone, |
84 Code::Flags code_flags) | 82 Code::Flags code_flags) |
85 : CompilationInfo(nullptr, debug_name, code_flags, STUB, isolate, zone) {} | 83 : CompilationInfo(nullptr, debug_name, code_flags, STUB, isolate, zone) {} |
86 | 84 |
87 CompilationInfo::CompilationInfo(ParseInfo* parse_info, | 85 CompilationInfo::CompilationInfo(ParseInfo* parse_info, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 inlined_function, handle(inlined_function->code()), pos)); | 229 inlined_function, handle(inlined_function->code()), pos)); |
232 return id; | 230 return id; |
233 } | 231 } |
234 | 232 |
235 Code::Kind CompilationInfo::output_code_kind() const { | 233 Code::Kind CompilationInfo::output_code_kind() const { |
236 return Code::ExtractKindFromFlags(code_flags_); | 234 return Code::ExtractKindFromFlags(code_flags_); |
237 } | 235 } |
238 | 236 |
239 } // namespace internal | 237 } // namespace internal |
240 } // namespace v8 | 238 } // namespace v8 |
OLD | NEW |