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

Side by Side Diff: runtime/vm/profiler.h

Issue 2363413004: VM: Avoid allocating strings when disassembling code. (Closed)
Patch Set: addressed comments Created 4 years, 2 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 | « runtime/vm/object_test.cc ('k') | runtime/vm/profiler_service.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #ifndef VM_PROFILER_H_ 5 #ifndef VM_PROFILER_H_
6 #define VM_PROFILER_H_ 6 #define VM_PROFILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/bitfield.h" 9 #include "vm/bitfield.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 uword Size() const; 428 uword Size() const;
429 429
430 int64_t CompileTimestamp() const; 430 int64_t CompileTimestamp() const;
431 431
432 RawCode* code() const { 432 RawCode* code() const {
433 return code_.raw(); 433 return code_.raw();
434 } 434 }
435 435
436 const char* Name() const { 436 const char* Name() const {
437 const String& name = String::Handle(code_.Name()); 437 return code_.Name();
438 return name.ToCString();
439 } 438 }
440 439
441 bool Contains(uword pc) const { 440 bool Contains(uword pc) const {
442 uword end = Start() + Size(); 441 uword end = Start() + Size();
443 return (pc >= Start()) && (pc < end); 442 return (pc >= Start()) && (pc < end);
444 } 443 }
445 444
446 static int Compare(CodeDescriptor* const* a, 445 static int Compare(CodeDescriptor* const* a,
447 CodeDescriptor* const* b) { 446 CodeDescriptor* const* b) {
448 ASSERT(a != NULL); 447 ASSERT(a != NULL);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 private: 678 private:
680 ZoneGrowableArray<ProcessedSample*> samples_; 679 ZoneGrowableArray<ProcessedSample*> samples_;
681 CodeLookupTable* code_lookup_table_; 680 CodeLookupTable* code_lookup_table_;
682 681
683 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); 682 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer);
684 }; 683 };
685 684
686 } // namespace dart 685 } // namespace dart
687 686
688 #endif // VM_PROFILER_H_ 687 #endif // VM_PROFILER_H_
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/profiler_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698