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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 } else { | 1074 } else { |
1075 CHECK_EQ(Translation::JS_FRAME_FUNCTION, opcode); | 1075 CHECK_EQ(Translation::JS_FRAME_FUNCTION, opcode); |
1076 function = this->function(); | 1076 function = this->function(); |
1077 } | 1077 } |
1078 functions->Add(JSFunction::cast(function)); | 1078 functions->Add(JSFunction::cast(function)); |
1079 } | 1079 } |
1080 } | 1080 } |
1081 } | 1081 } |
1082 | 1082 |
1083 | 1083 |
| 1084 int OptimizedFrame::StackSlotOffsetRelativeToFp(int slot_index) { |
| 1085 return StandardFrameConstants::kCallerSPOffset - |
| 1086 ((slot_index + 1) * kPointerSize); |
| 1087 } |
| 1088 |
| 1089 |
1084 Object* OptimizedFrame::StackSlotAt(int index) const { | 1090 Object* OptimizedFrame::StackSlotAt(int index) const { |
1085 // Positive index means the value is spilled to the locals | 1091 return Memory::Object_at(fp() + StackSlotOffsetRelativeToFp(index)); |
1086 // area. Negative means it is stored in the incoming parameter | |
1087 // area. | |
1088 if (index >= 0) return GetExpression(index); | |
1089 | |
1090 // Index -1 overlaps with last parameter, -n with the first parameter, | |
1091 // (-n - 1) with the receiver with n being the number of parameters | |
1092 // of the outermost, optimized frame. | |
1093 int const parameter_count = ComputeParametersCount(); | |
1094 int const parameter_index = index + parameter_count; | |
1095 return (parameter_index == -1) ? receiver() : GetParameter(parameter_index); | |
1096 } | 1092 } |
1097 | 1093 |
1098 | 1094 |
1099 int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const { | 1095 int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const { |
1100 return Smi::cast(GetExpression(0))->value(); | 1096 return Smi::cast(GetExpression(0))->value(); |
1101 } | 1097 } |
1102 | 1098 |
1103 | 1099 |
1104 Address ArgumentsAdaptorFrame::GetCallerStackPointer() const { | 1100 Address ArgumentsAdaptorFrame::GetCallerStackPointer() const { |
1105 return fp() + StandardFrameConstants::kCallerSPOffset; | 1101 return fp() + StandardFrameConstants::kCallerSPOffset; |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1549 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1554 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1550 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1555 list.Add(frame, zone); | 1551 list.Add(frame, zone); |
1556 } | 1552 } |
1557 return list.ToVector(); | 1553 return list.ToVector(); |
1558 } | 1554 } |
1559 | 1555 |
1560 | 1556 |
1561 } // namespace internal | 1557 } // namespace internal |
1562 } // namespace v8 | 1558 } // namespace v8 |
OLD | NEW |