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

Side by Side Diff: src/debug.cc

Issue 1737023: Turn some usages of NewArray with DeleteArray in the same scope into ScopedVector or SmartPointer. (Closed)
Patch Set: Disabling implicit constructors Created 10 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
« no previous file with comments | « src/builtins.cc ('k') | src/debug-agent.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "log.h" 45 #include "log.h"
46 46
47 #include "../include/v8-debug.h" 47 #include "../include/v8-debug.h"
48 48
49 namespace v8 { 49 namespace v8 {
50 namespace internal { 50 namespace internal {
51 51
52 #ifdef ENABLE_DEBUGGER_SUPPORT 52 #ifdef ENABLE_DEBUGGER_SUPPORT
53 static void PrintLn(v8::Local<v8::Value> value) { 53 static void PrintLn(v8::Local<v8::Value> value) {
54 v8::Local<v8::String> s = value->ToString(); 54 v8::Local<v8::String> s = value->ToString();
55 char* data = NewArray<char>(s->Length() + 1); 55 ScopedVector<char> data(s->Length() + 1);
56 if (data == NULL) { 56 if (data.start() == NULL) {
57 V8::FatalProcessOutOfMemory("PrintLn"); 57 V8::FatalProcessOutOfMemory("PrintLn");
58 return; 58 return;
59 } 59 }
60 s->WriteAscii(data); 60 s->WriteAscii(data.start());
61 PrintF("%s\n", data); 61 PrintF("%s\n", data.start());
62 DeleteArray(data);
63 } 62 }
64 63
65 64
66 static Handle<Code> ComputeCallDebugBreak(int argc) { 65 static Handle<Code> ComputeCallDebugBreak(int argc) {
67 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugBreak(argc), Code); 66 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugBreak(argc), Code);
68 } 67 }
69 68
70 69
71 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc) { 70 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc) {
72 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugPrepareStepIn(argc), Code); 71 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugPrepareStepIn(argc), Code);
(...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2802 { 2801 {
2803 Locker locker; 2802 Locker locker;
2804 Debugger::CallMessageDispatchHandler(); 2803 Debugger::CallMessageDispatchHandler();
2805 } 2804 }
2806 } 2805 }
2807 } 2806 }
2808 2807
2809 #endif // ENABLE_DEBUGGER_SUPPORT 2808 #endif // ENABLE_DEBUGGER_SUPPORT
2810 2809
2811 } } // namespace v8::internal 2810 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/debug-agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698