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/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Compiling for the snapshot typically results in different code than | 59 // Compiling for the snapshot typically results in different code than |
60 // compiling later on. This means that code recompiled with deoptimization | 60 // compiling later on. This means that code recompiled with deoptimization |
61 // support won't be "equivalent" (as defined by SharedFunctionInfo:: | 61 // support won't be "equivalent" (as defined by SharedFunctionInfo:: |
62 // EnableDeoptimizationSupport), so it will replace the old code and all | 62 // EnableDeoptimizationSupport), so it will replace the old code and all |
63 // its type feedback. To avoid this, always compile functions in the snapshot | 63 // its type feedback. To avoid this, always compile functions in the snapshot |
64 // with deoptimization support. | 64 // with deoptimization support. |
65 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); | 65 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); |
66 | 66 |
67 if (FLAG_function_context_specialization) MarkAsFunctionContextSpecializing(); | 67 if (FLAG_function_context_specialization) MarkAsFunctionContextSpecializing(); |
68 if (FLAG_turbo_source_positions) MarkAsSourcePositionsEnabled(); | |
69 if (FLAG_turbo_splitting) MarkAsSplittingEnabled(); | 68 if (FLAG_turbo_splitting) MarkAsSplittingEnabled(); |
| 69 |
| 70 if (FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph || |
| 71 FLAG_turbo_profiling || isolate_->is_profiling()) { |
| 72 MarkAsSourcePositionsEnabled(); |
| 73 } |
70 } | 74 } |
71 | 75 |
72 CompilationInfo::CompilationInfo(Vector<const char> debug_name, | 76 CompilationInfo::CompilationInfo(Vector<const char> debug_name, |
73 Isolate* isolate, Zone* zone, | 77 Isolate* isolate, Zone* zone, |
74 Code::Flags code_flags) | 78 Code::Flags code_flags) |
75 : CompilationInfo(nullptr, debug_name, code_flags, STUB, isolate, zone) {} | 79 : CompilationInfo(nullptr, debug_name, code_flags, STUB, isolate, zone) {} |
76 | 80 |
77 CompilationInfo::CompilationInfo(ParseInfo* parse_info, | 81 CompilationInfo::CompilationInfo(ParseInfo* parse_info, |
78 Vector<const char> debug_name, | 82 Vector<const char> debug_name, |
79 Code::Flags code_flags, Mode mode, | 83 Code::Flags code_flags, Mode mode, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 inlined_functions_.push_back(InlinedFunctionHolder( | 223 inlined_functions_.push_back(InlinedFunctionHolder( |
220 inlined_function, handle(inlined_function->code()))); | 224 inlined_function, handle(inlined_function->code()))); |
221 } | 225 } |
222 | 226 |
223 Code::Kind CompilationInfo::output_code_kind() const { | 227 Code::Kind CompilationInfo::output_code_kind() const { |
224 return Code::ExtractKindFromFlags(code_flags_); | 228 return Code::ExtractKindFromFlags(code_flags_); |
225 } | 229 } |
226 | 230 |
227 } // namespace internal | 231 } // namespace internal |
228 } // namespace v8 | 232 } // namespace v8 |
OLD | NEW |