Revision: 16646
Author:   [email protected]
Date:     Wed Sep 11 10:59:39 2013 UTC
Log:      thread isolate for logging calls

[email protected]
BUG=

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

Modified:
 /branches/bleeding_edge/src/isolate.cc
 /branches/bleeding_edge/src/log.cc
 /branches/bleeding_edge/src/platform-cygwin.cc
 /branches/bleeding_edge/src/platform-freebsd.cc
 /branches/bleeding_edge/src/platform-linux.cc
 /branches/bleeding_edge/src/platform-macos.cc
 /branches/bleeding_edge/src/platform-openbsd.cc
 /branches/bleeding_edge/src/platform-solaris.cc
 /branches/bleeding_edge/src/platform-win32.cc
 /branches/bleeding_edge/src/platform.h
 /branches/bleeding_edge/src/string-stream.cc
 /branches/bleeding_edge/src/string-stream.h

=======================================
--- /branches/bleeding_edge/src/isolate.cc      Tue Sep 10 11:32:15 2013 UTC
+++ /branches/bleeding_edge/src/isolate.cc      Wed Sep 11 10:59:39 2013 UTC
@@ -866,7 +866,7 @@
     PrintStack(&accumulator);
     accumulator.OutputToFile(out);
     InitializeLoggingAndCounters();
-    accumulator.Log();
+    accumulator.Log(this);
     incomplete_message_ = NULL;
     stack_trace_nesting_level_ = 0;
     if (preallocated_message_space_ == NULL) {
=======================================
--- /branches/bleeding_edge/src/log.cc  Wed Sep 11 07:28:47 2013 UTC
+++ /branches/bleeding_edge/src/log.cc  Wed Sep 11 10:59:39 2013 UTC
@@ -656,7 +656,7 @@
   if (engaged_) return;
   engaged_ = true;

-  OS::LogSharedLibraryAddresses();
+  OS::LogSharedLibraryAddresses(isolate_);

   // Start thread processing the profiler buffer.
   running_ = true;
=======================================
--- /branches/bleeding_edge/src/platform-cygwin.cc Wed Sep 11 08:47:02 2013 UTC +++ /branches/bleeding_edge/src/platform-cygwin.cc Wed Sep 11 10:59:39 2013 UTC
@@ -126,7 +126,7 @@
 }


