OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_FRAMES_H_ | 5 #ifndef V8_FRAMES_H_ |
6 #define V8_FRAMES_H_ | 6 #define V8_FRAMES_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/safepoint-table.h" | 10 #include "src/safepoint-table.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 friend class SafeStackFrameIterator; | 369 friend class SafeStackFrameIterator; |
370 | 370 |
371 private: | 371 private: |
372 void operator=(const StackFrame& original); | 372 void operator=(const StackFrame& original); |
373 }; | 373 }; |
374 | 374 |
375 | 375 |
376 // Entry frames are used to enter JavaScript execution from C. | 376 // Entry frames are used to enter JavaScript execution from C. |
377 class EntryFrame: public StackFrame { | 377 class EntryFrame: public StackFrame { |
378 public: | 378 public: |
379 virtual Type type() const { return ENTRY; } | 379 Type type() const override { return ENTRY; } |
380 | 380 |
381 virtual Code* unchecked_code() const; | 381 Code* unchecked_code() const override; |
382 | 382 |
383 // Garbage collection support. | 383 // Garbage collection support. |
384 virtual void Iterate(ObjectVisitor* v) const; | 384 void Iterate(ObjectVisitor* v) const override; |
385 | 385 |
386 static EntryFrame* cast(StackFrame* frame) { | 386 static EntryFrame* cast(StackFrame* frame) { |
387 DCHECK(frame->is_entry()); | 387 DCHECK(frame->is_entry()); |
388 return static_cast<EntryFrame*>(frame); | 388 return static_cast<EntryFrame*>(frame); |
389 } | 389 } |
390 virtual void SetCallerFp(Address caller_fp); | 390 void SetCallerFp(Address caller_fp) override; |
391 | 391 |
392 protected: | 392 protected: |
393 inline explicit EntryFrame(StackFrameIteratorBase* iterator); | 393 inline explicit EntryFrame(StackFrameIteratorBase* iterator); |
394 | 394 |
395 // The caller stack pointer for entry frames is always zero. The | 395 // The caller stack pointer for entry frames is always zero. The |
396 // real information about the caller frame is available through the | 396 // real information about the caller frame is available through the |
397 // link to the top exit frame. | 397 // link to the top exit frame. |
398 virtual Address GetCallerStackPointer() const { return 0; } | 398 Address GetCallerStackPointer() const override { return 0; } |
399 | 399 |
400 private: | 400 private: |
401 virtual void ComputeCallerState(State* state) const; | 401 void ComputeCallerState(State* state) const override; |
402 virtual Type GetCallerState(State* state) const; | 402 Type GetCallerState(State* state) const override; |
403 | 403 |
404 friend class StackFrameIteratorBase; | 404 friend class StackFrameIteratorBase; |
405 }; | 405 }; |
406 | 406 |
407 | 407 |
408 class EntryConstructFrame: public EntryFrame { | 408 class EntryConstructFrame: public EntryFrame { |
409 public: | 409 public: |
410 virtual Type type() const { return ENTRY_CONSTRUCT; } | 410 Type type() const override { return ENTRY_CONSTRUCT; } |
411 | 411 |
412 virtual Code* unchecked_code() const; | 412 Code* unchecked_code() const override; |
413 | 413 |
414 static EntryConstructFrame* cast(StackFrame* frame) { | 414 static EntryConstructFrame* cast(StackFrame* frame) { |
415 DCHECK(frame->is_entry_construct()); | 415 DCHECK(frame->is_entry_construct()); |
416 return static_cast<EntryConstructFrame*>(frame); | 416 return static_cast<EntryConstructFrame*>(frame); |
417 } | 417 } |
418 | 418 |
419 protected: | 419 protected: |
420 inline explicit EntryConstructFrame(StackFrameIteratorBase* iterator); | 420 inline explicit EntryConstructFrame(StackFrameIteratorBase* iterator); |
421 | 421 |
422 private: | 422 private: |
423 friend class StackFrameIteratorBase; | 423 friend class StackFrameIteratorBase; |
424 }; | 424 }; |
425 | 425 |
426 | 426 |
427 // Exit frames are used to exit JavaScript execution and go to C. | 427 // Exit frames are used to exit JavaScript execution and go to C. |
428 class ExitFrame: public StackFrame { | 428 class ExitFrame: public StackFrame { |
429 public: | 429 public: |
430 virtual Type type() const { return EXIT; } | 430 Type type() const override { return EXIT; } |
431 | 431 |
432 virtual Code* unchecked_code() const; | 432 Code* unchecked_code() const override; |
433 | 433 |
434 Object*& code_slot() const; | 434 Object*& code_slot() const; |
435 | 435 |
436 // Garbage collection support. | 436 // Garbage collection support. |
437 virtual void Iterate(ObjectVisitor* v) const; | 437 void Iterate(ObjectVisitor* v) const override; |
438 | 438 |
439 virtual void SetCallerFp(Address caller_fp); | 439 void SetCallerFp(Address caller_fp) override; |
440 | 440 |
441 static ExitFrame* cast(StackFrame* frame) { | 441 static ExitFrame* cast(StackFrame* frame) { |
442 DCHECK(frame->is_exit()); | 442 DCHECK(frame->is_exit()); |
443 return static_cast<ExitFrame*>(frame); | 443 return static_cast<ExitFrame*>(frame); |
444 } | 444 } |
445 | 445 |
446 // Compute the state and type of an exit frame given a frame | 446 // Compute the state and type of an exit frame given a frame |
447 // pointer. Used when constructing the first stack frame seen by an | 447 // pointer. Used when constructing the first stack frame seen by an |
448 // iterator and the frames following entry frames. | 448 // iterator and the frames following entry frames. |
449 static Type GetStateForFramePointer(Address fp, State* state); | 449 static Type GetStateForFramePointer(Address fp, State* state); |
450 static Address ComputeStackPointer(Address fp); | 450 static Address ComputeStackPointer(Address fp); |
451 static void FillState(Address fp, Address sp, State* state); | 451 static void FillState(Address fp, Address sp, State* state); |
452 | 452 |
453 protected: | 453 protected: |
454 inline explicit ExitFrame(StackFrameIteratorBase* iterator); | 454 inline explicit ExitFrame(StackFrameIteratorBase* iterator); |
455 | 455 |
456 virtual Address GetCallerStackPointer() const; | 456 Address GetCallerStackPointer() const override; |
457 | 457 |
458 private: | 458 private: |
459 virtual void ComputeCallerState(State* state) const; | 459 void ComputeCallerState(State* state) const override; |
460 | 460 |
461 friend class StackFrameIteratorBase; | 461 friend class StackFrameIteratorBase; |
462 }; | 462 }; |
463 | 463 |
464 | 464 |
465 class StandardFrame: public StackFrame { | 465 class StandardFrame: public StackFrame { |
466 public: | 466 public: |
467 // Testers. | 467 // Testers. |
468 virtual bool is_standard() const { return true; } | 468 bool is_standard() const override { return true; } |
469 | 469 |
470 // Accessors. | 470 // Accessors. |
471 inline Object* context() const; | 471 inline Object* context() const; |
472 | 472 |
473 // Access the expressions in the stack frame including locals. | 473 // Access the expressions in the stack frame including locals. |
474 inline Object* GetExpression(int index) const; | 474 inline Object* GetExpression(int index) const; |
475 inline void SetExpression(int index, Object* value); | 475 inline void SetExpression(int index, Object* value); |
476 int ComputeExpressionsCount() const; | 476 int ComputeExpressionsCount() const; |
477 static Object* GetExpression(Address fp, int index); | 477 static Object* GetExpression(Address fp, int index); |
478 | 478 |
479 virtual void SetCallerFp(Address caller_fp); | 479 void SetCallerFp(Address caller_fp) override; |
480 | 480 |
481 static StandardFrame* cast(StackFrame* frame) { | 481 static StandardFrame* cast(StackFrame* frame) { |
482 DCHECK(frame->is_standard()); | 482 DCHECK(frame->is_standard()); |
483 return static_cast<StandardFrame*>(frame); | 483 return static_cast<StandardFrame*>(frame); |
484 } | 484 } |
485 | 485 |
486 protected: | 486 protected: |
487 inline explicit StandardFrame(StackFrameIteratorBase* iterator); | 487 inline explicit StandardFrame(StackFrameIteratorBase* iterator); |
488 | 488 |
489 virtual void ComputeCallerState(State* state) const; | 489 void ComputeCallerState(State* state) const override; |
490 | 490 |
491 // Accessors. | 491 // Accessors. |
492 inline Address caller_fp() const; | 492 inline Address caller_fp() const; |
493 inline Address caller_pc() const; | 493 inline Address caller_pc() const; |
494 | 494 |
495 // Computes the address of the PC field in the standard frame given | 495 // Computes the address of the PC field in the standard frame given |
496 // by the provided frame pointer. | 496 // by the provided frame pointer. |
497 static inline Address ComputePCAddress(Address fp); | 497 static inline Address ComputePCAddress(Address fp); |
498 | 498 |
499 // Computes the address of the constant pool field in the standard | 499 // Computes the address of the constant pool field in the standard |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 Handle<Object> receiver_; | 543 Handle<Object> receiver_; |
544 Handle<JSFunction> function_; | 544 Handle<JSFunction> function_; |
545 Handle<Code> code_; | 545 Handle<Code> code_; |
546 int offset_; | 546 int offset_; |
547 bool is_constructor_; | 547 bool is_constructor_; |
548 }; | 548 }; |
549 | 549 |
550 | 550 |
551 class JavaScriptFrame: public StandardFrame { | 551 class JavaScriptFrame: public StandardFrame { |
552 public: | 552 public: |
553 virtual Type type() const { return JAVA_SCRIPT; } | 553 Type type() const override { return JAVA_SCRIPT; } |
554 | 554 |
555 // Accessors. | 555 // Accessors. |
556 inline JSFunction* function() const; | 556 inline JSFunction* function() const; |
557 inline Object* receiver() const; | 557 inline Object* receiver() const; |
558 inline void set_receiver(Object* value); | 558 inline void set_receiver(Object* value); |
559 | 559 |
560 // Access the parameters. | 560 // Access the parameters. |
561 inline Address GetParameterSlot(int index) const; | 561 inline Address GetParameterSlot(int index) const; |
562 inline Object* GetParameter(int index) const; | 562 inline Object* GetParameter(int index) const; |
563 inline int ComputeParametersCount() const { | 563 inline int ComputeParametersCount() const { |
(...skipping 10 matching lines...) Expand all Loading... |
574 void RestoreOperandStack(FixedArray* store); | 574 void RestoreOperandStack(FixedArray* store); |
575 | 575 |
576 // Debugger access. | 576 // Debugger access. |
577 void SetParameterValue(int index, Object* value) const; | 577 void SetParameterValue(int index, Object* value) const; |
578 | 578 |
579 // Check if this frame is a constructor frame invoked through 'new'. | 579 // Check if this frame is a constructor frame invoked through 'new'. |
580 bool IsConstructor() const; | 580 bool IsConstructor() const; |
581 | 581 |
582 // Determines whether this frame includes inlined activations. To get details | 582 // Determines whether this frame includes inlined activations. To get details |
583 // about the inlined frames use {GetFunctions} and {Summarize}. | 583 // about the inlined frames use {GetFunctions} and {Summarize}. |
584 bool HasInlinedFrames(); | 584 bool HasInlinedFrames() const; |
585 | 585 |
586 // Returns the original constructor function that was used in the constructor | 586 // Returns the original constructor function that was used in the constructor |
587 // call to this frame. Note that this is only valid on constructor frames. | 587 // call to this frame. Note that this is only valid on constructor frames. |
588 Object* GetOriginalConstructor() const; | 588 Object* GetOriginalConstructor() const; |
589 | 589 |
590 // Check if this frame has "adapted" arguments in the sense that the | 590 // Check if this frame has "adapted" arguments in the sense that the |
591 // actual passed arguments are available in an arguments adaptor | 591 // actual passed arguments are available in an arguments adaptor |
592 // frame below it on the stack. | 592 // frame below it on the stack. |
593 inline bool has_adapted_arguments() const; | 593 inline bool has_adapted_arguments() const; |
594 int GetArgumentsLength() const; | 594 int GetArgumentsLength() const; |
595 | 595 |
596 // Garbage collection support. | 596 // Garbage collection support. |
597 virtual void Iterate(ObjectVisitor* v) const; | 597 void Iterate(ObjectVisitor* v) const override; |
598 | 598 |
599 // Printing support. | 599 // Printing support. |
600 virtual void Print(StringStream* accumulator, | 600 void Print(StringStream* accumulator, PrintMode mode, |
601 PrintMode mode, | 601 int index) const override; |
602 int index) const; | |
603 | 602 |
604 // Determine the code for the frame. | 603 // Determine the code for the frame. |
605 virtual Code* unchecked_code() const; | 604 Code* unchecked_code() const override; |
606 | 605 |
607 // Return a list with JSFunctions of this frame. | 606 // Return a list with JSFunctions of this frame. |
608 virtual void GetFunctions(List<JSFunction*>* functions); | 607 virtual void GetFunctions(List<JSFunction*>* functions) const; |
609 | 608 |
610 // Build a list with summaries for this frame including all inlined frames. | 609 // Build a list with summaries for this frame including all inlined frames. |
611 virtual void Summarize(List<FrameSummary>* frames); | 610 virtual void Summarize(List<FrameSummary>* frames); |
612 | 611 |
613 // Lookup exception handler for current {pc}, returns -1 if none found. Also | 612 // Lookup exception handler for current {pc}, returns -1 if none found. Also |
614 // returns the expected number of stack slots at the handler site. | 613 // returns the expected number of stack slots at the handler site. |
615 virtual int LookupExceptionHandlerInTable( | 614 virtual int LookupExceptionHandlerInTable( |
616 int* stack_slots, HandlerTable::CatchPrediction* prediction); | 615 int* stack_slots, HandlerTable::CatchPrediction* prediction); |
617 | 616 |
618 // Architecture-specific register description. | 617 // Architecture-specific register description. |
619 static Register fp_register(); | 618 static Register fp_register(); |
620 static Register context_register(); | 619 static Register context_register(); |
621 static Register constant_pool_pointer_register(); | 620 static Register constant_pool_pointer_register(); |
622 | 621 |
623 static JavaScriptFrame* cast(StackFrame* frame) { | 622 static JavaScriptFrame* cast(StackFrame* frame) { |
624 DCHECK(frame->is_java_script()); | 623 DCHECK(frame->is_java_script()); |
625 return static_cast<JavaScriptFrame*>(frame); | 624 return static_cast<JavaScriptFrame*>(frame); |
626 } | 625 } |
627 | 626 |
628 static void PrintFunctionAndOffset(JSFunction* function, Code* code, | 627 static void PrintFunctionAndOffset(JSFunction* function, Code* code, |
629 Address pc, FILE* file, | 628 Address pc, FILE* file, |
630 bool print_line_number); | 629 bool print_line_number); |
631 | 630 |
632 static void PrintTop(Isolate* isolate, FILE* file, bool print_args, | 631 static void PrintTop(Isolate* isolate, FILE* file, bool print_args, |
633 bool print_line_number); | 632 bool print_line_number); |
634 | 633 |
635 protected: | 634 protected: |
636 inline explicit JavaScriptFrame(StackFrameIteratorBase* iterator); | 635 inline explicit JavaScriptFrame(StackFrameIteratorBase* iterator); |
637 | 636 |
638 virtual Address GetCallerStackPointer() const; | 637 Address GetCallerStackPointer() const override; |
639 | 638 |
640 virtual int GetNumberOfIncomingArguments() const; | 639 virtual int GetNumberOfIncomingArguments() const; |
641 | 640 |
642 // Garbage collection support. Iterates over incoming arguments, | 641 // Garbage collection support. Iterates over incoming arguments, |
643 // receiver, and any callee-saved registers. | 642 // receiver, and any callee-saved registers. |
644 void IterateArguments(ObjectVisitor* v) const; | 643 void IterateArguments(ObjectVisitor* v) const; |
645 | 644 |
646 private: | 645 private: |
647 inline Object* function_slot_object() const; | 646 inline Object* function_slot_object() const; |
648 | 647 |
649 friend class StackFrameIteratorBase; | 648 friend class StackFrameIteratorBase; |
650 }; | 649 }; |
651 | 650 |
652 | 651 |
653 class StubFrame : public StandardFrame { | 652 class StubFrame : public StandardFrame { |
654 public: | 653 public: |
655 virtual Type type() const { return STUB; } | 654 Type type() const override { return STUB; } |
656 | 655 |
657 // GC support. | 656 // GC support. |
658 virtual void Iterate(ObjectVisitor* v) const; | 657 void Iterate(ObjectVisitor* v) const override; |
659 | 658 |
660 // Determine the code for the frame. | 659 // Determine the code for the frame. |
661 virtual Code* unchecked_code() const; | 660 Code* unchecked_code() const override; |
662 | 661 |
663 protected: | 662 protected: |
664 inline explicit StubFrame(StackFrameIteratorBase* iterator); | 663 inline explicit StubFrame(StackFrameIteratorBase* iterator); |
665 | 664 |
666 virtual Address GetCallerStackPointer() const; | 665 Address GetCallerStackPointer() const override; |
667 | 666 |
668 virtual int GetNumberOfIncomingArguments() const; | 667 virtual int GetNumberOfIncomingArguments() const; |
669 | 668 |
670 friend class StackFrameIteratorBase; | 669 friend class StackFrameIteratorBase; |
671 }; | 670 }; |
672 | 671 |
673 | 672 |
674 class OptimizedFrame : public JavaScriptFrame { | 673 class OptimizedFrame : public JavaScriptFrame { |
675 public: | 674 public: |
676 virtual Type type() const { return OPTIMIZED; } | 675 Type type() const override { return OPTIMIZED; } |
677 | 676 |
678 // GC support. | 677 // GC support. |
679 virtual void Iterate(ObjectVisitor* v) const; | 678 void Iterate(ObjectVisitor* v) const override; |
680 | 679 |
681 // Return a list with JSFunctions of this frame. | 680 // Return a list with JSFunctions of this frame. |
682 // The functions are ordered bottom-to-top (i.e. functions.last() | 681 // The functions are ordered bottom-to-top (i.e. functions.last() |
683 // is the top-most activation) | 682 // is the top-most activation) |
684 virtual void GetFunctions(List<JSFunction*>* functions); | 683 void GetFunctions(List<JSFunction*>* functions) const override; |
685 | 684 |
686 virtual void Summarize(List<FrameSummary>* frames); | 685 void Summarize(List<FrameSummary>* frames) override; |
687 | 686 |
688 // Lookup exception handler for current {pc}, returns -1 if none found. Also | 687 // Lookup exception handler for current {pc}, returns -1 if none found. Also |
689 // returns the expected number of stack slots at the handler site. | 688 // returns the expected number of stack slots at the handler site. |
690 virtual int LookupExceptionHandlerInTable( | 689 int LookupExceptionHandlerInTable( |
691 int* stack_slots, HandlerTable::CatchPrediction* prediction); | 690 int* stack_slots, HandlerTable::CatchPrediction* prediction) override; |
692 | 691 |
693 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index); | 692 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const; |
694 | 693 |
695 static int StackSlotOffsetRelativeToFp(int slot_index); | 694 static int StackSlotOffsetRelativeToFp(int slot_index); |
696 | 695 |
697 protected: | 696 protected: |
698 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); | 697 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); |
699 | 698 |
700 private: | 699 private: |
701 friend class StackFrameIteratorBase; | 700 friend class StackFrameIteratorBase; |
702 | 701 |
703 Object* StackSlotAt(int index) const; | 702 Object* StackSlotAt(int index) const; |
704 }; | 703 }; |
705 | 704 |
706 | 705 |
707 class InterpretedFrame : public JavaScriptFrame { | 706 class InterpretedFrame : public JavaScriptFrame { |
708 virtual Type type() const { return INTERPRETED; } | 707 Type type() const override { return INTERPRETED; } |
709 | 708 |
710 protected: | 709 protected: |
711 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); | 710 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); |
712 | 711 |
713 private: | 712 private: |
714 friend class StackFrameIteratorBase; | 713 friend class StackFrameIteratorBase; |
715 }; | 714 }; |
716 | 715 |
717 | 716 |
718 // Arguments adaptor frames are automatically inserted below | 717 // Arguments adaptor frames are automatically inserted below |
719 // JavaScript frames when the actual number of parameters does not | 718 // JavaScript frames when the actual number of parameters does not |
720 // match the formal number of parameters. | 719 // match the formal number of parameters. |
721 class ArgumentsAdaptorFrame: public JavaScriptFrame { | 720 class ArgumentsAdaptorFrame: public JavaScriptFrame { |
722 public: | 721 public: |
723 virtual Type type() const { return ARGUMENTS_ADAPTOR; } | 722 Type type() const override { return ARGUMENTS_ADAPTOR; } |
724 | 723 |
725 // Determine the code for the frame. | 724 // Determine the code for the frame. |
726 virtual Code* unchecked_code() const; | 725 Code* unchecked_code() const override; |
727 | 726 |
728 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { | 727 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { |
729 DCHECK(frame->is_arguments_adaptor()); | 728 DCHECK(frame->is_arguments_adaptor()); |
730 return static_cast<ArgumentsAdaptorFrame*>(frame); | 729 return static_cast<ArgumentsAdaptorFrame*>(frame); |
731 } | 730 } |
732 | 731 |
733 // Printing support. | 732 // Printing support. |
734 virtual void Print(StringStream* accumulator, | 733 void Print(StringStream* accumulator, PrintMode mode, |
735 PrintMode mode, | 734 int index) const override; |
736 int index) const; | |
737 | 735 |
738 protected: | 736 protected: |
739 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator); | 737 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator); |
740 | 738 |
741 virtual int GetNumberOfIncomingArguments() const; | 739 int GetNumberOfIncomingArguments() const override; |
742 | 740 |
743 virtual Address GetCallerStackPointer() const; | 741 Address GetCallerStackPointer() const override; |
744 | 742 |
745 private: | 743 private: |
746 friend class StackFrameIteratorBase; | 744 friend class StackFrameIteratorBase; |
747 }; | 745 }; |
748 | 746 |
749 | 747 |
750 class InternalFrame: public StandardFrame { | 748 class InternalFrame: public StandardFrame { |
751 public: | 749 public: |
752 virtual Type type() const { return INTERNAL; } | 750 Type type() const override { return INTERNAL; } |
753 | 751 |
754 // Garbage collection support. | 752 // Garbage collection support. |
755 virtual void Iterate(ObjectVisitor* v) const; | 753 void Iterate(ObjectVisitor* v) const override; |
756 | 754 |
757 // Determine the code for the frame. | 755 // Determine the code for the frame. |
758 virtual Code* unchecked_code() const; | 756 Code* unchecked_code() const override; |
759 | 757 |
760 static InternalFrame* cast(StackFrame* frame) { | 758 static InternalFrame* cast(StackFrame* frame) { |
761 DCHECK(frame->is_internal()); | 759 DCHECK(frame->is_internal()); |
762 return static_cast<InternalFrame*>(frame); | 760 return static_cast<InternalFrame*>(frame); |
763 } | 761 } |
764 | 762 |
765 protected: | 763 protected: |
766 inline explicit InternalFrame(StackFrameIteratorBase* iterator); | 764 inline explicit InternalFrame(StackFrameIteratorBase* iterator); |
767 | 765 |
768 virtual Address GetCallerStackPointer() const; | 766 Address GetCallerStackPointer() const override; |
769 | 767 |
770 private: | 768 private: |
771 friend class StackFrameIteratorBase; | 769 friend class StackFrameIteratorBase; |
772 }; | 770 }; |
773 | 771 |
774 | 772 |
775 class StubFailureTrampolineFrame: public StandardFrame { | 773 class StubFailureTrampolineFrame: public StandardFrame { |
776 public: | 774 public: |
777 // sizeof(Arguments) - sizeof(Arguments*) is 3 * kPointerSize), but the | 775 // sizeof(Arguments) - sizeof(Arguments*) is 3 * kPointerSize), but the |
778 // presubmit script complains about using sizeof() on a type. | 776 // presubmit script complains about using sizeof() on a type. |
779 static const int kFirstRegisterParameterFrameOffset = | 777 static const int kFirstRegisterParameterFrameOffset = |
780 StandardFrameConstants::kMarkerOffset - 3 * kPointerSize; | 778 StandardFrameConstants::kMarkerOffset - 3 * kPointerSize; |
781 | 779 |
782 static const int kCallerStackParameterCountFrameOffset = | 780 static const int kCallerStackParameterCountFrameOffset = |
783 StandardFrameConstants::kMarkerOffset - 2 * kPointerSize; | 781 StandardFrameConstants::kMarkerOffset - 2 * kPointerSize; |
784 | 782 |
785 virtual Type type() const { return STUB_FAILURE_TRAMPOLINE; } | 783 Type type() const override { return STUB_FAILURE_TRAMPOLINE; } |
786 | 784 |
787 // Get the code associated with this frame. | 785 // Get the code associated with this frame. |
788 // This method could be called during marking phase of GC. | 786 // This method could be called during marking phase of GC. |
789 virtual Code* unchecked_code() const; | 787 Code* unchecked_code() const override; |
790 | 788 |
791 virtual void Iterate(ObjectVisitor* v) const; | 789 void Iterate(ObjectVisitor* v) const override; |
792 | 790 |
793 // Architecture-specific register description. | 791 // Architecture-specific register description. |
794 static Register fp_register(); | 792 static Register fp_register(); |
795 static Register context_register(); | 793 static Register context_register(); |
796 static Register constant_pool_pointer_register(); | 794 static Register constant_pool_pointer_register(); |
797 | 795 |
798 protected: | 796 protected: |
799 inline explicit StubFailureTrampolineFrame( | 797 inline explicit StubFailureTrampolineFrame( |
800 StackFrameIteratorBase* iterator); | 798 StackFrameIteratorBase* iterator); |
801 | 799 |
802 virtual Address GetCallerStackPointer() const; | 800 Address GetCallerStackPointer() const override; |
803 | 801 |
804 private: | 802 private: |
805 friend class StackFrameIteratorBase; | 803 friend class StackFrameIteratorBase; |
806 }; | 804 }; |
807 | 805 |
808 | 806 |
809 // Construct frames are special trampoline frames introduced to handle | 807 // Construct frames are special trampoline frames introduced to handle |
810 // function invocations through 'new'. | 808 // function invocations through 'new'. |
811 class ConstructFrame: public InternalFrame { | 809 class ConstructFrame: public InternalFrame { |
812 public: | 810 public: |
813 virtual Type type() const { return CONSTRUCT; } | 811 Type type() const override { return CONSTRUCT; } |
814 | 812 |
815 static ConstructFrame* cast(StackFrame* frame) { | 813 static ConstructFrame* cast(StackFrame* frame) { |
816 DCHECK(frame->is_construct()); | 814 DCHECK(frame->is_construct()); |
817 return static_cast<ConstructFrame*>(frame); | 815 return static_cast<ConstructFrame*>(frame); |
818 } | 816 } |
819 | 817 |
820 protected: | 818 protected: |
821 inline explicit ConstructFrame(StackFrameIteratorBase* iterator); | 819 inline explicit ConstructFrame(StackFrameIteratorBase* iterator); |
822 | 820 |
823 private: | 821 private: |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 | 958 |
961 | 959 |
962 // Reads all frames on the current stack and copies them into the current | 960 // Reads all frames on the current stack and copies them into the current |
963 // zone memory. | 961 // zone memory. |
964 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 962 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
965 | 963 |
966 } // namespace internal | 964 } // namespace internal |
967 } // namespace v8 | 965 } // namespace v8 |
968 | 966 |
969 #endif // V8_FRAMES_H_ | 967 #endif // V8_FRAMES_H_ |
OLD | NEW |