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

Unified Diff: src/hydrogen.h

Issue 12450003: Separate output files for --trace-hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some simplifications Created 7 years, 10 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.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index a9829a004f2c00f69bd19de4a4f310133177a8c4..6be75816826a9184bd772737af466afd16c9181b 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1581,52 +1581,45 @@ class HPhase BASE_EMBEDDED {
public:
static const char* const kFullCodeGen;
- explicit HPhase(const char* name) { Begin(name, NULL, NULL, NULL); }
- HPhase(const char* name, HGraph* graph) {
- Begin(name, graph, NULL, NULL);
- }
- HPhase(const char* name, LChunk* chunk) {
- Begin(name, NULL, chunk, NULL);
- }
- HPhase(const char* name, LAllocator* allocator) {
- Begin(name, NULL, NULL, allocator);
- }
-
- ~HPhase() {
- End();
- }
+ HPhase(const char* name, Isolate* isolate);
+ HPhase(const char* name, HGraph* graph);
+ HPhase(const char* name, LChunk* chunk);
+ HPhase(const char* name, LAllocator* allocator);
+ ~HPhase();
private:
- void Begin(const char* name,
+ void Init(Isolate* isolate,
+ const char* name,
HGraph* graph,
LChunk* chunk,
LAllocator* allocator);
- void End() const;
- int64_t start_;
+ Isolate* isolate_;
const char* name_;
HGraph* graph_;
LChunk* chunk_;
LAllocator* allocator_;
+ int64_t start_ticks_;
unsigned start_allocation_size_;
};
class HTracer: public Malloced {
public:
+ explicit HTracer(int isolate_id)
+ : trace_(&string_allocator_), indent_(0) {
+ OS::SNPrintF(filename_,
+ "hydrogen-%d-%d.cfg",
+ OS::GetCurrentProcessId(),
+ isolate_id);
+ WriteChars(filename_.start(), "", 0, false);
+ }
+
void TraceCompilation(CompilationInfo* info);
void TraceHydrogen(const char* name, HGraph* graph);
void TraceLithium(const char* name, LChunk* chunk);
void TraceLiveRanges(const char* name, LAllocator* allocator);
- static HTracer* Instance() {
- static SetOncePointer<HTracer> instance;
- if (!instance.is_set()) {
- instance.set(new HTracer("hydrogen.cfg"));
- }
- return instance.get();
- }
-
private:
class Tag BASE_EMBEDDED {
public:
@@ -1651,11 +1644,6 @@ class HTracer: public Malloced {
const char* name_;
};
- explicit HTracer(const char* filename)
- : filename_(filename), trace_(&string_allocator_), indent_(0) {
- WriteChars(filename, "", 0, false);
- }
-
void TraceLiveRange(LiveRange* range, const char* type, Zone* zone);
void Trace(const char* name, HGraph* graph, LChunk* chunk);
void FlushToFile();
@@ -1691,7 +1679,7 @@ class HTracer: public Malloced {
}
}
- const char* filename_;
+ EmbeddedVector<char, 64> filename_;
HeapStringAllocator string_allocator_;
StringStream trace_;
int indent_;
« no previous file with comments | « src/compiler.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698