-void OS::LogSharedLibraryAddresses() {
+void OS::LogSharedLibraryAddresses(Isolate* isolate) {
   // This function assumes that the layout of the file is as follows:
   // hex_start_addr-hex_end_addr rwxp <unused data> [binary_file_name]
// If we encounter an unexpected situation we abort scanning further entries.
@@ -137,7 +137,6 @@
   const int kLibNameLen = FILENAME_MAX + 1;
   char* lib_name = reinterpret_cast<char*>(malloc(kLibNameLen));

-  i::Isolate* isolate = Isolate::Current();
   // This loop will terminate once the scanning hits an EOF.
   while (true) {
     uintptr_t start, end;
=======================================
--- /branches/bleeding_edge/src/platform-freebsd.cc Wed Sep 11 08:47:02 2013 UTC +++ /branches/bleeding_edge/src/platform-freebsd.cc Wed Sep 11 10:59:39 2013 UTC
@@ -139,7 +139,7 @@
 }


-void OS::LogSharedLibraryAddresses() {
+void OS::LogSharedLibraryAddresses(Isolate* isolate) {
   static const int MAP_LENGTH = 1024;
   int fd = open("/proc/self/maps", O_RDONLY);
   if (fd < 0) return;
@@ -173,7 +173,7 @@
     // There may be no filename in this line.  Skip to next.
     if (start_of_path == NULL) continue;
     buffer[bytes_read] = 0;
- LOG(i::Isolate::Current(), SharedLibraryEvent(start_of_path, start, end));
+    LOG(isolate SharedLibraryEvent(start_of_path, start, end));
   }
   close(fd);
 }
=======================================
--- /branches/bleeding_edge/src/platform-linux.cc Wed Sep 11 08:47:02 2013 UTC +++ /branches/bleeding_edge/src/platform-linux.cc Wed Sep 11 10:59:39 2013 UTC
@@ -213,7 +213,7 @@
 }


-void OS::LogSharedLibraryAddresses() {
+void OS::LogSharedLibraryAddresses(Isolate* isolate) {
   // This function assumes that the layout of the file is as follows:
   // hex_start_addr-hex_end_addr rwxp <unused data> [binary_file_name]
// If we encounter an unexpected situation we abort scanning further entries.
@@ -224,7 +224,6 @@
   const int kLibNameLen = FILENAME_MAX + 1;
   char* lib_name = reinterpret_cast<char*>(malloc(kLibNameLen));

-  i::Isolate* isolate = Isolate::Current();
   // This loop will terminate once the scanning hits an EOF.
   while (true) {
     uintptr_t start, end;
=======================================
--- /branches/bleeding_edge/src/platform-macos.cc Wed Sep 11 08:47:02 2013 UTC +++ /branches/bleeding_edge/src/platform-macos.cc Wed Sep 11 10:59:39 2013 UTC
@@ -145,7 +145,7 @@
 }


-void OS::LogSharedLibraryAddresses() {
+void OS::LogSharedLibraryAddresses(Isolate* isolate) {
   unsigned int images_count = _dyld_image_count();
   for (unsigned int i = 0; i < images_count; ++i) {
     const mach_header* header = _dyld_get_image_header(i);
@@ -164,7 +164,7 @@
     if (code_ptr == NULL) continue;
     const uintptr_t slide = _dyld_get_image_vmaddr_slide(i);
     const uintptr_t start = reinterpret_cast<uintptr_t>(code_ptr) + slide;
-    LOG(Isolate::Current(),
+    LOG(isolate,
         SharedLibraryEvent(_dyld_get_image_name(i), start, start + size));
   }
 }
=======================================
--- /branches/bleeding_edge/src/platform-openbsd.cc Wed Sep 11 08:47:02 2013 UTC +++ /branches/bleeding_edge/src/platform-openbsd.cc Wed Sep 11 10:59:39 2013 UTC
@@ -132,7 +132,7 @@
 }


-void OS::LogSharedLibraryAddresses() {
+void OS::LogSharedLibraryAddresses(Isolate* isolate) {
   // This function assumes that the layout of the file is as follows:
   // hex_start_addr-hex_end_addr rwxp <unused data> [binary_file_name]
// If we encounter an unexpected situation we abort scanning further entries.
@@ -143,7 +143,6 @@
   const int kLibNameLen = FILENAME_MAX + 1;
   char* lib_name = reinterpret_cast<char*>(malloc(kLibNameLen));

-  i::Isolate* isolate = Isolate::Current();
   // This loop will terminate once the scanning hits an EOF.
   while (true) {
     uintptr_t start, end;
=======================================
--- /branches/bleeding_edge/src/platform-solaris.cc Wed Sep 11 08:47:02 2013 UTC +++ /branches/bleeding_edge/src/platform-solaris.cc Wed Sep 11 10:59:39 2013 UTC
@@ -149,7 +149,7 @@
 }


-void OS::LogSharedLibraryAddresses() {
+void OS::LogSharedLibraryAddresses(Isolate* isolate) {
 }


=======================================
--- /branches/bleeding_edge/src/platform-win32.cc Wed Sep 11 08:47:02 2013 UTC +++ /branches/bleeding_edge/src/platform-win32.cc Wed Sep 11 10:59:39 2013 UTC
@@ -998,7 +998,7 @@


 // Load the symbols for generating stack traces.
-static bool LoadSymbols(HANDLE process_handle) {
+static bool LoadSymbols(Isolate* isolate, HANDLE process_handle) {
   static bool symbols_loaded = false;

   if (symbols_loaded) return true;
@@ -1047,7 +1047,7 @@
       if (err != ERROR_MOD_NOT_FOUND &&
           err != ERROR_INVALID_HANDLE) return false;
     }
-    LOG(i::Isolate::Current(),
+    LOG(isolate,
         SharedLibraryEvent(
             module_entry.szExePath,
             reinterpret_cast<unsigned int>(module_entry.modBaseAddr),
@@ -1062,14 +1062,14 @@
 }


-void OS::LogSharedLibraryAddresses() {
+void OS::LogSharedLibraryAddresses(Isolate* isolate) {
   // SharedLibraryEvents are logged when loading symbol information.
   // Only the shared libraries loaded at the time of the call to
   // LogSharedLibraryAddresses are logged.  DLLs loaded after
   // initialization are not accounted for.
   if (!LoadDbgHelpAndTlHelp32()) return;
   HANDLE process_handle = GetCurrentProcess();
-  LoadSymbols(process_handle);
+  LoadSymbols(isolate, process_handle);
 }


@@ -1095,7 +1095,7 @@
   HANDLE thread_handle = GetCurrentThread();

   // Read the symbols.
-  if (!LoadSymbols(process_handle)) return kStackWalkError;
+ if (!LoadSymbols(Isolate::Current(), process_handle)) return kStackWalkError;

   // Capture current context.
   CONTEXT context;
@@ -1201,7 +1201,7 @@
 #pragma warning(pop)

 #else  // __MINGW32__
-void OS::LogSharedLibraryAddresses() { }
+void OS::LogSharedLibraryAddresses(Isolate* isolate) { }
 void OS::SignalCodeMovingGC() { }
 int OS::StackWalk(Vector<OS::StackFrame> frames) { return 0; }
 #endif  // __MINGW32__
=======================================
--- /branches/bleeding_edge/src/platform.h      Wed Sep 11 08:47:02 2013 UTC
+++ /branches/bleeding_edge/src/platform.h      Wed Sep 11 10:59:39 2013 UTC
@@ -263,7 +263,7 @@

   // Support for the profiler.  Can do nothing, in which case ticks
   // occuring in shared libraries will not be properly accounted for.
-  static void LogSharedLibraryAddresses();
+  static void LogSharedLibraryAddresses(Isolate* isolate);

   // Support for the profiler.  Notifies the external profiling
   // process that a code moving garbage collection starts.  Can do
=======================================
--- /branches/bleeding_edge/src/string-stream.cc Wed Sep 11 07:28:47 2013 UTC +++ /branches/bleeding_edge/src/string-stream.cc Wed Sep 11 10:59:39 2013 UTC
@@ -269,8 +269,8 @@
 }


-void StringStream::Log() {
-  LOG(Isolate::Current(), StringEvent("StackDump", buffer_));
+void StringStream::Log(Isolate* isolate) {
+  LOG(isolate, StringEvent("StackDump", buffer_));
 }


=======================================
--- /branches/bleeding_edge/src/string-stream.h Tue Sep  3 11:54:08 2013 UTC
+++ /branches/bleeding_edge/src/string-stream.h Wed Sep 11 10:59:39 2013 UTC
@@ -147,7 +147,7 @@
   // Getting the message out.
   void OutputToFile(FILE* out);
   void OutputToStdOut() { OutputToFile(stdout); }
-  void Log();
+  void Log(Isolate* isolate);
   Handle<String> ToString(Isolate* isolate);
   SmartArrayPointer<const char> ToCString() const;
   int length() const { return length_; }

--
--
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