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

Side by Side Diff: src/frames.h

Issue 19775017: Fix call stack sampling for the case when native callback invokes JS function (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed test failure in debug mode Created 7 years, 5 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 | « no previous file | src/frames.cc » ('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 29 matching lines...) Expand all
40 // Get the number of registers in a given register list. 40 // Get the number of registers in a given register list.
41 int NumRegs(RegList list); 41 int NumRegs(RegList list);
42 42
43 void SetUpJSCallerSavedCodeData(); 43 void SetUpJSCallerSavedCodeData();
44 44
45 // Return the code of the n-th saved register available to JavaScript. 45 // Return the code of the n-th saved register available to JavaScript.
46 int JSCallerSavedCode(int n); 46 int JSCallerSavedCode(int n);
47 47
48 48
49 // Forward declarations. 49 // Forward declarations.
50 class ExternalCallbackScope;
50 class StackFrameIteratorBase; 51 class StackFrameIteratorBase;
51 class ThreadLocalTop; 52 class ThreadLocalTop;
52 class Isolate; 53 class Isolate;
53 54
54 class InnerPointerToCodeCache { 55 class InnerPointerToCodeCache {
55 public: 56 public:
56 struct InnerPointerToCodeCacheEntry { 57 struct InnerPointerToCodeCacheEntry {
57 Address inner_pointer; 58 Address inner_pointer;
58 Code* code; 59 Code* code;
59 SafepointEntry safepoint_entry; 60 SafepointEntry safepoint_entry;
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 bool IsValidFrame(); 877 bool IsValidFrame();
877 }; 878 };
878 879
879 880
880 class SafeStackFrameIterator: public StackFrameIteratorBase { 881 class SafeStackFrameIterator: public StackFrameIteratorBase {
881 public: 882 public:
882 SafeStackFrameIterator(Isolate* isolate, 883 SafeStackFrameIterator(Isolate* isolate,
883 Address fp, Address sp, 884 Address fp, Address sp,
884 Address js_entry_sp); 885 Address js_entry_sp);
885 886
886 inline JavaScriptFrame* frame() const; 887 inline StackFrame* frame() const;
887 void Advance(); 888 void Advance();
888 889
889 StackFrame::Type top_frame_type() const { return top_frame_type_; } 890 StackFrame::Type top_frame_type() const { return top_frame_type_; }
890 891
891 private: 892 private:
892 void AdvanceOneFrame(); 893 void AdvanceOneFrame();
893 894
894 bool IsValidStackAddress(Address addr) const { 895 bool IsValidStackAddress(Address addr) const {
895 return low_bound_ <= addr && addr <= high_bound_; 896 return low_bound_ <= addr && addr <= high_bound_;
896 } 897 }
897 bool IsValidFrame(StackFrame* frame) const; 898 bool IsValidFrame(StackFrame* frame) const;
898 bool IsValidCaller(StackFrame* frame); 899 bool IsValidCaller(StackFrame* frame);
899 bool IsValidExitFrame(Address fp) const; 900 bool IsValidExitFrame(Address fp) const;
900 bool IsValidTop(ThreadLocalTop* top) const; 901 bool IsValidTop(ThreadLocalTop* top) const;
901 902
902 const Address low_bound_; 903 const Address low_bound_;
903 const Address high_bound_; 904 const Address high_bound_;
904 StackFrame::Type top_frame_type_; 905 StackFrame::Type top_frame_type_;
906 ExternalCallbackScope* external_callback_scope_;
905 }; 907 };
906 908
907 909
908 class StackFrameLocator BASE_EMBEDDED { 910 class StackFrameLocator BASE_EMBEDDED {
909 public: 911 public:
910 explicit StackFrameLocator(Isolate* isolate) : iterator_(isolate) {} 912 explicit StackFrameLocator(Isolate* isolate) : iterator_(isolate) {}
911 913
912 // Find the nth JavaScript frame on the stack. The caller must 914 // Find the nth JavaScript frame on the stack. The caller must
913 // guarantee that such a frame exists. 915 // guarantee that such a frame exists.
914 JavaScriptFrame* FindJavaScriptFrame(int n); 916 JavaScriptFrame* FindJavaScriptFrame(int n);
915 917
916 private: 918 private:
917 StackFrameIterator iterator_; 919 StackFrameIterator iterator_;
918 }; 920 };
919 921
920 922
921 // Reads all frames on the current stack and copies them into the current 923 // Reads all frames on the current stack and copies them into the current
922 // zone memory. 924 // zone memory.
923 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 925 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
924 926
925 } } // namespace v8::internal 927 } } // namespace v8::internal
926 928
927 #endif // V8_FRAMES_H_ 929 #endif // V8_FRAMES_H_
OLDNEW
« no previous file with comments | « no previous file | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698