Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: src/frames.h

Issue 1618343002: [interpreter, debugger] abstraction for source position calculation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 void IterateCompiledFrame(ObjectVisitor* v) const; 537 void IterateCompiledFrame(ObjectVisitor* v) const;
538 538
539 private: 539 private:
540 friend class StackFrame; 540 friend class StackFrame;
541 friend class SafeStackFrameIterator; 541 friend class SafeStackFrameIterator;
542 }; 542 };
543 543
544 544
545 class FrameSummary BASE_EMBEDDED { 545 class FrameSummary BASE_EMBEDDED {
546 public: 546 public:
547 FrameSummary(Object* receiver, JSFunction* function, Code* code, int offset, 547 FrameSummary(Object* receiver, JSFunction* function,
548 bool is_constructor); 548 HeapObject* abstract_code, int code_offset, bool is_constructor);
549 549
550 Handle<Object> receiver() { return receiver_; } 550 Handle<Object> receiver() { return receiver_; }
551 Handle<JSFunction> function() { return function_; } 551 Handle<JSFunction> function() { return function_; }
552 Handle<Code> code() { return code_; } 552 Handle<AbstractCode> abstract_code() { return abstract_code_; }
553 Address pc() { return code_->address() + offset_; } 553 int code_offset() { return code_offset_; }
554 int offset() { return offset_; }
555 bool is_constructor() { return is_constructor_; } 554 bool is_constructor() { return is_constructor_; }
556 555
557 void Print(); 556 void Print();
558 557
559 private: 558 private:
560 Handle<Object> receiver_; 559 Handle<Object> receiver_;
561 Handle<JSFunction> function_; 560 Handle<JSFunction> function_;
562 Handle<Code> code_; 561 Handle<AbstractCode> abstract_code_;
563 int offset_; 562 int code_offset_;
564 bool is_constructor_; 563 bool is_constructor_;
565 }; 564 };
566 565
567 566
568 class JavaScriptFrame: public StandardFrame { 567 class JavaScriptFrame: public StandardFrame {
569 public: 568 public:
570 Type type() const override { return JAVA_SCRIPT; } 569 Type type() const override { return JAVA_SCRIPT; }
571 570
572 // Accessors. 571 // Accessors.
573 inline JSFunction* function() const; 572 inline JSFunction* function() const;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 int LookupExceptionHandlerInTable( 724 int LookupExceptionHandlerInTable(
726 int* stack_slots, HandlerTable::CatchPrediction* prediction) override; 725 int* stack_slots, HandlerTable::CatchPrediction* prediction) override;
727 726
728 // Returns the current offset into the bytecode stream. 727 // Returns the current offset into the bytecode stream.
729 int GetBytecodeOffset() const; 728 int GetBytecodeOffset() const;
730 729
731 // Updates the current offset into the bytecode stream, mainly used for stack 730 // Updates the current offset into the bytecode stream, mainly used for stack
732 // unwinding to continue execution at a different bytecode offset. 731 // unwinding to continue execution at a different bytecode offset.
733 void PatchBytecodeOffset(int new_offset); 732 void PatchBytecodeOffset(int new_offset);
734 733
734 // Build a list with summaries for this frame including all inlined frames.
735 void Summarize(List<FrameSummary>* frames) override;
736
735 protected: 737 protected:
736 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); 738 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator);
737 739
738 private: 740 private:
739 friend class StackFrameIteratorBase; 741 friend class StackFrameIteratorBase;
740 }; 742 };
741 743
742 744
743 // Arguments adaptor frames are automatically inserted below 745 // Arguments adaptor frames are automatically inserted below
744 // JavaScript frames when the actual number of parameters does not 746 // JavaScript frames when the actual number of parameters does not
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 986
985 987
986 // Reads all frames on the current stack and copies them into the current 988 // Reads all frames on the current stack and copies them into the current
987 // zone memory. 989 // zone memory.
988 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 990 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
989 991
990 } // namespace internal 992 } // namespace internal
991 } // namespace v8 993 } // namespace v8
992 994
993 #endif // V8_FRAMES_H_ 995 #endif // V8_FRAMES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698