Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/frames.cc

Issue 306543002: Harden Runtime_FunctionSetPrototype, Isolate::PrintStack (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "v8.h" 5 #include "v8.h"
6 6
7 #include "ast.h" 7 #include "ast.h"
8 #include "deoptimizer.h" 8 #include "deoptimizer.h"
9 #include "frames-inl.h" 9 #include "frames-inl.h"
10 #include "full-codegen.h" 10 #include "full-codegen.h"
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 accumulator->Add("// no expression found - inconsistent frame?"); 1228 accumulator->Add("// no expression found - inconsistent frame?");
1229 } 1229 }
1230 accumulator->Add("\n"); 1230 accumulator->Add("\n");
1231 } 1231 }
1232 1232
1233 // Try to get hold of the context of this frame. 1233 // Try to get hold of the context of this frame.
1234 Context* context = NULL; 1234 Context* context = NULL;
1235 if (this->context() != NULL && this->context()->IsContext()) { 1235 if (this->context() != NULL && this->context()->IsContext()) {
1236 context = Context::cast(this->context()); 1236 context = Context::cast(this->context());
1237 } 1237 }
1238 while (context->IsWithContext()) {
1239 context = context->previous();
1240 ASSERT(context != NULL);
1241 }
1238 1242
1239 // Print heap-allocated local variables. 1243 // Print heap-allocated local variables.
1240 if (heap_locals_count > 0) { 1244 if (heap_locals_count > 0) {
1241 accumulator->Add(" // heap-allocated locals\n"); 1245 accumulator->Add(" // heap-allocated locals\n");
1242 } 1246 }
1243 for (int i = 0; i < heap_locals_count; i++) { 1247 for (int i = 0; i < heap_locals_count; i++) {
1244 accumulator->Add(" var "); 1248 accumulator->Add(" var ");
1245 accumulator->PrintName(scope_info->ContextLocalName(i)); 1249 accumulator->PrintName(scope_info->ContextLocalName(i));
1246 accumulator->Add(" = "); 1250 accumulator->Add(" = ");
1247 if (context != NULL) { 1251 if (context != NULL) {
1248 if (i < context->length()) { 1252 int index = Context::MIN_CONTEXT_SLOTS + i;
1249 accumulator->Add("%o", context->get(Context::MIN_CONTEXT_SLOTS + i)); 1253 if (index < context->length()) {
1254 accumulator->Add("%o", context->get(index));
1250 } else { 1255 } else {
1251 accumulator->Add( 1256 accumulator->Add(
1252 "// warning: missing context slot - inconsistent frame?"); 1257 "// warning: missing context slot - inconsistent frame?");
1253 } 1258 }
1254 } else { 1259 } else {
1255 accumulator->Add("// warning: no context found - inconsistent frame?"); 1260 accumulator->Add("// warning: no context found - inconsistent frame?");
1256 } 1261 }
1257 accumulator->Add("\n"); 1262 accumulator->Add("\n");
1258 } 1263 }
1259 1264
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 ZoneList<StackFrame*> list(10, zone); 1621 ZoneList<StackFrame*> list(10, zone);
1617 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { 1622 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) {
1618 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); 1623 StackFrame* frame = AllocateFrameCopy(it.frame(), zone);
1619 list.Add(frame, zone); 1624 list.Add(frame, zone);
1620 } 1625 }
1621 return list.ToVector(); 1626 return list.ToVector();
1622 } 1627 }
1623 1628
1624 1629
1625 } } // namespace v8::internal 1630 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698