| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 V(STUB, StubFrame) \ | 164 V(STUB, StubFrame) \ |
| 165 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \ | 165 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \ |
| 166 V(INTERNAL, InternalFrame) \ | 166 V(INTERNAL, InternalFrame) \ |
| 167 V(CONSTRUCT, ConstructFrame) \ | 167 V(CONSTRUCT, ConstructFrame) \ |
| 168 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) | 168 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) |
| 169 | 169 |
| 170 | 170 |
| 171 class StandardFrameConstants : public AllStatic { | 171 class StandardFrameConstants : public AllStatic { |
| 172 public: | 172 public: |
| 173 // Fixed part of the frame consists of return address, caller fp, | 173 // Fixed part of the frame consists of return address, caller fp, |
| 174 // context and function. | 174 // constant pool (if FLAG_enable_ool_constant_pool), context, and function. |
| 175 // StandardFrame::IterateExpressions assumes that kContextOffset is the last | 175 // StandardFrame::IterateExpressions assumes that kContextOffset is the last |
| 176 // object pointer. | 176 // object pointer. |
| 177 static const int kFixedFrameSizeFromFp = 2 * kPointerSize; | 177 static const int kCPSlotSize = |
| 178 FLAG_enable_ool_constant_pool ? kPointerSize : 0; |
| 179 static const int kFixedFrameSizeFromFp = 2 * kPointerSize + kCPSlotSize; |
| 178 static const int kFixedFrameSize = kPCOnStackSize + kFPOnStackSize + | 180 static const int kFixedFrameSize = kPCOnStackSize + kFPOnStackSize + |
| 179 kFixedFrameSizeFromFp; | 181 kFixedFrameSizeFromFp; |
| 180 static const int kExpressionsOffset = -3 * kPointerSize; | 182 static const int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; |
| 181 static const int kMarkerOffset = -2 * kPointerSize; | 183 static const int kMarkerOffset = -2 * kPointerSize - kCPSlotSize; |
| 182 static const int kContextOffset = -1 * kPointerSize; | 184 static const int kContextOffset = -1 * kPointerSize - kCPSlotSize; |
| 185 static const int kConstantPoolOffset = FLAG_enable_ool_constant_pool ? |
| 186 -1 * kPointerSize : 0; |
| 183 static const int kCallerFPOffset = 0 * kPointerSize; | 187 static const int kCallerFPOffset = 0 * kPointerSize; |
| 184 static const int kCallerPCOffset = +1 * kFPOnStackSize; | 188 static const int kCallerPCOffset = +1 * kFPOnStackSize; |
| 185 static const int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize; | 189 static const int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize; |
| 186 }; | 190 }; |
| 187 | 191 |
| 188 | 192 |
| 189 // Abstract base class for all stack frames. | 193 // Abstract base class for all stack frames. |
| 190 class StackFrame BASE_EMBEDDED { | 194 class StackFrame BASE_EMBEDDED { |
| 191 public: | 195 public: |
| 192 #define DECLARE_TYPE(type, ignore) type, | 196 #define DECLARE_TYPE(type, ignore) type, |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 603 |
| 600 // Return a list with JSFunctions of this frame. | 604 // Return a list with JSFunctions of this frame. |
| 601 virtual void GetFunctions(List<JSFunction*>* functions); | 605 virtual void GetFunctions(List<JSFunction*>* functions); |
| 602 | 606 |
| 603 // Build a list with summaries for this frame including all inlined frames. | 607 // Build a list with summaries for this frame including all inlined frames. |
| 604 virtual void Summarize(List<FrameSummary>* frames); | 608 virtual void Summarize(List<FrameSummary>* frames); |
| 605 | 609 |
| 606 // Architecture-specific register description. | 610 // Architecture-specific register description. |
| 607 static Register fp_register(); | 611 static Register fp_register(); |
| 608 static Register context_register(); | 612 static Register context_register(); |
| 613 static Register constant_pool_pointer_register(); |
| 609 | 614 |
| 610 static JavaScriptFrame* cast(StackFrame* frame) { | 615 static JavaScriptFrame* cast(StackFrame* frame) { |
| 611 ASSERT(frame->is_java_script()); | 616 ASSERT(frame->is_java_script()); |
| 612 return static_cast<JavaScriptFrame*>(frame); | 617 return static_cast<JavaScriptFrame*>(frame); |
| 613 } | 618 } |
| 614 | 619 |
| 615 static void PrintTop(Isolate* isolate, | 620 static void PrintTop(Isolate* isolate, |
| 616 FILE* file, | 621 FILE* file, |
| 617 bool print_args, | 622 bool print_args, |
| 618 bool print_line_number); | 623 bool print_line_number); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 | 760 |
| 756 // Get the code associated with this frame. | 761 // Get the code associated with this frame. |
| 757 // This method could be called during marking phase of GC. | 762 // This method could be called during marking phase of GC. |
| 758 virtual Code* unchecked_code() const; | 763 virtual Code* unchecked_code() const; |
| 759 | 764 |
| 760 virtual void Iterate(ObjectVisitor* v) const; | 765 virtual void Iterate(ObjectVisitor* v) const; |
| 761 | 766 |
| 762 // Architecture-specific register description. | 767 // Architecture-specific register description. |
| 763 static Register fp_register(); | 768 static Register fp_register(); |
| 764 static Register context_register(); | 769 static Register context_register(); |
| 770 static Register constant_pool_pointer_register(); |
| 765 | 771 |
| 766 protected: | 772 protected: |
| 767 inline explicit StubFailureTrampolineFrame( | 773 inline explicit StubFailureTrampolineFrame( |
| 768 StackFrameIteratorBase* iterator); | 774 StackFrameIteratorBase* iterator); |
| 769 | 775 |
| 770 virtual Address GetCallerStackPointer() const; | 776 virtual Address GetCallerStackPointer() const; |
| 771 | 777 |
| 772 private: | 778 private: |
| 773 friend class StackFrameIteratorBase; | 779 friend class StackFrameIteratorBase; |
| 774 }; | 780 }; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 }; | 940 }; |
| 935 | 941 |
| 936 | 942 |
| 937 // Reads all frames on the current stack and copies them into the current | 943 // Reads all frames on the current stack and copies them into the current |
| 938 // zone memory. | 944 // zone memory. |
| 939 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 945 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 940 | 946 |
| 941 } } // namespace v8::internal | 947 } } // namespace v8::internal |
| 942 | 948 |
| 943 #endif // V8_FRAMES_H_ | 949 #endif // V8_FRAMES_H_ |
| OLD | NEW |