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

Side by Side Diff: src/profile-generator.cc

Issue 14367020: Revert r14252 as it broke --prof for some cases (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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/log.cc ('k') | src/sampler.h » ('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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.external_callback) { 897 if (sample.has_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
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
OLDNEW
« no previous file with comments | « src/log.cc ('k') | src/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698