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

Side by Side Diff: src/frames.h

Issue 1697223003: [Interpreter] GetExpression(0) in InterpretedFrames gets first local. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_push_bca
Patch Set: Created 4 years, 10 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // FP-relative. 185 // FP-relative.
186 static const int kNewTargetFromFp = 186 static const int kNewTargetFromFp =
187 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; 187 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize;
188 static const int kBytecodeArrayFromFp = 188 static const int kBytecodeArrayFromFp =
189 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; 189 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize;
190 static const int kBytecodeOffsetFromFp = 190 static const int kBytecodeOffsetFromFp =
191 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; 191 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize;
192 static const int kRegisterFilePointerFromFp = 192 static const int kRegisterFilePointerFromFp =
193 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; 193 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize;
194 194
195 static const int kExpressionsOffset = kRegisterFilePointerFromFp;
196
195 // Expression index for {StandardFrame::GetExpressionAddress}. 197 // Expression index for {StandardFrame::GetExpressionAddress}.
196 static const int kBytecodeArrayExpressionIndex = 1; 198 static const int kBytecodeArrayExpressionIndex = -2;
197 static const int kBytecodeOffsetExpressionIndex = 2; 199 static const int kBytecodeOffsetExpressionIndex = -1;
198 static const int kRegisterFileExpressionIndex = 3; 200 static const int kRegisterFileExpressionIndex = 0;
199 201
200 // Register file pointer relative. 202 // Register file pointer relative.
201 static const int kLastParamFromRegisterPointer = 203 static const int kLastParamFromRegisterPointer =
202 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize; 204 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize;
203 205
204 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize; 206 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize;
205 static const int kBytecodeArrayFromRegisterPointer = 2 * kPointerSize; 207 static const int kBytecodeArrayFromRegisterPointer = 2 * kPointerSize;
206 static const int kNewTargetFromRegisterPointer = 3 * kPointerSize; 208 static const int kNewTargetFromRegisterPointer = 3 * kPointerSize;
207 static const int kFunctionFromRegisterPointer = 4 * kPointerSize; 209 static const int kFunctionFromRegisterPointer = 4 * kPointerSize;
208 static const int kContextFromRegisterPointer = 5 * kPointerSize; 210 static const int kContextFromRegisterPointer = 5 * kPointerSize;
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 // Testers. 493 // Testers.
492 bool is_standard() const override { return true; } 494 bool is_standard() const override { return true; }
493 495
494 // Accessors. 496 // Accessors.
495 inline Object* context() const; 497 inline Object* context() const;
496 498
497 // Access the expressions in the stack frame including locals. 499 // Access the expressions in the stack frame including locals.
498 inline Object* GetExpression(int index) const; 500 inline Object* GetExpression(int index) const;
499 inline void SetExpression(int index, Object* value); 501 inline void SetExpression(int index, Object* value);
500 int ComputeExpressionsCount() const; 502 int ComputeExpressionsCount() const;
501 static Object* GetExpression(Address fp, int index);
502 503
503 void SetCallerFp(Address caller_fp) override; 504 void SetCallerFp(Address caller_fp) override;
504 505
505 static StandardFrame* cast(StackFrame* frame) { 506 static StandardFrame* cast(StackFrame* frame) {
506 DCHECK(frame->is_standard()); 507 DCHECK(frame->is_standard());
507 return static_cast<StandardFrame*>(frame); 508 return static_cast<StandardFrame*>(frame);
508 } 509 }
509 510
510 protected: 511 protected:
511 inline explicit StandardFrame(StackFrameIteratorBase* iterator); 512 inline explicit StandardFrame(StackFrameIteratorBase* iterator);
(...skipping 10 matching lines...) Expand all
522 523
523 // Computes the address of the constant pool field in the standard 524 // Computes the address of the constant pool field in the standard
524 // frame given by the provided frame pointer. 525 // frame given by the provided frame pointer.
525 static inline Address ComputeConstantPoolAddress(Address fp); 526 static inline Address ComputeConstantPoolAddress(Address fp);
526 527
527 // Iterate over expression stack including stack handlers, locals, 528 // Iterate over expression stack including stack handlers, locals,
528 // and parts of the fixed part including context and code fields. 529 // and parts of the fixed part including context and code fields.
529 void IterateExpressions(ObjectVisitor* v) const; 530 void IterateExpressions(ObjectVisitor* v) const;
530 531
531 // Returns the address of the n'th expression stack element. 532 // Returns the address of the n'th expression stack element.
532 Address GetExpressionAddress(int n) const; 533 virtual Address GetExpressionAddress(int n) const;
533 static Address GetExpressionAddress(Address fp, int n);
534 534
535 // Determines if the standard frame for the given frame pointer is 535 // Determines if the standard frame for the given frame pointer is
536 // an arguments adaptor frame. 536 // an arguments adaptor frame.
537 static inline bool IsArgumentsAdaptorFrame(Address fp); 537 static inline bool IsArgumentsAdaptorFrame(Address fp);
538 538
539 // Determines if the standard frame for the given frame pointer is a 539 // Determines if the standard frame for the given frame pointer is a
540 // construct frame. 540 // construct frame.
541 static inline bool IsConstructFrame(Address fp); 541 static inline bool IsConstructFrame(Address fp);
542 542
543 // Used by OptimizedFrames and StubFrames. 543 // Used by OptimizedFrames and StubFrames.
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 749
750 // Access to the interpreter register file for this frame. 750 // Access to the interpreter register file for this frame.
751 Object* GetInterpreterRegister(int register_index) const; 751 Object* GetInterpreterRegister(int register_index) const;
752 752
753 // Build a list with summaries for this frame including all inlined frames. 753 // Build a list with summaries for this frame including all inlined frames.
754 void Summarize(List<FrameSummary>* frames) override; 754 void Summarize(List<FrameSummary>* frames) override;
755 755
756 protected: 756 protected:
757 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); 757 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator);
758 758
759 Address GetExpressionAddress(int n) const override;
760
759 private: 761 private:
760 friend class StackFrameIteratorBase; 762 friend class StackFrameIteratorBase;
761 }; 763 };
762 764
763 765
764 // Arguments adaptor frames are automatically inserted below 766 // Arguments adaptor frames are automatically inserted below
765 // JavaScript frames when the actual number of parameters does not 767 // JavaScript frames when the actual number of parameters does not
766 // match the formal number of parameters. 768 // match the formal number of parameters.
767 class ArgumentsAdaptorFrame: public JavaScriptFrame { 769 class ArgumentsAdaptorFrame: public JavaScriptFrame {
768 public: 770 public:
769 Type type() const override { return ARGUMENTS_ADAPTOR; } 771 Type type() const override { return ARGUMENTS_ADAPTOR; }
770 772
771 // Determine the code for the frame. 773 // Determine the code for the frame.
772 Code* unchecked_code() const override; 774 Code* unchecked_code() const override;
773 775
774 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { 776 static ArgumentsAdaptorFrame* cast(StackFrame* frame) {
775 DCHECK(frame->is_arguments_adaptor()); 777 DCHECK(frame->is_arguments_adaptor());
776 return static_cast<ArgumentsAdaptorFrame*>(frame); 778 return static_cast<ArgumentsAdaptorFrame*>(frame);
777 } 779 }
778 780
779 // Printing support. 781 // Printing support.
780 void Print(StringStream* accumulator, PrintMode mode, 782 void Print(StringStream* accumulator, PrintMode mode,
781 int index) const override; 783 int index) const override;
782 784
785 static int GetLength(Address fp);
786
783 protected: 787 protected:
784 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator); 788 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator);
785 789
786 int GetNumberOfIncomingArguments() const override; 790 int GetNumberOfIncomingArguments() const override;
787 791
788 Address GetCallerStackPointer() const override; 792 Address GetCallerStackPointer() const override;
789 793
790 private: 794 private:
791 friend class StackFrameIteratorBase; 795 friend class StackFrameIteratorBase;
792 }; 796 };
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 1009
1006 1010
1007 // Reads all frames on the current stack and copies them into the current 1011 // Reads all frames on the current stack and copies them into the current
1008 // zone memory. 1012 // zone memory.
1009 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 1013 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
1010 1014
1011 } // namespace internal 1015 } // namespace internal
1012 } // namespace v8 1016 } // namespace v8
1013 1017
1014 #endif // V8_FRAMES_H_ 1018 #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