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

Unified Diff: src/compiler/pipeline.cc

Issue 671043004: [turbofan] cleanup register allocator interface a little (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « no previous file | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index bf64f6665c79d4c7274a8d016e7ec2116cd617fa..a7d5ed14949f3c0c4863e20ca0c16760e88ac7ec 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -259,6 +259,24 @@ static void TraceSchedule(Schedule* schedule) {
}
+static SmartArrayPointer<char> GetDebugName(CompilationInfo* info) {
+ SmartArrayPointer<char> name;
+ if (info->IsStub()) {
+ if (info->code_stub() != NULL) {
+ CodeStub::Major major_key = info->code_stub()->MajorKey();
+ const char* major_name = CodeStub::MajorName(major_key, false);
+ size_t len = strlen(major_name);
+ name.Reset(new char[len]);
+ memcpy(name.get(), major_name, len);
+ }
+ } else {
+ AllowHandleDereference allow_deref;
+ name = info->function()->debug_name()->ToCString();
+ }
+ return name;
+}
+
+
Handle<Code> Pipeline::GenerateCode() {
// This list must be kept in sync with DONT_TURBOFAN_NODE in ast.cc.
if (info()->function()->dont_optimize_reason() == kTryCatchStatement ||
@@ -285,8 +303,7 @@ Handle<Code> Pipeline::GenerateCode() {
if (FLAG_trace_turbo) {
OFStream os(stdout);
os << "---------------------------------------------------\n"
- << "Begin compiling method "
- << info()->function()->debug_name()->ToCString().get()
+ << "Begin compiling method " << GetDebugName(info()).get()
<< " using Turbofan" << std::endl;
TurboCfgFile tcf(isolate());
tcf << AsC1VCompilation(info());
@@ -463,8 +480,7 @@ Handle<Code> Pipeline::GenerateCode() {
if (FLAG_trace_turbo) {
OFStream os(stdout);
os << "--------------------------------------------------\n"
- << "Finished compiling method "
- << info()->function()->debug_name()->ToCString().get()
+ << "Finished compiling method " << GetDebugName(info()).get()
<< " using Turbofan" << std::endl;
}
@@ -556,7 +572,14 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, PipelineData* data) {
return Handle<Code>::null();
}
ZonePool::Scope zone_scope(data->zone_pool());
- RegisterAllocator allocator(zone_scope.zone(), &frame, info(), &sequence);
+
+ SmartArrayPointer<char> debug_name;
+#ifdef DEBUG
+ debug_name = GetDebugName(info());
+#endif
+
+ RegisterAllocator allocator(zone_scope.zone(), &frame, &sequence,
+ debug_name.get());
if (!allocator.Allocate(data->pipeline_statistics())) {
info()->AbortOptimization(kNotEnoughVirtualRegistersRegalloc);
return Handle<Code>::null();
« no previous file with comments | « no previous file | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698