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

Side by Side Diff: src/compiler/pipeline.cc

Issue 1007283006: Make valgrind a bit more happy by zero-terminating/initializing strings. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed useless assignment. Fixed a condition. Created 5 years, 9 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/compiler/graph-visualizer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/pipeline.h" 5 #include "src/compiler/pipeline.h"
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/base/platform/elapsed-timer.h" 10 #include "src/base/platform/elapsed-timer.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 285
286 static void TraceSchedule(Schedule* schedule) { 286 static void TraceSchedule(Schedule* schedule) {
287 if (!FLAG_trace_turbo_graph && !FLAG_trace_turbo_scheduler) return; 287 if (!FLAG_trace_turbo_graph && !FLAG_trace_turbo_scheduler) return;
288 OFStream os(stdout); 288 OFStream os(stdout);
289 os << "-- Schedule --------------------------------------\n" << *schedule; 289 os << "-- Schedule --------------------------------------\n" << *schedule;
290 } 290 }
291 291
292 292
293 static SmartArrayPointer<char> GetDebugName(CompilationInfo* info) { 293 static SmartArrayPointer<char> GetDebugName(CompilationInfo* info) {
294 SmartArrayPointer<char> name; 294 if (info->code_stub() != NULL) {
295 if (info->IsStub()) { 295 CodeStub::Major major_key = info->code_stub()->MajorKey();
296 if (info->code_stub() != NULL) { 296 const char* major_name = CodeStub::MajorName(major_key, false);
297 CodeStub::Major major_key = info->code_stub()->MajorKey(); 297 size_t len = strlen(major_name) + 1;
298 const char* major_name = CodeStub::MajorName(major_key, false); 298 SmartArrayPointer<char> name(new char[len]);
299 size_t len = strlen(major_name); 299 memcpy(name.get(), major_name, len);
300 name.Reset(new char[len]); 300 return name;
301 memcpy(name.get(), major_name, len);
302 }
303 } else { 301 } else {
304 AllowHandleDereference allow_deref; 302 AllowHandleDereference allow_deref;
305 name = info->function()->debug_name()->ToCString(); 303 return info->function()->debug_name()->ToCString();
306 } 304 }
307 return name;
308 } 305 }
309 306
310 307
311 class AstGraphBuilderWithPositions : public AstGraphBuilder { 308 class AstGraphBuilderWithPositions : public AstGraphBuilder {
312 public: 309 public:
313 AstGraphBuilderWithPositions(Zone* local_zone, CompilationInfo* info, 310 AstGraphBuilderWithPositions(Zone* local_zone, CompilationInfo* info,
314 JSGraph* jsgraph, 311 JSGraph* jsgraph,
315 LoopAssignmentAnalysis* loop_assignment, 312 LoopAssignmentAnalysis* loop_assignment,
316 SourcePositionTable* source_positions) 313 SourcePositionTable* source_positions)
317 : AstGraphBuilder(local_zone, info, jsgraph, loop_assignment), 314 : AstGraphBuilder(local_zone, info, jsgraph, loop_assignment),
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 1195
1199 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) { 1196 if (FLAG_trace_turbo && !data->MayHaveUnverifiableGraph()) {
1200 TurboCfgFile tcf(data->isolate()); 1197 TurboCfgFile tcf(data->isolate());
1201 tcf << AsC1VAllocator("CodeGen", data->register_allocator()); 1198 tcf << AsC1VAllocator("CodeGen", data->register_allocator());
1202 } 1199 }
1203 } 1200 }
1204 1201
1205 } // namespace compiler 1202 } // namespace compiler
1206 } // namespace internal 1203 } // namespace internal
1207 } // namespace v8 1204 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698