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