| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 return; | 981 return; |
| 982 } | 982 } |
| 983 if (is_optimized()) { | 983 if (is_optimized()) { |
| 984 accumulator->Add(" {\n// optimized frame\n}\n"); | 984 accumulator->Add(" {\n// optimized frame\n}\n"); |
| 985 return; | 985 return; |
| 986 } | 986 } |
| 987 accumulator->Add(" {\n"); | 987 accumulator->Add(" {\n"); |
| 988 | 988 |
| 989 // Compute the number of locals and expression stack elements. | 989 // Compute the number of locals and expression stack elements. |
| 990 int stack_locals_count = info.number_of_stack_slots(); | 990 int stack_locals_count = info.number_of_stack_slots(); |
| 991 int first_stack_index = info.first_stack_index(); |
| 991 int heap_locals_count = info.number_of_context_slots(); | 992 int heap_locals_count = info.number_of_context_slots(); |
| 992 int expressions_count = ComputeExpressionsCount(); | 993 int expressions_count = ComputeExpressionsCount(); |
| 993 | 994 |
| 994 // Print stack-allocated local variables. | 995 // Print stack-allocated local variables. |
| 995 if (stack_locals_count > 0) { | 996 if (stack_locals_count > 0) { |
| 996 accumulator->Add(" // stack-allocated locals\n"); | 997 accumulator->Add(" // stack-allocated locals\n"); |
| 997 } | 998 } |
| 998 for (int i = 0; i < stack_locals_count; i++) { | 999 for (int i = 0; i < stack_locals_count; i++) { |
| 999 accumulator->Add(" var "); | 1000 accumulator->Add(" var "); |
| 1000 accumulator->PrintName(*info.stack_slot_name(i)); | 1001 accumulator->PrintName(*info.stack_slot_name(i)); |
| 1001 accumulator->Add(" = "); | 1002 accumulator->Add(" = "); |
| 1002 if (i < expressions_count) { | 1003 if (i + first_stack_index < expressions_count) { |
| 1003 accumulator->Add("%o", GetExpression(i)); | 1004 accumulator->Add("%o", GetExpression(i + first_stack_index)); |
| 1004 } else { | 1005 } else { |
| 1005 accumulator->Add("// no expression found - inconsistent frame?"); | 1006 accumulator->Add("// no expression found - inconsistent frame?"); |
| 1006 } | 1007 } |
| 1007 accumulator->Add("\n"); | 1008 accumulator->Add("\n"); |
| 1008 } | 1009 } |
| 1009 | 1010 |
| 1010 // Try to get hold of the context of this frame. | 1011 // Try to get hold of the context of this frame. |
| 1011 Context* context = NULL; | 1012 Context* context = NULL; |
| 1012 if (this->context() != NULL && this->context()->IsContext()) { | 1013 if (this->context() != NULL && this->context()->IsContext()) { |
| 1013 context = Context::cast(this->context()); | 1014 context = Context::cast(this->context()); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 ZoneList<StackFrame*> list(10); | 1271 ZoneList<StackFrame*> list(10); |
| 1271 for (StackFrameIterator it; !it.done(); it.Advance()) { | 1272 for (StackFrameIterator it; !it.done(); it.Advance()) { |
| 1272 StackFrame* frame = AllocateFrameCopy(it.frame()); | 1273 StackFrame* frame = AllocateFrameCopy(it.frame()); |
| 1273 list.Add(frame); | 1274 list.Add(frame); |
| 1274 } | 1275 } |
| 1275 return list.ToVector(); | 1276 return list.ToVector(); |
| 1276 } | 1277 } |
| 1277 | 1278 |
| 1278 | 1279 |
| 1279 } } // namespace v8::internal | 1280 } } // namespace v8::internal |
| OLD | NEW |