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 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 sample.pc - code->instruction_start()); | 899 sample.pc - code->instruction_start()); |
900 for (int i = 0; i < ranges->length(); i++) { | 900 for (int i = 0; i < ranges->length(); i++) { |
901 OffsetRange& range = ranges->at(i); | 901 OffsetRange& range = ranges->at(i); |
902 if (range.from <= pc_offset && pc_offset < range.to) { | 902 if (range.from <= pc_offset && pc_offset < range.to) { |
903 return; | 903 return; |
904 } | 904 } |
905 } | 905 } |
906 } | 906 } |
907 *entry++ = pc_entry; | 907 *entry++ = pc_entry; |
908 | 908 |
909 if (pc_entry->builtin_id() == Builtins::kFunctionCall) { | 909 if (pc_entry->builtin_id() == Builtins::kFunctionCall || |
910 // When current function is FunctionCall builtin tos is sometimes | 910 pc_entry->builtin_id() == Builtins::kFunctionApply) { |
911 // address of the function that invoked it but sometimes it's one | 911 // When current function is FunctionCall or FunctionApply builtin the |
912 // of the arguments. We simply replace the frame with 'unknown' entry. | 912 // top frame is either frame of the calling JS function or internal |
913 *entry++ = unresolved_entry_; | 913 // frame. In the latter case we know the caller for sure but in the |
| 914 // former case we don't so we simply replace the frame with |
| 915 // 'unresolved' entry. |
| 916 if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) { |
| 917 *entry++ = unresolved_entry_; |
| 918 } |
914 } | 919 } |
915 } | 920 } |
916 } | 921 } |
917 | 922 |
918 for (const Address* stack_pos = sample.stack, | 923 for (const Address* stack_pos = sample.stack, |
919 *stack_end = stack_pos + sample.frames_count; | 924 *stack_end = stack_pos + sample.frames_count; |
920 stack_pos != stack_end; | 925 stack_pos != stack_end; |
921 ++stack_pos) { | 926 ++stack_pos) { |
922 *entry++ = code_map_.FindEntry(*stack_pos); | 927 *entry++ = code_map_.FindEntry(*stack_pos); |
923 } | 928 } |
(...skipping 11 matching lines...) Expand all Loading... |
935 if (no_symbolized_entries) { | 940 if (no_symbolized_entries) { |
936 *entry++ = EntryForVMState(sample.state); | 941 *entry++ = EntryForVMState(sample.state); |
937 } | 942 } |
938 } | 943 } |
939 | 944 |
940 profiles_->AddPathToCurrentProfiles(entries); | 945 profiles_->AddPathToCurrentProfiles(entries); |
941 } | 946 } |
942 | 947 |
943 | 948 |
944 } } // namespace v8::internal | 949 } } // namespace v8::internal |
OLD | NEW |