| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 // Testers. | 416 // Testers. |
| 417 virtual bool is_standard() const { return true; } | 417 virtual bool is_standard() const { return true; } |
| 418 | 418 |
| 419 // Accessors. | 419 // Accessors. |
| 420 inline Object* context() const; | 420 inline Object* context() const; |
| 421 | 421 |
| 422 // Access the expressions in the stack frame including locals. | 422 // Access the expressions in the stack frame including locals. |
| 423 inline Object* GetExpression(int index) const; | 423 inline Object* GetExpression(int index) const; |
| 424 inline void SetExpression(int index, Object* value); | 424 inline void SetExpression(int index, Object* value); |
| 425 int ComputeExpressionsCount() const; | 425 int ComputeExpressionsCount() const; |
| 426 static Object* GetExpression(Address fp, int index); | 426 static Object* GetStandardFrameExpression(Address fp, int index); |
| 427 | 427 |
| 428 virtual void SetCallerFp(Address caller_fp); | 428 virtual void SetCallerFp(Address caller_fp); |
| 429 | 429 |
| 430 static StandardFrame* cast(StackFrame* frame) { | 430 static StandardFrame* cast(StackFrame* frame) { |
| 431 DCHECK(frame->is_standard()); | 431 DCHECK(frame->is_standard()); |
| 432 return static_cast<StandardFrame*>(frame); | 432 return static_cast<StandardFrame*>(frame); |
| 433 } | 433 } |
| 434 | 434 |
| 435 protected: | 435 protected: |
| 436 inline explicit StandardFrame(StackFrameIteratorBase* iterator); | 436 inline explicit StandardFrame(StackFrameIteratorBase* iterator); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 448 // Computes the address of the constant pool field in the standard | 448 // Computes the address of the constant pool field in the standard |
| 449 // frame given by the provided frame pointer. | 449 // frame given by the provided frame pointer. |
| 450 static inline Address ComputeConstantPoolAddress(Address fp); | 450 static inline Address ComputeConstantPoolAddress(Address fp); |
| 451 | 451 |
| 452 // Iterate over expression stack including stack handlers, locals, | 452 // Iterate over expression stack including stack handlers, locals, |
| 453 // and parts of the fixed part including context and code fields. | 453 // and parts of the fixed part including context and code fields. |
| 454 void IterateExpressions(ObjectVisitor* v) const; | 454 void IterateExpressions(ObjectVisitor* v) const; |
| 455 | 455 |
| 456 // Returns the address of the n'th expression stack element. | 456 // Returns the address of the n'th expression stack element. |
| 457 Address GetExpressionAddress(int n) const; | 457 Address GetExpressionAddress(int n) const; |
| 458 static Address GetExpressionAddress(Address fp, int n); | 458 static Address GetStandardFrameExpressionAddress(Address fp, int n); |
| 459 | 459 |
| 460 // Determines if the standard frame for the given frame pointer is | 460 // Determines if the standard frame for the given frame pointer is |
| 461 // an arguments adaptor frame. | 461 // an arguments adaptor frame. |
| 462 static inline bool IsArgumentsAdaptorFrame(Address fp); | 462 static inline bool IsArgumentsAdaptorFrame(Address fp); |
| 463 | 463 |
| 464 // Determines if the standard frame for the given frame pointer is a | 464 // Determines if the standard frame for the given frame pointer is a |
| 465 // construct frame. | 465 // construct frame. |
| 466 static inline bool IsConstructFrame(Address fp); | 466 static inline bool IsConstructFrame(Address fp); |
| 467 | 467 |
| 468 // Used by OptimizedFrames and StubFrames. | 468 // Used by OptimizedFrames and StubFrames. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 virtual Type type() const { return ARGUMENTS_ADAPTOR; } | 661 virtual Type type() const { return ARGUMENTS_ADAPTOR; } |
| 662 | 662 |
| 663 // Determine the code for the frame. | 663 // Determine the code for the frame. |
| 664 virtual Code* unchecked_code() const; | 664 virtual Code* unchecked_code() const; |
| 665 | 665 |
| 666 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { | 666 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { |
| 667 DCHECK(frame->is_arguments_adaptor()); | 667 DCHECK(frame->is_arguments_adaptor()); |
| 668 return static_cast<ArgumentsAdaptorFrame*>(frame); | 668 return static_cast<ArgumentsAdaptorFrame*>(frame); |
| 669 } | 669 } |
| 670 | 670 |
| 671 static int GetArgumentsLength(Address fp); |
| 672 |
| 671 // Printing support. | 673 // Printing support. |
| 672 virtual void Print(StringStream* accumulator, | 674 virtual void Print(StringStream* accumulator, |
| 673 PrintMode mode, | 675 PrintMode mode, |
| 674 int index) const; | 676 int index) const; |
| 675 | 677 |
| 676 protected: | 678 protected: |
| 677 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator); | 679 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator); |
| 678 | 680 |
| 679 virtual int GetNumberOfIncomingArguments() const; | 681 virtual int GetNumberOfIncomingArguments() const; |
| 680 | 682 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 }; | 899 }; |
| 898 | 900 |
| 899 | 901 |
| 900 // Reads all frames on the current stack and copies them into the current | 902 // Reads all frames on the current stack and copies them into the current |
| 901 // zone memory. | 903 // zone memory. |
| 902 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 904 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 903 | 905 |
| 904 } } // namespace v8::internal | 906 } } // namespace v8::internal |
| 905 | 907 |
| 906 #endif // V8_FRAMES_H_ | 908 #endif // V8_FRAMES_H_ |
| OLD | NEW |