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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 } | 1243 } |
1244 | 1244 |
1245 void InterpretedFrame::PatchBytecodeArray(BytecodeArray* bytecode_array) { | 1245 void InterpretedFrame::PatchBytecodeArray(BytecodeArray* bytecode_array) { |
1246 const int index = InterpreterFrameConstants::kBytecodeArrayExpressionIndex; | 1246 const int index = InterpreterFrameConstants::kBytecodeArrayExpressionIndex; |
1247 DCHECK_EQ( | 1247 DCHECK_EQ( |
1248 InterpreterFrameConstants::kBytecodeArrayFromFp, | 1248 InterpreterFrameConstants::kBytecodeArrayFromFp, |
1249 InterpreterFrameConstants::kExpressionsOffset - index * kPointerSize); | 1249 InterpreterFrameConstants::kExpressionsOffset - index * kPointerSize); |
1250 SetExpression(index, bytecode_array); | 1250 SetExpression(index, bytecode_array); |
1251 } | 1251 } |
1252 | 1252 |
1253 Object* InterpretedFrame::GetInterpreterRegister(int register_index) const { | 1253 Object* InterpretedFrame::ReadInterpreterRegister(int register_index) const { |
1254 const int index = InterpreterFrameConstants::kRegisterFileExpressionIndex; | 1254 const int index = InterpreterFrameConstants::kRegisterFileExpressionIndex; |
1255 DCHECK_EQ( | 1255 DCHECK_EQ( |
1256 InterpreterFrameConstants::kRegisterFilePointerFromFp, | 1256 InterpreterFrameConstants::kRegisterFilePointerFromFp, |
1257 InterpreterFrameConstants::kExpressionsOffset - index * kPointerSize); | 1257 InterpreterFrameConstants::kExpressionsOffset - index * kPointerSize); |
1258 return GetExpression(index + register_index); | 1258 return GetExpression(index + register_index); |
1259 } | 1259 } |
1260 | 1260 |
| 1261 void InterpretedFrame::WriteInterpreterRegister(int register_index, |
| 1262 Object* value) { |
| 1263 const int index = InterpreterFrameConstants::kRegisterFileExpressionIndex; |
| 1264 DCHECK_EQ( |
| 1265 InterpreterFrameConstants::kRegisterFilePointerFromFp, |
| 1266 InterpreterFrameConstants::kExpressionsOffset - index * kPointerSize); |
| 1267 return SetExpression(index + register_index, value); |
| 1268 } |
| 1269 |
1261 void InterpretedFrame::Summarize(List<FrameSummary>* functions) const { | 1270 void InterpretedFrame::Summarize(List<FrameSummary>* functions) const { |
1262 DCHECK(functions->length() == 0); | 1271 DCHECK(functions->length() == 0); |
1263 AbstractCode* abstract_code = | 1272 AbstractCode* abstract_code = |
1264 AbstractCode::cast(function()->shared()->bytecode_array()); | 1273 AbstractCode::cast(function()->shared()->bytecode_array()); |
1265 FrameSummary summary(receiver(), function(), abstract_code, | 1274 FrameSummary summary(receiver(), function(), abstract_code, |
1266 GetBytecodeOffset(), IsConstructor()); | 1275 GetBytecodeOffset(), IsConstructor()); |
1267 functions->Add(summary); | 1276 functions->Add(summary); |
1268 } | 1277 } |
1269 | 1278 |
1270 int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const { | 1279 int ArgumentsAdaptorFrame::GetNumberOfIncomingArguments() const { |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1763 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1755 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1764 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1756 list.Add(frame, zone); | 1765 list.Add(frame, zone); |
1757 } | 1766 } |
1758 return list.ToVector(); | 1767 return list.ToVector(); |
1759 } | 1768 } |
1760 | 1769 |
1761 | 1770 |
1762 } // namespace internal | 1771 } // namespace internal |
1763 } // namespace v8 | 1772 } // namespace v8 |
OLD | NEW |