OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/codegen.h" | 5 #include "src/codegen.h" |
6 | 6 |
7 #if defined(V8_OS_AIX) | 7 #if defined(V8_OS_AIX) |
8 #include <fenv.h> // NOLINT(build/c++11) | 8 #include <fenv.h> // NOLINT(build/c++11) |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 #ifdef ENABLE_DISASSEMBLER | 232 #ifdef ENABLE_DISASSEMBLER |
233 AllowDeferredHandleDereference allow_deference_for_print_code; | 233 AllowDeferredHandleDereference allow_deference_for_print_code; |
234 Isolate* isolate = info->isolate(); | 234 Isolate* isolate = info->isolate(); |
235 bool print_code = | 235 bool print_code = |
236 isolate->bootstrapper()->IsActive() | 236 isolate->bootstrapper()->IsActive() |
237 ? FLAG_print_builtin_code | 237 ? FLAG_print_builtin_code |
238 : (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) || | 238 : (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) || |
239 (info->IsOptimizing() && FLAG_print_opt_code && | 239 (info->IsOptimizing() && FLAG_print_opt_code && |
240 info->shared_info()->PassesFilter(FLAG_print_opt_code_filter))); | 240 info->shared_info()->PassesFilter(FLAG_print_opt_code_filter)) || |
| 241 (info->IsWasm() && FLAG_print_wasm_code)); |
241 if (print_code) { | 242 if (print_code) { |
242 std::unique_ptr<char[]> debug_name = info->GetDebugName(); | 243 std::unique_ptr<char[]> debug_name = info->GetDebugName(); |
243 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); | 244 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); |
244 OFStream os(tracing_scope.file()); | 245 OFStream os(tracing_scope.file()); |
245 | 246 |
246 // Print the source code if available. | 247 // Print the source code if available. |
247 bool print_source = | 248 bool print_source = |
248 info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || | 249 info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || |
249 code->kind() == Code::FUNCTION); | 250 code->kind() == Code::FUNCTION); |
250 if (print_source) { | 251 if (print_source) { |
(...skipping 30 matching lines...) Expand all Loading... |
281 os << "source_position = " << shared->start_position() << "\n"; | 282 os << "source_position = " << shared->start_position() << "\n"; |
282 } | 283 } |
283 code->Disassemble(debug_name.get(), os); | 284 code->Disassemble(debug_name.get(), os); |
284 os << "--- End code ---\n"; | 285 os << "--- End code ---\n"; |
285 } | 286 } |
286 #endif // ENABLE_DISASSEMBLER | 287 #endif // ENABLE_DISASSEMBLER |
287 } | 288 } |
288 | 289 |
289 } // namespace internal | 290 } // namespace internal |
290 } // namespace v8 | 291 } // namespace v8 |
OLD | NEW |