| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 11 matching lines...) Expand all Loading... |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8_FRAMES_H_ | 28 #ifndef V8_FRAMES_H_ |
| 29 #define V8_FRAMES_H_ | 29 #define V8_FRAMES_H_ |
| 30 | 30 |
| 31 #include "handles.h" | 31 #include "handles.h" |
| 32 #include "safepoint-table.h" |
| 32 | 33 |
| 33 namespace v8 { | 34 namespace v8 { |
| 34 namespace internal { | 35 namespace internal { |
| 35 | 36 |
| 36 typedef uint32_t RegList; | 37 typedef uint32_t RegList; |
| 37 | 38 |
| 38 // Get the number of registers in a given register list. | 39 // Get the number of registers in a given register list. |
| 39 int NumRegs(RegList list); | 40 int NumRegs(RegList list); |
| 40 | 41 |
| 41 // Return the code of the n-th saved register available to JavaScript. | 42 // Return the code of the n-th saved register available to JavaScript. |
| 42 int JSCallerSavedCode(int n); | 43 int JSCallerSavedCode(int n); |
| 43 | 44 |
| 44 | 45 |
| 45 // Forward declarations. | 46 // Forward declarations. |
| 46 class StackFrameIterator; | 47 class StackFrameIterator; |
| 47 class ThreadLocalTop; | 48 class ThreadLocalTop; |
| 48 class Isolate; | 49 class Isolate; |
| 49 | 50 |
| 50 class PcToCodeCache { | 51 class PcToCodeCache { |
| 51 public: | 52 public: |
| 52 struct PcToCodeCacheEntry { | 53 struct PcToCodeCacheEntry { |
| 53 Address pc; | 54 Address pc; |
| 54 Code* code; | 55 Code* code; |
| 55 uint8_t* safepoint_entry; | 56 SafepointEntry safepoint_entry; |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 explicit PcToCodeCache(Isolate* isolate) : isolate_(isolate) { | 59 explicit PcToCodeCache(Isolate* isolate) : isolate_(isolate) { |
| 59 Flush(); | 60 Flush(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 Code* GcSafeFindCodeForPc(Address pc); | 63 Code* GcSafeFindCodeForPc(Address pc); |
| 63 Code* GcSafeCastToCode(HeapObject* object, Address pc); | 64 Code* GcSafeCastToCode(HeapObject* object, Address pc); |
| 64 | 65 |
| 65 void Flush() { | 66 void Flush() { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return GetContainingCode(isolate, pc()); | 209 return GetContainingCode(isolate, pc()); |
| 209 } | 210 } |
| 210 | 211 |
| 211 // Get the code object that contains the given pc. | 212 // Get the code object that contains the given pc. |
| 212 static inline Code* GetContainingCode(Isolate* isolate, Address pc); | 213 static inline Code* GetContainingCode(Isolate* isolate, Address pc); |
| 213 | 214 |
| 214 // Get the code object containing the given pc and fill in the | 215 // Get the code object containing the given pc and fill in the |
| 215 // safepoint entry and the number of stack slots. The pc must be at | 216 // safepoint entry and the number of stack slots. The pc must be at |
| 216 // a safepoint. | 217 // a safepoint. |
| 217 static Code* GetSafepointData(Address pc, | 218 static Code* GetSafepointData(Address pc, |
| 218 uint8_t** safepoint_entry, | 219 SafepointEntry* safepoint_entry, |
| 219 unsigned* stack_slots); | 220 unsigned* stack_slots); |
| 220 | 221 |
| 221 virtual void Iterate(ObjectVisitor* v) const = 0; | 222 virtual void Iterate(ObjectVisitor* v) const = 0; |
| 222 static void IteratePc(ObjectVisitor* v, Address* pc_address, Code* holder); | 223 static void IteratePc(ObjectVisitor* v, Address* pc_address, Code* holder); |
| 223 | 224 |
| 224 | 225 |
| 225 // Printing support. | 226 // Printing support. |
| 226 enum PrintMode { OVERVIEW, DETAILS }; | 227 enum PrintMode { OVERVIEW, DETAILS }; |
| 227 virtual void Print(StringStream* accumulator, | 228 virtual void Print(StringStream* accumulator, |
| 228 PrintMode mode, | 229 PrintMode mode, |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 }; | 834 }; |
| 834 | 835 |
| 835 | 836 |
| 836 // Reads all frames on the current stack and copies them into the current | 837 // Reads all frames on the current stack and copies them into the current |
| 837 // zone memory. | 838 // zone memory. |
| 838 Vector<StackFrame*> CreateStackMap(); | 839 Vector<StackFrame*> CreateStackMap(); |
| 839 | 840 |
| 840 } } // namespace v8::internal | 841 } } // namespace v8::internal |
| 841 | 842 |
| 842 #endif // V8_FRAMES_H_ | 843 #endif // V8_FRAMES_H_ |
| OLD | NEW |