| 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 | 879 |
| 880 class SafeStackFrameIterator: public StackFrameIteratorBase { | 880 class SafeStackFrameIterator: public StackFrameIteratorBase { |
| 881 public: | 881 public: |
| 882 SafeStackFrameIterator(Isolate* isolate, | 882 SafeStackFrameIterator(Isolate* isolate, |
| 883 Address fp, Address sp, | 883 Address fp, Address sp, |
| 884 Address low_bound, Address high_bound); | 884 Address low_bound, Address high_bound); |
| 885 | 885 |
| 886 inline JavaScriptFrame* frame() const; | 886 inline JavaScriptFrame* frame() const; |
| 887 void Advance(); | 887 void Advance(); |
| 888 | 888 |
| 889 StackFrame::Type top_frame_type() const { return top_frame_type_; } |
| 890 |
| 889 private: | 891 private: |
| 890 void AdvanceOneFrame(); | 892 void AdvanceOneFrame(); |
| 891 | 893 |
| 892 bool IsValidStackAddress(Address addr) const { | 894 bool IsValidStackAddress(Address addr) const { |
| 893 return low_bound_ <= addr && addr <= high_bound_; | 895 return low_bound_ <= addr && addr <= high_bound_; |
| 894 } | 896 } |
| 895 bool IsValidFrame(StackFrame* frame) const; | 897 bool IsValidFrame(StackFrame* frame) const; |
| 896 bool IsValidCaller(StackFrame* frame); | 898 bool IsValidCaller(StackFrame* frame); |
| 897 bool IsValidExitFrame(Address fp) const; | 899 bool IsValidExitFrame(Address fp) const; |
| 898 bool IsValidTop(ThreadLocalTop* top) const; | 900 bool IsValidTop(ThreadLocalTop* top) const; |
| 899 | 901 |
| 900 const Address low_bound_; | 902 const Address low_bound_; |
| 901 const Address high_bound_; | 903 const Address high_bound_; |
| 904 StackFrame::Type top_frame_type_; |
| 902 }; | 905 }; |
| 903 | 906 |
| 904 | 907 |
| 905 class StackFrameLocator BASE_EMBEDDED { | 908 class StackFrameLocator BASE_EMBEDDED { |
| 906 public: | 909 public: |
| 907 explicit StackFrameLocator(Isolate* isolate) : iterator_(isolate) {} | 910 explicit StackFrameLocator(Isolate* isolate) : iterator_(isolate) {} |
| 908 | 911 |
| 909 // Find the nth JavaScript frame on the stack. The caller must | 912 // Find the nth JavaScript frame on the stack. The caller must |
| 910 // guarantee that such a frame exists. | 913 // guarantee that such a frame exists. |
| 911 JavaScriptFrame* FindJavaScriptFrame(int n); | 914 JavaScriptFrame* FindJavaScriptFrame(int n); |
| 912 | 915 |
| 913 private: | 916 private: |
| 914 StackFrameIterator iterator_; | 917 StackFrameIterator iterator_; |
| 915 }; | 918 }; |
| 916 | 919 |
| 917 | 920 |
| 918 // Reads all frames on the current stack and copies them into the current | 921 // Reads all frames on the current stack and copies them into the current |
| 919 // zone memory. | 922 // zone memory. |
| 920 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 923 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 921 | 924 |
| 922 } } // namespace v8::internal | 925 } } // namespace v8::internal |
| 923 | 926 |
| 924 #endif // V8_FRAMES_H_ | 927 #endif // V8_FRAMES_H_ |
| OLD | NEW |