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/ast.h" | 9 #include "src/ast.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 } | 749 } |
750 | 750 |
751 | 751 |
752 bool JavaScriptFrame::HasInlinedFrames() const { | 752 bool JavaScriptFrame::HasInlinedFrames() const { |
753 List<JSFunction*> functions(1); | 753 List<JSFunction*> functions(1); |
754 GetFunctions(&functions); | 754 GetFunctions(&functions); |
755 return functions.length() > 1; | 755 return functions.length() > 1; |
756 } | 756 } |
757 | 757 |
758 | 758 |
759 Object* JavaScriptFrame::GetOriginalConstructor() const { | 759 Object* JavaScriptFrame::GetNewTarget() const { |
760 DCHECK(!HasInlinedFrames()); | 760 DCHECK(!HasInlinedFrames()); |
761 Address fp = caller_fp(); | 761 Address fp = caller_fp(); |
762 if (has_adapted_arguments()) { | 762 if (has_adapted_arguments()) { |
763 // Skip the arguments adaptor frame and look at the real caller. | 763 // Skip the arguments adaptor frame and look at the real caller. |
764 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); | 764 fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); |
765 } | 765 } |
766 DCHECK(IsConstructFrame(fp)); | 766 DCHECK(IsConstructFrame(fp)); |
767 STATIC_ASSERT(ConstructFrameConstants::kOriginalConstructorOffset == | 767 STATIC_ASSERT(ConstructFrameConstants::kNewTargetOffset == |
768 StandardFrameConstants::kExpressionsOffset - 3 * kPointerSize); | 768 StandardFrameConstants::kExpressionsOffset - 3 * kPointerSize); |
769 return GetExpression(fp, 3); | 769 return GetExpression(fp, 3); |
770 } | 770 } |
771 | 771 |
772 | 772 |
773 int JavaScriptFrame::GetArgumentsLength() const { | 773 int JavaScriptFrame::GetArgumentsLength() const { |
774 // If there is an arguments adaptor frame get the arguments length from it. | 774 // If there is an arguments adaptor frame get the arguments length from it. |
775 if (has_adapted_arguments()) { | 775 if (has_adapted_arguments()) { |
776 STATIC_ASSERT(ArgumentsAdaptorFrameConstants::kLengthOffset == | 776 STATIC_ASSERT(ArgumentsAdaptorFrameConstants::kLengthOffset == |
777 StandardFrameConstants::kExpressionsOffset); | 777 StandardFrameConstants::kExpressionsOffset); |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1591 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1592 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1592 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1593 list.Add(frame, zone); | 1593 list.Add(frame, zone); |
1594 } | 1594 } |
1595 return list.ToVector(); | 1595 return list.ToVector(); |
1596 } | 1596 } |
1597 | 1597 |
1598 | 1598 |
1599 } // namespace internal | 1599 } // namespace internal |
1600 } // namespace v8 | 1600 } // namespace v8 |
OLD | NEW |