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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 // Testers. | 460 // Testers. |
461 virtual bool is_standard() const { return true; } | 461 virtual bool is_standard() const { return true; } |
462 | 462 |
463 // Accessors. | 463 // Accessors. |
464 inline Object* context() const; | 464 inline Object* context() const; |
465 | 465 |
466 // Access the expressions in the stack frame including locals. | 466 // Access the expressions in the stack frame including locals. |
467 inline Object* GetExpression(int index) const; | 467 inline Object* GetExpression(int index) const; |
468 inline void SetExpression(int index, Object* value); | 468 inline void SetExpression(int index, Object* value); |
469 int ComputeExpressionsCount() const; | 469 int ComputeExpressionsCount() const; |
470 static Object* GetExpression(Address fp, int index); | 470 static Object* GetStandardFrameExpression(Address fp, int index); |
471 | 471 |
472 virtual void SetCallerFp(Address caller_fp); | 472 virtual void SetCallerFp(Address caller_fp); |
473 | 473 |
474 static StandardFrame* cast(StackFrame* frame) { | 474 static StandardFrame* cast(StackFrame* frame) { |
475 DCHECK(frame->is_standard()); | 475 DCHECK(frame->is_standard()); |
476 return static_cast<StandardFrame*>(frame); | 476 return static_cast<StandardFrame*>(frame); |
477 } | 477 } |
478 | 478 |
479 protected: | 479 protected: |
480 inline explicit StandardFrame(StackFrameIteratorBase* iterator); | 480 inline explicit StandardFrame(StackFrameIteratorBase* iterator); |
(...skipping 11 matching lines...) Expand all Loading... |
492 // Computes the address of the constant pool field in the standard | 492 // Computes the address of the constant pool field in the standard |
493 // frame given by the provided frame pointer. | 493 // frame given by the provided frame pointer. |
494 static inline Address ComputeConstantPoolAddress(Address fp); | 494 static inline Address ComputeConstantPoolAddress(Address fp); |
495 | 495 |
496 // Iterate over expression stack including stack handlers, locals, | 496 // Iterate over expression stack including stack handlers, locals, |
497 // and parts of the fixed part including context and code fields. | 497 // and parts of the fixed part including context and code fields. |
498 void IterateExpressions(ObjectVisitor* v) const; | 498 void IterateExpressions(ObjectVisitor* v) const; |
499 | 499 |
500 // Returns the address of the n'th expression stack element. | 500 // Returns the address of the n'th expression stack element. |
501 Address GetExpressionAddress(int n) const; | 501 Address GetExpressionAddress(int n) const; |
502 static Address GetExpressionAddress(Address fp, int n); | 502 static Address GetStandardFrameExpressionAddress(Address fp, int n); |
503 | 503 |
504 // Determines if the n'th expression stack element is in a stack | 504 // Determines if the n'th expression stack element is in a stack |
505 // handler or not. Requires traversing all handlers in this frame. | 505 // handler or not. Requires traversing all handlers in this frame. |
506 bool IsExpressionInsideHandler(int n) const; | 506 bool IsExpressionInsideHandler(int n) const; |
507 | 507 |
508 // Determines if the standard frame for the given frame pointer is | 508 // Determines if the standard frame for the given frame pointer is |
509 // an arguments adaptor frame. | 509 // an arguments adaptor frame. |
510 static inline bool IsArgumentsAdaptorFrame(Address fp); | 510 static inline bool IsArgumentsAdaptorFrame(Address fp); |
511 | 511 |
512 // Determines if the standard frame for the given frame pointer is a | 512 // Determines if the standard frame for the given frame pointer is a |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 virtual Type type() const { return ARGUMENTS_ADAPTOR; } | 701 virtual Type type() const { return ARGUMENTS_ADAPTOR; } |
702 | 702 |
703 // Determine the code for the frame. | 703 // Determine the code for the frame. |
704 virtual Code* unchecked_code() const; | 704 virtual Code* unchecked_code() const; |
705 | 705 |
706 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { | 706 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { |
707 DCHECK(frame->is_arguments_adaptor()); | 707 DCHECK(frame->is_arguments_adaptor()); |
708 return static_cast<ArgumentsAdaptorFrame*>(frame); | 708 return static_cast<ArgumentsAdaptorFrame*>(frame); |
709 } | 709 } |
710 | 710 |
| 711 static int GetArgumentsLength(Address fp); |
| 712 |
711 // Printing support. | 713 // Printing support. |
712 virtual void Print(StringStream* accumulator, | 714 virtual void Print(StringStream* accumulator, |
713 PrintMode mode, | 715 PrintMode mode, |
714 int index) const; | 716 int index) const; |
715 | 717 |
716 protected: | 718 protected: |
717 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator); | 719 inline explicit ArgumentsAdaptorFrame(StackFrameIteratorBase* iterator); |
718 | 720 |
719 virtual int GetNumberOfIncomingArguments() const; | 721 virtual int GetNumberOfIncomingArguments() const; |
720 | 722 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 }; | 939 }; |
938 | 940 |
939 | 941 |
940 // Reads all frames on the current stack and copies them into the current | 942 // Reads all frames on the current stack and copies them into the current |
941 // zone memory. | 943 // zone memory. |
942 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 944 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
943 | 945 |
944 } } // namespace v8::internal | 946 } } // namespace v8::internal |
945 | 947 |
946 #endif // V8_FRAMES_H_ | 948 #endif // V8_FRAMES_H_ |
OLD | NEW |