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 #include "src/frames.h" | 5 #include "src/frames.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 } | 730 } |
731 | 731 |
732 | 732 |
733 Object* JavaScriptFrame::GetOriginalConstructor() const { | 733 Object* JavaScriptFrame::GetOriginalConstructor() const { |
734 Address fp = caller_fp(); | 734 Address fp = caller_fp(); |
735 if (has_adapted_arguments()) { | 735 if (has_adapted_arguments()) { |
736 // Skip the arguments adaptor frame and look at the real caller. | 736 // Skip the arguments adaptor frame and look at the real caller. |
737 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); | 737 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); |
738 } | 738 } |
739 DCHECK(IsConstructFrame(fp)); | 739 DCHECK(IsConstructFrame(fp)); |
| 740 STATIC_ASSERT(ConstructFrameConstants::kOriginalConstructorOffset == |
| 741 StandardFrameConstants::kExpressionsOffset - 2 * kPointerSize); |
740 return GetExpression(fp, 2); | 742 return GetExpression(fp, 2); |
741 } | 743 } |
742 | 744 |
743 | 745 |
744 int JavaScriptFrame::GetArgumentsLength() const { | 746 int JavaScriptFrame::GetArgumentsLength() const { |
745 // If there is an arguments adaptor frame get the arguments length from it. | 747 // If there is an arguments adaptor frame get the arguments length from it. |
746 if (has_adapted_arguments()) { | 748 if (has_adapted_arguments()) { |
| 749 STATIC_ASSERT(ArgumentsAdaptorFrameConstants::kLengthOffset == |
| 750 StandardFrameConstants::kExpressionsOffset); |
747 return Smi::cast(GetExpression(caller_fp(), 0))->value(); | 751 return Smi::cast(GetExpression(caller_fp(), 0))->value(); |
748 } else { | 752 } else { |
749 return GetNumberOfIncomingArguments(); | 753 return GetNumberOfIncomingArguments(); |
750 } | 754 } |
751 } | 755 } |
752 | 756 |
753 | 757 |
754 Code* JavaScriptFrame::unchecked_code() const { | 758 Code* JavaScriptFrame::unchecked_code() const { |
755 return function()->code(); | 759 return function()->code(); |
756 } | 760 } |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1551 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1548 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1552 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1549 list.Add(frame, zone); | 1553 list.Add(frame, zone); |
1550 } | 1554 } |
1551 return list.ToVector(); | 1555 return list.ToVector(); |
1552 } | 1556 } |
1553 | 1557 |
1554 | 1558 |
1555 } // namespace internal | 1559 } // namespace internal |
1556 } // namespace v8 | 1560 } // namespace v8 |
OLD | NEW |