Revision: 15882
Author:   [email protected]
Date:     Thu Jul 25 07:11:53 2013
Log:      Make standalone D8 trace to single hydrogen.cfg file.

[email protected]

Review URL: https://codereview.chromium.org/20204005
http://code.google.com/p/v8/source/detail?r=15882

Modified:
 /branches/bleeding_edge/src/d8.cc
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/hydrogen.h

=======================================
--- /branches/bleeding_edge/src/d8.cc   Tue Jul 23 06:44:15 2013
+++ /branches/bleeding_edge/src/d8.cc   Thu Jul 25 07:11:53 2013
@@ -1547,11 +1547,12 @@


 #ifdef V8_SHARED
-static void EnableHarmonyTypedArraysViaCommandLine() {
-  int fake_argc = 2;
-  char **fake_argv = new char*[2];
+static void SetStandaloneFlagsViaCommandLine() {
+  int fake_argc = 3;
+  char **fake_argv = new char*[3];
   fake_argv[0] = NULL;
   fake_argv[1] = strdup("--harmony-typed-arrays");
+  fake_argv[2] = strdup("--trace-hydrogen-file=hydrogen.cfg");
   v8::V8::SetFlagsFromCommandLine(&fake_argc, fake_argv, false);
   free(fake_argv[1]);
   delete[] fake_argv;
@@ -1572,8 +1573,9 @@
 #ifndef V8_SHARED
   i::FLAG_harmony_array_buffer = true;
   i::FLAG_harmony_typed_arrays = true;
+  i::FLAG_trace_hydrogen_file = "hydrogen.cfg";
 #else
-  EnableHarmonyTypedArraysViaCommandLine();
+  SetStandaloneFlagsViaCommandLine();
 #endif
   ShellArrayBufferAllocator array_buffer_allocator;
   v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h      Thu Jul 25 04:53:38 2013
+++ /branches/bleeding_edge/src/flag-definitions.h      Thu Jul 25 07:11:53 2013
@@ -238,6 +238,7 @@
 DEFINE_bool(hydrogen_stats, false, "print statistics for hydrogen")
 DEFINE_bool(trace_hydrogen, false, "trace generated hydrogen to file")
DEFINE_bool(trace_hydrogen_stubs, false, "trace generated hydrogen for stubs") +DEFINE_string(trace_hydrogen_file, NULL, "trace hydrogen to given file name") 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")
=======================================
--- /branches/bleeding_edge/src/hydrogen.h      Thu Jul 25 02:37:52 2013
+++ /branches/bleeding_edge/src/hydrogen.h      Thu Jul 25 07:11:53 2013
@@ -2085,10 +2085,14 @@
  public:
   explicit HTracer(int isolate_id)
       : trace_(&string_allocator_), indent_(0) {
-    OS::SNPrintF(filename_,
-                 "hydrogen-%d-%d.cfg",
-                 OS::GetCurrentProcessId(),
-                 isolate_id);
+    if (FLAG_trace_hydrogen_file == NULL) {
+      OS::SNPrintF(filename_,
+                   "hydrogen-%d-%d.cfg",
+                   OS::GetCurrentProcessId(),
+                   isolate_id);
+    } else {
+      OS::StrNCpy(filename_, FLAG_trace_hydrogen_file, filename_.length());
+    }
     WriteChars(filename_.start(), "", 0, false);
   }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to