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

Side by Side Diff: src/frames.h

Issue 2134093002: [builtins] Show builtin frames in PrintStack() (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Print frame kind Created 4 years, 5 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
« no previous file with comments | « no previous file | src/frames.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 static BuiltinExitFrame* cast(StackFrame* frame) { 663 static BuiltinExitFrame* cast(StackFrame* frame) {
664 DCHECK(frame->is_builtin_exit()); 664 DCHECK(frame->is_builtin_exit());
665 return static_cast<BuiltinExitFrame*>(frame); 665 return static_cast<BuiltinExitFrame*>(frame);
666 } 666 }
667 667
668 JSFunction* function() const; 668 JSFunction* function() const;
669 Object* receiver() const; 669 Object* receiver() const;
670 670
671 bool IsConstructor() const; 671 bool IsConstructor() const;
672 672
673 void Print(StringStream* accumulator, PrintMode mode,
674 int index) const override;
675
673 protected: 676 protected:
674 inline explicit BuiltinExitFrame(StackFrameIteratorBase* iterator); 677 inline explicit BuiltinExitFrame(StackFrameIteratorBase* iterator);
675 678
676 private: 679 private:
680 Object* GetParameter(int i) const;
681 int ComputeParametersCount() const;
682
683 inline Object* receiver_slot_object() const;
684 inline Object* argc_slot_object() const;
677 inline Object* target_slot_object() const; 685 inline Object* target_slot_object() const;
678 inline Object* new_target_slot_object() const; 686 inline Object* new_target_slot_object() const;
679 inline Object* receiver_slot_object() const;
680 687
681 friend class StackFrameIteratorBase; 688 friend class StackFrameIteratorBase;
682 }; 689 };
683 690
684 class JavaScriptFrame; 691 class JavaScriptFrame;
685 692
686 class FrameSummary BASE_EMBEDDED { 693 class FrameSummary BASE_EMBEDDED {
687 public: 694 public:
688 // Mode for JavaScriptFrame::Summarize. Exact summary is required to produce 695 // Mode for JavaScriptFrame::Summarize. Exact summary is required to produce
689 // an exact stack trace. It will trigger an assertion failure if that is not 696 // an exact stack trace. It will trigger an assertion failure if that is not
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 inline explicit JavaScriptFrame(StackFrameIteratorBase* iterator); 878 inline explicit JavaScriptFrame(StackFrameIteratorBase* iterator);
872 879
873 Address GetCallerStackPointer() const override; 880 Address GetCallerStackPointer() const override;
874 881
875 virtual int GetNumberOfIncomingArguments() const; 882 virtual int GetNumberOfIncomingArguments() const;
876 883
877 // Garbage collection support. Iterates over incoming arguments, 884 // Garbage collection support. Iterates over incoming arguments,
878 // receiver, and any callee-saved registers. 885 // receiver, and any callee-saved registers.
879 void IterateArguments(ObjectVisitor* v) const; 886 void IterateArguments(ObjectVisitor* v) const;
880 887
888 virtual void PrintFrameKind(StringStream* accumulator) const {}
889
881 private: 890 private:
882 inline Object* function_slot_object() const; 891 inline Object* function_slot_object() const;
883 892
884 friend class StackFrameIteratorBase; 893 friend class StackFrameIteratorBase;
885 }; 894 };
886 895
887 896
888 class StubFrame : public StandardFrame { 897 class StubFrame : public StandardFrame {
889 public: 898 public:
890 Type type() const override { return STUB; } 899 Type type() const override { return STUB; }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 // various standard library functions (i.e. Math.asin, Math.floor, etc.). 1024 // various standard library functions (i.e. Math.asin, Math.floor, etc.).
1016 class BuiltinFrame final : public JavaScriptFrame { 1025 class BuiltinFrame final : public JavaScriptFrame {
1017 public: 1026 public:
1018 Type type() const final { return BUILTIN; } 1027 Type type() const final { return BUILTIN; }
1019 1028
1020 static BuiltinFrame* cast(StackFrame* frame) { 1029 static BuiltinFrame* cast(StackFrame* frame) {
1021 DCHECK(frame->is_builtin()); 1030 DCHECK(frame->is_builtin());
1022 return static_cast<BuiltinFrame*>(frame); 1031 return static_cast<BuiltinFrame*>(frame);
1023 } 1032 }
1024 1033
1025 // Printing support.
1026 void Print(StringStream* accumulator, PrintMode mode, int index) const final;
1027
1028 protected: 1034 protected:
1029 inline explicit BuiltinFrame(StackFrameIteratorBase* iterator); 1035 inline explicit BuiltinFrame(StackFrameIteratorBase* iterator);
1030 1036
1031 int GetNumberOfIncomingArguments() const final; 1037 int GetNumberOfIncomingArguments() const final;
1038 void PrintFrameKind(StringStream* accumulator) const override;
1032 1039
1033 private: 1040 private:
1034 friend class StackFrameIteratorBase; 1041 friend class StackFrameIteratorBase;
1035 }; 1042 };
1036 1043
1037 class WasmFrame : public StandardFrame { 1044 class WasmFrame : public StandardFrame {
1038 public: 1045 public:
1039 Type type() const override { return WASM; } 1046 Type type() const override { return WASM; }
1040 1047
1041 // GC support. 1048 // GC support.
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 1313
1307 1314
1308 // Reads all frames on the current stack and copies them into the current 1315 // Reads all frames on the current stack and copies them into the current
1309 // zone memory. 1316 // zone memory.
1310 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 1317 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
1311 1318
1312 } // namespace internal 1319 } // namespace internal
1313 } // namespace v8 1320 } // namespace v8
1314 1321
1315 #endif // V8_FRAMES_H_ 1322 #endif // V8_FRAMES_H_
OLDNEW
« no previous file with comments | « no previous file | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698