| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 324 |
| 325 // This loop will terminate once the scanning hits an EOF. | 325 // This loop will terminate once the scanning hits an EOF. |
| 326 while (true) { | 326 while (true) { |
| 327 uintptr_t start, end; | 327 uintptr_t start, end; |
| 328 char attr_r, attr_w, attr_x, attr_p; | 328 char attr_r, attr_w, attr_x, attr_p; |
| 329 // Parse the addresses and permission bits at the beginning of the line. | 329 // Parse the addresses and permission bits at the beginning of the line. |
| 330 if (fscanf(fp, "%" V8PRIxPTR "-%" V8PRIxPTR, &start, &end) != 2) break; | 330 if (fscanf(fp, "%" V8PRIxPTR "-%" V8PRIxPTR, &start, &end) != 2) break; |
| 331 if (fscanf(fp, " %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4) break; | 331 if (fscanf(fp, " %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4) break; |
| 332 | 332 |
| 333 int c; | 333 int c; |
| 334 if (attr_r == 'r' && attr_x == 'x') { | 334 if (attr_r == 'r' && attr_w != 'w' && attr_x == 'x') { |
| 335 // Found a readable and executable entry. Skip characters until we reach | 335 // Found a read-only executable entry. Skip characters until we reach |
| 336 // the beginning of the filename or the end of the line. | 336 // the beginning of the filename or the end of the line. |
| 337 do { | 337 do { |
| 338 c = getc(fp); | 338 c = getc(fp); |
| 339 } while ((c != EOF) && (c != '\n') && (c != '/')); | 339 } while ((c != EOF) && (c != '\n') && (c != '/')); |
| 340 if (c == EOF) break; // EOF: Was unexpected, just exit. | 340 if (c == EOF) break; // EOF: Was unexpected, just exit. |
| 341 | 341 |
| 342 // Process the filename if found. | 342 // Process the filename if found. |
| 343 if (c == '/') { | 343 if (c == '/') { |
| 344 ungetc(c, fp); // Push the '/' back into the stream to be read below. | 344 ungetc(c, fp); // Push the '/' back into the stream to be read below. |
| 345 | 345 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 830 |
| 831 // This sampler is no longer the active sampler. | 831 // This sampler is no longer the active sampler. |
| 832 active_sampler_ = NULL; | 832 active_sampler_ = NULL; |
| 833 active_ = false; | 833 active_ = false; |
| 834 } | 834 } |
| 835 | 835 |
| 836 | 836 |
| 837 #endif // ENABLE_LOGGING_AND_PROFILING | 837 #endif // ENABLE_LOGGING_AND_PROFILING |
| 838 | 838 |
| 839 } } // namespace v8::internal | 839 } } // namespace v8::internal |
| OLD | NEW |