Add --trace-hydrogen-stubs flag (default = false).
authortitzer@chromium.org <titzer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 24 Jul 2013 12:38:52 +0000 (12:38 +0000)
committertitzer@chromium.org <titzer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 24 Jul 2013 12:38:52 +0000 (12:38 +0000)
BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/20084003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/code-stubs-hydrogen.cc
src/compiler.cc
src/flag-definitions.h

index 1b341b5..7d9a00c 100644 (file)
@@ -129,7 +129,7 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
   // Update the static counter each time a new code stub is generated.
   isolate()->counters()->code_stubs()->Increment();
 
-  if (FLAG_trace_hydrogen) {
+  if (FLAG_trace_hydrogen_stubs) {
     const char* name = CodeStub::MajorName(stub()->MajorKey(), false);
     PrintF("-----------------------------------------------------------\n");
     PrintF("Compiling stub %s using hydrogen\n", name);
index c299577..b5979bc 100644 (file)
@@ -1247,10 +1247,13 @@ CompilationPhase::~CompilationPhase() {
 
 
 bool CompilationPhase::ShouldProduceTraceOutput() const {
-  // Produce trace output if flag is set so that the first letter of the
-  // phase name matches the command line parameter FLAG_trace_phase.
-  return (FLAG_trace_hydrogen &&
-          OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
+  // Trace if the appropriate trace flag is set and the phase name's first
+  // character is in the FLAG_trace_phase command line parameter.
+  bool tracing_on = info()->IsStub() ?
+      FLAG_trace_hydrogen_stubs :
+      FLAG_trace_hydrogen;
+  return (tracing_on &&
+      OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
 }
 
 } }  // namespace v8::internal
index 1b0e33c..d7d2f4a 100644 (file)
@@ -236,7 +236,8 @@ DEFINE_bool(collect_megamorphic_maps_from_stub_cache,
             "crankshaft harvests type feedback from stub cache")
 DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen")
 DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file")
-DEFINE_string(trace_phase, "Z", "trace generated IR for specified phases")
+DEFINE_bool(trace_hydrogen_stubs, false, "trace generated hydrogen for stubs")
+DEFINE_string(trace_phase, "HLZ", "trace generated IR for specified phases")
 DEFINE_bool(trace_inlining, false, "trace inlining decisions")
 DEFINE_bool(trace_alloc, false, "trace register allocator")
 DEFINE_bool(trace_all_uses, false, "trace all use positions")