| 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 void ProfileGenerator::RecordTickSample(const TickSample& sample) { | 887 void ProfileGenerator::RecordTickSample(const TickSample& sample) { |
| 888 // Allocate space for stack frames + pc + function + vm-state. | 888 // Allocate space for stack frames + pc + function + vm-state. |
| 889 ScopedVector<CodeEntry*> entries(sample.frames_count + 3); | 889 ScopedVector<CodeEntry*> entries(sample.frames_count + 3); |
| 890 // As actual number of decoded code entries may vary, initialize | 890 // As actual number of decoded code entries may vary, initialize |
| 891 // entries vector with NULL values. | 891 // entries vector with NULL values. |
| 892 CodeEntry** entry = entries.start(); | 892 CodeEntry** entry = entries.start(); |
| 893 memset(entry, 0, entries.length() * sizeof(*entry)); | 893 memset(entry, 0, entries.length() * sizeof(*entry)); |
| 894 if (sample.pc != NULL) { | 894 if (sample.pc != NULL) { |
| 895 *entry++ = code_map_.FindEntry(sample.pc); | 895 *entry++ = code_map_.FindEntry(sample.pc); |
| 896 | 896 |
| 897 if (sample.has_external_callback) { | 897 if (sample.external_callback) { |
| 898 // Don't use PC when in external callback code, as it can point | 898 // Don't use PC when in external callback code, as it can point |
| 899 // inside callback's code, and we will erroneously report | 899 // inside callback's code, and we will erroneously report |
| 900 // that a callback calls itself. | 900 // that a callback calls itself. |
| 901 *(entries.start()) = NULL; | 901 *(entries.start()) = NULL; |
| 902 *entry++ = code_map_.FindEntry(sample.external_callback); | 902 *entry++ = code_map_.FindEntry(sample.external_callback); |
| 903 } | 903 } |
| 904 | 904 |
| 905 for (const Address* stack_pos = sample.stack, | 905 for (const Address* stack_pos = sample.stack, |
| 906 *stack_end = stack_pos + sample.frames_count; | 906 *stack_end = stack_pos + sample.frames_count; |
| 907 stack_pos != stack_end; | 907 stack_pos != stack_end; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 922 if (no_symbolized_entries) { | 922 if (no_symbolized_entries) { |
| 923 *entry++ = EntryForVMState(sample.state); | 923 *entry++ = EntryForVMState(sample.state); |
| 924 } | 924 } |
| 925 } | 925 } |
| 926 | 926 |
| 927 profiles_->AddPathToCurrentProfiles(entries); | 927 profiles_->AddPathToCurrentProfiles(entries); |
| 928 } | 928 } |
| 929 | 929 |
| 930 | 930 |
| 931 } } // namespace v8::internal | 931 } } // namespace v8::internal |
| OLD | NEW |