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 246 matching lines...) Loading... |
257 // profiler's stashed return address. | 257 // profiler's stashed return address. |
258 static void SetReturnAddressLocationResolver( | 258 static void SetReturnAddressLocationResolver( |
259 ReturnAddressLocationResolver resolver); | 259 ReturnAddressLocationResolver resolver); |
260 | 260 |
261 // Printing support. | 261 // Printing support. |
262 enum PrintMode { OVERVIEW, DETAILS }; | 262 enum PrintMode { OVERVIEW, DETAILS }; |
263 virtual void Print(StringStream* accumulator, | 263 virtual void Print(StringStream* accumulator, |
264 PrintMode mode, | 264 PrintMode mode, |
265 int index) const { } | 265 int index) const { } |
266 | 266 |
| 267 Isolate* isolate() const { return isolate_; } |
| 268 |
267 protected: | 269 protected: |
268 inline explicit StackFrame(StackFrameIterator* iterator); | 270 inline explicit StackFrame(StackFrameIterator* iterator); |
269 virtual ~StackFrame() { } | 271 virtual ~StackFrame() { } |
270 | 272 |
271 Isolate* isolate() const { return isolate_; } | |
272 | |
273 // Compute the stack pointer for the calling frame. | 273 // Compute the stack pointer for the calling frame. |
274 virtual Address GetCallerStackPointer() const = 0; | 274 virtual Address GetCallerStackPointer() const = 0; |
275 | 275 |
276 // Printing support. | 276 // Printing support. |
277 static void PrintIndex(StringStream* accumulator, | 277 static void PrintIndex(StringStream* accumulator, |
278 PrintMode mode, | 278 PrintMode mode, |
279 int index); | 279 int index); |
280 | 280 |
281 // Get the top handler from the current stack iterator. | 281 // Get the top handler from the current stack iterator. |
282 inline StackHandler* top_handler() const; | 282 inline StackHandler* top_handler() const; |
(...skipping 159 matching lines...) Loading... |
442 bool IsExpressionInsideHandler(int n) const; | 442 bool IsExpressionInsideHandler(int n) const; |
443 | 443 |
444 // Determines if the standard frame for the given frame pointer is | 444 // Determines if the standard frame for the given frame pointer is |
445 // an arguments adaptor frame. | 445 // an arguments adaptor frame. |
446 static inline bool IsArgumentsAdaptorFrame(Address fp); | 446 static inline bool IsArgumentsAdaptorFrame(Address fp); |
447 | 447 |
448 // Determines if the standard frame for the given frame pointer is a | 448 // Determines if the standard frame for the given frame pointer is a |
449 // construct frame. | 449 // construct frame. |
450 static inline bool IsConstructFrame(Address fp); | 450 static inline bool IsConstructFrame(Address fp); |
451 | 451 |
| 452 // Used by OptimizedFrames and StubFrames. |
| 453 void IterateCompiledFrame(ObjectVisitor* v) const; |
| 454 |
452 private: | 455 private: |
453 friend class StackFrame; | 456 friend class StackFrame; |
454 friend class StackFrameIterator; | 457 friend class StackFrameIterator; |
455 }; | 458 }; |
456 | 459 |
457 | 460 |
458 class FrameSummary BASE_EMBEDDED { | 461 class FrameSummary BASE_EMBEDDED { |
459 public: | 462 public: |
460 FrameSummary(Object* receiver, | 463 FrameSummary(Object* receiver, |
461 JSFunction* function, | 464 JSFunction* function, |
(...skipping 90 matching lines...) Loading... |
552 void IterateArguments(ObjectVisitor* v) const; | 555 void IterateArguments(ObjectVisitor* v) const; |
553 | 556 |
554 private: | 557 private: |
555 inline Object* function_slot_object() const; | 558 inline Object* function_slot_object() const; |
556 | 559 |
557 friend class StackFrameIterator; | 560 friend class StackFrameIterator; |
558 friend class StackTracer; | 561 friend class StackTracer; |
559 }; | 562 }; |
560 | 563 |
561 | 564 |
562 class CompiledFrame : public JavaScriptFrame { | 565 class StubFrame : public StandardFrame { |
563 public: | |
564 virtual Type type() const = 0; | |
565 | |
566 // GC support. | |
567 virtual void Iterate(ObjectVisitor* v) const; | |
568 | |
569 protected: | |
570 inline explicit CompiledFrame(StackFrameIterator* iterator); | |
571 }; | |
572 | |
573 | |
574 class StubFrame : public CompiledFrame { | |
575 public: | 566 public: |
576 virtual Type type() const { return STUB; } | 567 virtual Type type() const { return STUB; } |
577 | 568 |
578 // GC support. | 569 // GC support. |
579 virtual void Iterate(ObjectVisitor* v) const; | 570 virtual void Iterate(ObjectVisitor* v) const; |
580 | 571 |
| 572 // Determine the code for the frame. |
| 573 virtual Code* unchecked_code() const; |
| 574 |
581 protected: | 575 protected: |
582 inline explicit StubFrame(StackFrameIterator* iterator); | 576 inline explicit StubFrame(StackFrameIterator* iterator); |
583 | 577 |
| 578 virtual Address GetCallerStackPointer() const; |
| 579 |
| 580 virtual int GetNumberOfIncomingArguments() const; |
| 581 |
584 friend class StackFrameIterator; | 582 friend class StackFrameIterator; |
585 }; | 583 }; |
586 | 584 |
587 | 585 |
588 class OptimizedFrame : public CompiledFrame { | 586 class OptimizedFrame : public JavaScriptFrame { |
589 public: | 587 public: |
590 virtual Type type() const { return OPTIMIZED; } | 588 virtual Type type() const { return OPTIMIZED; } |
591 | 589 |
592 // GC support. | 590 // GC support. |
593 virtual void Iterate(ObjectVisitor* v) const; | 591 virtual void Iterate(ObjectVisitor* v) const; |
594 | 592 |
595 virtual int GetInlineCount(); | 593 virtual int GetInlineCount(); |
596 | 594 |
597 // Return a list with JSFunctions of this frame. | 595 // Return a list with JSFunctions of this frame. |
598 // The functions are ordered bottom-to-top (i.e. functions.last() | 596 // The functions are ordered bottom-to-top (i.e. functions.last() |
(...skipping 324 matching lines...) Loading... |
923 }; | 921 }; |
924 | 922 |
925 | 923 |
926 // Reads all frames on the current stack and copies them into the current | 924 // Reads all frames on the current stack and copies them into the current |
927 // zone memory. | 925 // zone memory. |
928 Vector<StackFrame*> CreateStackMap(Zone* zone); | 926 Vector<StackFrame*> CreateStackMap(Zone* zone); |
929 | 927 |
930 } } // namespace v8::internal | 928 } } // namespace v8::internal |
931 | 929 |
932 #endif // V8_FRAMES_H_ | 930 #endif // V8_FRAMES_H_ |
OLD | NEW |