OLD | NEW |
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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 // Parse the addresses and permission bits at the beginning of the line. | 528 // Parse the addresses and permission bits at the beginning of the line. |
529 if (fscanf(fp, "%" V8PRIxPTR "-%" V8PRIxPTR, &start, &end) != 2) break; | 529 if (fscanf(fp, "%" V8PRIxPTR "-%" V8PRIxPTR, &start, &end) != 2) break; |
530 if (fscanf(fp, " %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4) break; | 530 if (fscanf(fp, " %c%c%c%c", &attr_r, &attr_w, &attr_x, &attr_p) != 4) break; |
531 | 531 |
532 int c; | 532 int c; |
533 if (attr_r == 'r' && attr_w != 'w' && attr_x == 'x') { | 533 if (attr_r == 'r' && attr_w != 'w' && attr_x == 'x') { |
534 // Found a read-only executable entry. Skip characters until we reach | 534 // Found a read-only executable entry. Skip characters until we reach |
535 // the beginning of the filename or the end of the line. | 535 // the beginning of the filename or the end of the line. |
536 do { | 536 do { |
537 c = getc(fp); | 537 c = getc(fp); |
538 } while ((c != EOF) && (c != '\n') && (c != '/')); | 538 } while ((c != EOF) && (c != '\n') && (c != '/') && (c != '[')); |
539 if (c == EOF) break; // EOF: Was unexpected, just exit. | 539 if (c == EOF) break; // EOF: Was unexpected, just exit. |
540 | 540 |
541 // Process the filename if found. | 541 // Process the filename if found. |
542 if (c == '/') { | 542 if ((c == '/') || (c == '[')) { |
543 ungetc(c, fp); // Push the '/' back into the stream to be read below. | 543 // Push the '/' or '[' back into the stream to be read below. |
| 544 ungetc(c, fp); |
544 | 545 |
545 // Read to the end of the line. Exit if the read fails. | 546 // Read to the end of the line. Exit if the read fails. |
546 if (fgets(lib_name, kLibNameLen, fp) == NULL) break; | 547 if (fgets(lib_name, kLibNameLen, fp) == NULL) break; |
547 | 548 |
548 // Drop the newline character read by fgets. We do not need to check | 549 // Drop the newline character read by fgets. We do not need to check |
549 // for a zero-length string because we know that we at least read the | 550 // for a zero-length string because we know that we at least read the |
550 // '/' character. | 551 // '/' or '[' character. |
551 lib_name[strlen(lib_name) - 1] = '\0'; | 552 lib_name[strlen(lib_name) - 1] = '\0'; |
552 } else { | 553 } else { |
553 // No library name found, just record the raw address range. | 554 // No library name found, just record the raw address range. |
554 snprintf(lib_name, kLibNameLen, | 555 snprintf(lib_name, kLibNameLen, |
555 "%08" V8PRIxPTR "-%08" V8PRIxPTR, start, end); | 556 "%08" V8PRIxPTR "-%08" V8PRIxPTR, start, end); |
556 } | 557 } |
557 LOG(isolate, SharedLibraryEvent(lib_name, start, end)); | 558 LOG(isolate, SharedLibraryEvent(lib_name, start, end)); |
558 } else { | 559 } else { |
559 // Entry not describing executable data. Skip to end of line to set up | 560 // Entry not describing executable data. Skip to end of line to set up |
560 // reading the next entry. | 561 // reading the next entry. |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 | 1311 |
1311 | 1312 |
1312 void Sampler::Stop() { | 1313 void Sampler::Stop() { |
1313 ASSERT(IsActive()); | 1314 ASSERT(IsActive()); |
1314 SignalSender::RemoveActiveSampler(this); | 1315 SignalSender::RemoveActiveSampler(this); |
1315 SetActive(false); | 1316 SetActive(false); |
1316 } | 1317 } |
1317 | 1318 |
1318 | 1319 |
1319 } } // namespace v8::internal | 1320 } } // namespace v8::internal |
OLD | NEW |