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/compiler/graph-visualizer.h" | 5 #include "src/compiler/graph-visualizer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace v8 { | 27 namespace v8 { |
28 namespace internal { | 28 namespace internal { |
29 namespace compiler { | 29 namespace compiler { |
30 | 30 |
31 std::unique_ptr<char[]> GetVisualizerLogFileName(CompilationInfo* info, | 31 std::unique_ptr<char[]> GetVisualizerLogFileName(CompilationInfo* info, |
32 const char* phase, | 32 const char* phase, |
33 const char* suffix) { | 33 const char* suffix) { |
34 EmbeddedVector<char, 256> filename(0); | 34 EmbeddedVector<char, 256> filename(0); |
35 std::unique_ptr<char[]> debug_name = info->GetDebugName(); | 35 std::unique_ptr<char[]> debug_name = info->GetDebugName(); |
36 if (strlen(debug_name.get()) > 0) { | 36 if (strlen(debug_name.get()) > 0) { |
37 SNPrintF(filename, "turbo-%s", debug_name.get()); | 37 if (info->has_shared_info()) { |
| 38 int attempt = info->shared_info()->opt_count(); |
| 39 SNPrintF(filename, "turbo-%s-%i", debug_name.get(), attempt); |
| 40 } else { |
| 41 SNPrintF(filename, "turbo-%s", debug_name.get()); |
| 42 } |
38 } else if (info->has_shared_info()) { | 43 } else if (info->has_shared_info()) { |
39 SNPrintF(filename, "turbo-%p", static_cast<void*>(info)); | 44 int attempt = info->shared_info()->opt_count(); |
| 45 SNPrintF(filename, "turbo-%p-%i", static_cast<void*>(info), attempt); |
40 } else { | 46 } else { |
41 SNPrintF(filename, "turbo-none-%s", phase); | 47 SNPrintF(filename, "turbo-none-%s", phase); |
42 } | 48 } |
43 EmbeddedVector<char, 256> source_file(0); | 49 EmbeddedVector<char, 256> source_file(0); |
44 bool source_available = false; | 50 bool source_available = false; |
45 if (FLAG_trace_file_names && info->parse_info()) { | 51 if (FLAG_trace_file_names && info->parse_info()) { |
46 Object* source_name = info->script()->name(); | 52 Object* source_name = info->script()->name(); |
47 if (source_name->IsString()) { | 53 if (source_name->IsString()) { |
48 String* str = String::cast(source_name); | 54 String* str = String::cast(source_name); |
49 if (str->length() > 0) { | 55 if (str->length() > 0) { |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 os << "]"; | 714 os << "]"; |
709 } | 715 } |
710 os << std::endl; | 716 os << std::endl; |
711 } | 717 } |
712 } | 718 } |
713 return os; | 719 return os; |
714 } | 720 } |
715 } // namespace compiler | 721 } // namespace compiler |
716 } // namespace internal | 722 } // namespace internal |
717 } // namespace v8 | 723 } // namespace v8 |
OLD | NEW |