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

Side by Side Diff: runtime/vm/debugger.cc

Issue 10836061: Change the zone allocation api. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « runtime/vm/dart_api_state.h ('k') | runtime/vm/double_conversion.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/debugger.h" 5 #include "vm/debugger.h"
6 6
7 #include "vm/code_generator.h" 7 #include "vm/code_generator.h"
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 const String& func_name = String::Handle(func.name()); 138 const String& func_name = String::Handle(func.name());
139 Class& func_class = Class::Handle(func.owner()); 139 Class& func_class = Class::Handle(func.owner());
140 String& class_name = String::Handle(func_class.Name()); 140 String& class_name = String::Handle(func_class.Name());
141 141
142 const char* kFormat = "%s%s%s"; 142 const char* kFormat = "%s%s%s";
143 intptr_t len = OS::SNPrint(NULL, 0, kFormat, 143 intptr_t len = OS::SNPrint(NULL, 0, kFormat,
144 func_class.IsTopLevel() ? "" : class_name.ToCString(), 144 func_class.IsTopLevel() ? "" : class_name.ToCString(),
145 func_class.IsTopLevel() ? "" : ".", 145 func_class.IsTopLevel() ? "" : ".",
146 func_name.ToCString()); 146 func_name.ToCString());
147 len++; // String terminator. 147 len++; // String terminator.
148 char* chars = reinterpret_cast<char*>( 148 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
149 Isolate::Current()->current_zone()->Allocate(len));
150 OS::SNPrint(chars, len, kFormat, 149 OS::SNPrint(chars, len, kFormat,
151 func_class.IsTopLevel() ? "" : class_name.ToCString(), 150 func_class.IsTopLevel() ? "" : class_name.ToCString(),
152 func_class.IsTopLevel() ? "" : ".", 151 func_class.IsTopLevel() ? "" : ".",
153 func_name.ToCString()); 152 func_name.ToCString());
154 return chars; 153 return chars;
155 } 154 }
156 155
157 156
158 RawString* ActivationFrame::QualifiedFunctionName() { 157 RawString* ActivationFrame::QualifiedFunctionName() {
159 const Function& func = DartFunction(); 158 const Function& func = DartFunction();
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 const char* kFormat = "Function: '%s' url: '%s' line: %d"; 430 const char* kFormat = "Function: '%s' url: '%s' line: %d";
432 431
433 const Function& func = DartFunction(); 432 const Function& func = DartFunction();
434 const String& url = String::Handle(SourceUrl()); 433 const String& url = String::Handle(SourceUrl());
435 intptr_t line = LineNumber(); 434 intptr_t line = LineNumber();
436 const char* func_name = Debugger::QualifiedFunctionName(func); 435 const char* func_name = Debugger::QualifiedFunctionName(func);
437 436
438 intptr_t len = 437 intptr_t len =
439 OS::SNPrint(NULL, 0, kFormat, func_name, url.ToCString(), line); 438 OS::SNPrint(NULL, 0, kFormat, func_name, url.ToCString(), line);
440 len++; // String terminator. 439 len++; // String terminator.
441 char* chars = reinterpret_cast<char*>( 440 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
442 Isolate::Current()->current_zone()->Allocate(len));
443 OS::SNPrint(chars, len, kFormat, func_name, url.ToCString(), line); 441 OS::SNPrint(chars, len, kFormat, func_name, url.ToCString(), line);
444 return chars; 442 return chars;
445 } 443 }
446 444
447 445
448 void DebuggerStackTrace::AddActivation(ActivationFrame* frame) { 446 void DebuggerStackTrace::AddActivation(ActivationFrame* frame) {
449 trace_.Add(frame); 447 trace_.Add(frame);
450 } 448 }
451 449
452 450
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 } 1568 }
1571 1569
1572 1570
1573 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { 1571 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) {
1574 ASSERT(bpt->next() == NULL); 1572 ASSERT(bpt->next() == NULL);
1575 bpt->set_next(code_breakpoints_); 1573 bpt->set_next(code_breakpoints_);
1576 code_breakpoints_ = bpt; 1574 code_breakpoints_ = bpt;
1577 } 1575 }
1578 1576
1579 } // namespace dart 1577 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/double_conversion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698