Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: src/compiler/graph-visualizer.cc

Issue 1297203002: Add CompileInfo::GetDebugName() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@interpreter_immed_bytecodes
Patch Set: Fix test crash Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-visualizer.cc
diff --git a/src/compiler/graph-visualizer.cc b/src/compiler/graph-visualizer.cc
index bf3d8edea418d654344baf9c85d479eb78badb37..527469686796cc6cfa5da5b17784a440d231154c 100644
--- a/src/compiler/graph-visualizer.cc
+++ b/src/compiler/graph-visualizer.cc
@@ -18,6 +18,7 @@
#include "src/compiler/register-allocator.h"
#include "src/compiler/schedule.h"
#include "src/compiler/scheduler.h"
+#include "src/interpreter/bytecodes.h"
#include "src/ostreams.h"
namespace v8 {
@@ -28,14 +29,11 @@ namespace compiler {
FILE* OpenVisualizerLogFile(CompilationInfo* info, const char* phase,
const char* suffix, const char* mode) {
EmbeddedVector<char, 256> filename(0);
- base::SmartArrayPointer<char> function_name;
- if (info->has_shared_info()) {
- function_name = info->shared_info()->DebugName()->ToCString();
- if (strlen(function_name.get()) > 0) {
- SNPrintF(filename, "turbo-%s", function_name.get());
- } else {
- SNPrintF(filename, "turbo-%p", static_cast<void*>(info));
- }
+ base::SmartArrayPointer<char> debug_name = info->GetDebugName();
+ if (strlen(debug_name.get()) > 0) {
+ SNPrintF(filename, "turbo-%s", debug_name.get());
+ } else if (info->has_shared_info()) {
+ SNPrintF(filename, "turbo-%p", static_cast<void*>(info));
} else {
SNPrintF(filename, "turbo-none-%s", phase);
}
@@ -491,15 +489,14 @@ void GraphC1Visualizer::PrintIntProperty(const char* name, int value) {
void GraphC1Visualizer::PrintCompilation(const CompilationInfo* info) {
Tag tag(this, "compilation");
+ base::SmartArrayPointer<char> name = info->GetDebugName();
if (info->IsOptimizing()) {
- Handle<String> name = info->literal()->debug_name();
- PrintStringProperty("name", name->ToCString().get());
+ PrintStringProperty("name", name.get());
PrintIndent();
- os_ << "method \"" << name->ToCString().get() << ":"
- << info->optimization_id() << "\"\n";
+ os_ << "method \"" << name.get() << ":" << info->optimization_id()
+ << "\"\n";
} else {
- CodeStub::Major major_key = info->code_stub()->MajorKey();
- PrintStringProperty("name", CodeStub::MajorName(major_key, false));
+ PrintStringProperty("name", name.get());
PrintStringProperty("method", "stub");
}
PrintLongProperty("date",
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698