| 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/ast.h" | 9 #include "src/ast/ast.h" |
| 10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | 1156 |
| 1157 | 1157 |
| 1158 void InterpretedFrame::PatchBytecodeOffset(int new_offset) { | 1158 void InterpretedFrame::PatchBytecodeOffset(int new_offset) { |
| 1159 const int index = InterpreterFrameConstants::kBytecodeOffsetExpressionIndex; | 1159 const int index = InterpreterFrameConstants::kBytecodeOffsetExpressionIndex; |
| 1160 DCHECK_EQ(InterpreterFrameConstants::kBytecodeOffsetFromFp, | 1160 DCHECK_EQ(InterpreterFrameConstants::kBytecodeOffsetFromFp, |
| 1161 StandardFrameConstants::kExpressionsOffset - index * kPointerSize); | 1161 StandardFrameConstants::kExpressionsOffset - index * kPointerSize); |
| 1162 int raw_offset = new_offset + BytecodeArray::kHeaderSize - kHeapObjectTag; | 1162 int raw_offset = new_offset + BytecodeArray::kHeaderSize - kHeapObjectTag; |
| 1163 SetExpression(index, Smi::FromInt(raw_offset)); | 1163 SetExpression(index, Smi::FromInt(raw_offset)); |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 Object* InterpretedFrame::GetInterpreterRegister(int register_index) const { |
| 1167 const int index = InterpreterFrameConstants::kRegisterFileExpressionIndex; |
| 1168 DCHECK_EQ(InterpreterFrameConstants::kRegisterFilePointerFromFp, |
| 1169 StandardFrameConstants::kExpressionsOffset - index * kPointerSize); |
| 1170 return GetExpression(index + register_index); |
| 1171 } |
| 1172 |
| 1166 void InterpretedFrame::Summarize(List<FrameSummary>* functions) { | 1173 void InterpretedFrame::Summarize(List<FrameSummary>* functions) { |
| 1167 DCHECK(functions->length() == 0); | 1174 DCHECK(functions->length() == 0); |
| 1168 AbstractCode* abstract_code = | 1175 AbstractCode* abstract_code = |
| 1169 AbstractCode::cast(function()->shared()->bytecode_array()); | 1176 AbstractCode::cast(function()->shared()->bytecode_array()); |
| 1170 FrameSummary summary(receiver(), function(), abstract_code, | 1177 FrameSummary summary(receiver(), function(), abstract_code, |
| 1171 GetBytecodeOffset(), IsConstructor()); | 1178 GetBytecodeOffset(), IsConstructor()); |
| 1172 functions->Add(summary); | 1179 functions->Add(summary); |
| 1173 } | 1180 } |
| 1174 | 1181 |
| 1175 int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const { | 1182 int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1641 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
| 1635 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1642 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
| 1636 list.Add(frame, zone); | 1643 list.Add(frame, zone); |
| 1637 } | 1644 } |
| 1638 return list.ToVector(); | 1645 return list.ToVector(); |
| 1639 } | 1646 } |
| 1640 | 1647 |
| 1641 | 1648 |
| 1642 } // namespace internal | 1649 } // namespace internal |
| 1643 } // namespace v8 | 1650 } // namespace v8 |
| OLD | NEW |