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" |
| 6 |
| 7 #include <sstream> |
| 8 |
5 #include "src/v8.h" | 9 #include "src/v8.h" |
6 | 10 |
7 #include "src/ast.h" | 11 #include "src/ast.h" |
8 #include "src/base/bits.h" | 12 #include "src/base/bits.h" |
9 #include "src/deoptimizer.h" | 13 #include "src/deoptimizer.h" |
10 #include "src/frames-inl.h" | 14 #include "src/frames-inl.h" |
11 #include "src/full-codegen.h" | 15 #include "src/full-codegen.h" |
12 #include "src/heap/mark-compact.h" | 16 #include "src/heap/mark-compact.h" |
13 #include "src/safepoint-table.h" | 17 #include "src/safepoint-table.h" |
14 #include "src/scopeinfo.h" | 18 #include "src/scopeinfo.h" |
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 if (expressions_start < expressions_count) { | 1285 if (expressions_start < expressions_count) { |
1282 accumulator->Add(" // expression stack (top to bottom)\n"); | 1286 accumulator->Add(" // expression stack (top to bottom)\n"); |
1283 } | 1287 } |
1284 for (int i = expressions_count - 1; i >= expressions_start; i--) { | 1288 for (int i = expressions_count - 1; i >= expressions_start; i--) { |
1285 if (IsExpressionInsideHandler(i)) continue; | 1289 if (IsExpressionInsideHandler(i)) continue; |
1286 accumulator->Add(" [%02d] : %o\n", i, GetExpression(i)); | 1290 accumulator->Add(" [%02d] : %o\n", i, GetExpression(i)); |
1287 } | 1291 } |
1288 | 1292 |
1289 // Print details about the function. | 1293 // Print details about the function. |
1290 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { | 1294 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { |
1291 OStringStream os; | 1295 std::ostringstream os; |
1292 SharedFunctionInfo* shared = function->shared(); | 1296 SharedFunctionInfo* shared = function->shared(); |
1293 os << "--------- s o u r c e c o d e ---------\n" | 1297 os << "--------- s o u r c e c o d e ---------\n" |
1294 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length) | 1298 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length) |
1295 << "\n-----------------------------------------\n"; | 1299 << "\n-----------------------------------------\n"; |
1296 accumulator->Add(os.c_str()); | 1300 accumulator->Add(os.str().c_str()); |
1297 } | 1301 } |
1298 | 1302 |
1299 accumulator->Add("}\n\n"); | 1303 accumulator->Add("}\n\n"); |
1300 } | 1304 } |
1301 | 1305 |
1302 | 1306 |
1303 void ArgumentsAdaptorFrame::Print(StringStream* accumulator, | 1307 void ArgumentsAdaptorFrame::Print(StringStream* accumulator, |
1304 PrintMode mode, | 1308 PrintMode mode, |
1305 int index) const { | 1309 int index) const { |
1306 int actual = ComputeParametersCount(); | 1310 int actual = ComputeParametersCount(); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 ZoneList<StackFrame*> list(10, zone); | 1639 ZoneList<StackFrame*> list(10, zone); |
1636 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1640 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1637 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1641 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1638 list.Add(frame, zone); | 1642 list.Add(frame, zone); |
1639 } | 1643 } |
1640 return list.ToVector(); | 1644 return list.ToVector(); |
1641 } | 1645 } |
1642 | 1646 |
1643 | 1647 |
1644 } } // namespace v8::internal | 1648 } } // namespace v8::internal |
OLD | NEW |