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

Side by Side Diff: src/platform-freebsd.cc

Issue 23710025: thread isolate for logging calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-cygwin.cc ('k') | src/platform-linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 if (memory_) munmap(memory_, size_); 132 if (memory_) munmap(memory_, size_);
133 fclose(file_); 133 fclose(file_);
134 } 134 }
135 135
136 136
137 static unsigned StringToLong(char* buffer) { 137 static unsigned StringToLong(char* buffer) {
138 return static_cast<unsigned>(strtol(buffer, NULL, 16)); // NOLINT 138 return static_cast<unsigned>(strtol(buffer, NULL, 16)); // NOLINT
139 } 139 }
140 140
141 141
142 void OS::LogSharedLibraryAddresses() { 142 void OS::LogSharedLibraryAddresses(Isolate* isolate) {
143 static const int MAP_LENGTH = 1024; 143 static const int MAP_LENGTH = 1024;
144 int fd = open("/proc/self/maps", O_RDONLY); 144 int fd = open("/proc/self/maps", O_RDONLY);
145 if (fd < 0) return; 145 if (fd < 0) return;
146 while (true) { 146 while (true) {
147 char addr_buffer[11]; 147 char addr_buffer[11];
148 addr_buffer[0] = '0'; 148 addr_buffer[0] = '0';
149 addr_buffer[1] = 'x'; 149 addr_buffer[1] = 'x';
150 addr_buffer[10] = 0; 150 addr_buffer[10] = 0;
151 int result = read(fd, addr_buffer + 2, 8); 151 int result = read(fd, addr_buffer + 2, 8);
152 if (result < 8) break; 152 if (result < 8) break;
(...skipping 13 matching lines...) Expand all
166 result = read(fd, buffer + bytes_read, 1); 166 result = read(fd, buffer + bytes_read, 1);
167 if (result < 1) break; 167 if (result < 1) break;
168 } while (buffer[bytes_read] != '\n'); 168 } while (buffer[bytes_read] != '\n');
169 buffer[bytes_read] = 0; 169 buffer[bytes_read] = 0;
170 // Ignore mappings that are not executable. 170 // Ignore mappings that are not executable.
171 if (buffer[3] != 'x') continue; 171 if (buffer[3] != 'x') continue;
172 char* start_of_path = index(buffer, '/'); 172 char* start_of_path = index(buffer, '/');
173 // There may be no filename in this line. Skip to next. 173 // There may be no filename in this line. Skip to next.
174 if (start_of_path == NULL) continue; 174 if (start_of_path == NULL) continue;
175 buffer[bytes_read] = 0; 175 buffer[bytes_read] = 0;
176 LOG(i::Isolate::Current(), SharedLibraryEvent(start_of_path, start, end)); 176 LOG(isolate SharedLibraryEvent(start_of_path, start, end));
177 } 177 }
178 close(fd); 178 close(fd);
179 } 179 }
180 180
181 181
182 void OS::SignalCodeMovingGC() { 182 void OS::SignalCodeMovingGC() {
183 } 183 }
184 184
185 185
186 int OS::StackWalk(Vector<OS::StackFrame> frames) { 186 int OS::StackWalk(Vector<OS::StackFrame> frames) {
187 return POSIXBacktraceHelper<backtrace, backtrace_symbols>::StackWalk(frames); 187 return POSIXBacktraceHelper<backtrace, backtrace_symbols>::StackWalk(frames);
188 } 188 }
189 189
190 } } // namespace v8::internal 190 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-cygwin.cc ('k') | src/platform-linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698