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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 Address start; | 911 Address start; |
912 CodeEntry* pc_entry = code_map_.FindEntry(sample.pc, &start); | 912 CodeEntry* pc_entry = code_map_.FindEntry(sample.pc, &start); |
913 // If pc is in the function code before it set up stack frame or after the | 913 // If pc is in the function code before it set up stack frame or after the |
914 // frame was destroyed SafeStackTraceFrameIterator incorrectly thinks that | 914 // frame was destroyed SafeStackTraceFrameIterator incorrectly thinks that |
915 // ebp contains return address of the current function and skips caller's | 915 // ebp contains return address of the current function and skips caller's |
916 // frame. Check for this case and just skip such samples. | 916 // frame. Check for this case and just skip such samples. |
917 if (pc_entry) { | 917 if (pc_entry) { |
918 List<OffsetRange>* ranges = pc_entry->no_frame_ranges(); | 918 List<OffsetRange>* ranges = pc_entry->no_frame_ranges(); |
919 if (ranges) { | 919 if (ranges) { |
920 Code* code = Code::cast(HeapObject::FromAddress(start)); | 920 Code* code = Code::cast(HeapObject::FromAddress(start)); |
921 int pc_offset = sample.pc - code->instruction_start(); | 921 int pc_offset = static_cast<int>(sample.pc - code->instruction_start()); |
922 for (int i = 0; i < ranges->length(); i++) { | 922 for (int i = 0; i < ranges->length(); i++) { |
923 OffsetRange& range = ranges->at(i); | 923 OffsetRange& range = ranges->at(i); |
924 if (range.from <= pc_offset && pc_offset < range.to) { | 924 if (range.from <= pc_offset && pc_offset < range.to) { |
925 return; | 925 return; |
926 } | 926 } |
927 } | 927 } |
928 } | 928 } |
929 } | 929 } |
930 *entry++ = pc_entry; | 930 *entry++ = pc_entry; |
931 | 931 |
(...skipping 25 matching lines...) Expand all Loading... |
957 if (no_symbolized_entries) { | 957 if (no_symbolized_entries) { |
958 *entry++ = EntryForVMState(sample.state); | 958 *entry++ = EntryForVMState(sample.state); |
959 } | 959 } |
960 } | 960 } |
961 | 961 |
962 profiles_->AddPathToCurrentProfiles(entries); | 962 profiles_->AddPathToCurrentProfiles(entries); |
963 } | 963 } |
964 | 964 |
965 | 965 |
966 } } // namespace v8::internal | 966 } } // namespace v8::internal |
OLD | NEW |