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

Side by Side Diff: src/basic-block-profiler.h

Issue 606403003: Refactor BasicBlock, no inheritance from GenericNode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Attempt n+1 to address the size_t madness Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/basic-block-profiler.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 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 #ifndef V8_BASIC_BLOCK_PROFILER_H_ 5 #ifndef V8_BASIC_BLOCK_PROFILER_H_
6 #define V8_BASIC_BLOCK_PROFILER_H_ 6 #define V8_BASIC_BLOCK_PROFILER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 class Schedule; 15 class Schedule;
16 class Graph; 16 class Graph;
17 17
18 class BasicBlockProfiler { 18 class BasicBlockProfiler {
19 public: 19 public:
20 class Data { 20 class Data {
21 public: 21 public:
22 size_t n_blocks() const { return n_blocks_; } 22 size_t n_blocks() const { return n_blocks_; }
23 const uint32_t* counts() const { return &counts_[0]; } 23 const uint32_t* counts() const { return &counts_[0]; }
24 24
25 void SetCode(OStringStream* os); 25 void SetCode(OStringStream* os);
26 void SetFunctionName(OStringStream* os); 26 void SetFunctionName(OStringStream* os);
27 void SetSchedule(OStringStream* os); 27 void SetSchedule(OStringStream* os);
28 void SetBlockId(size_t offset, int block_id); 28 void SetBlockId(size_t offset, size_t block_id);
29 uint32_t* GetCounterAddress(size_t offset); 29 uint32_t* GetCounterAddress(size_t offset);
30 30
31 private: 31 private:
32 friend class BasicBlockProfiler; 32 friend class BasicBlockProfiler;
33 friend OStream& operator<<(OStream& os, const BasicBlockProfiler::Data& s); 33 friend OStream& operator<<(OStream& os, const BasicBlockProfiler::Data& s);
34 34
35 explicit Data(size_t n_blocks); 35 explicit Data(size_t n_blocks);
36 ~Data(); 36 ~Data();
37 37
38 void ResetCounts(); 38 void ResetCounts();
39 39
40 const size_t n_blocks_; 40 const size_t n_blocks_;
41 std::vector<int> block_ids_; 41 std::vector<size_t> block_ids_;
42 std::vector<uint32_t> counts_; 42 std::vector<uint32_t> counts_;
43 std::string function_name_; 43 std::string function_name_;
44 std::string schedule_; 44 std::string schedule_;
45 std::string code_; 45 std::string code_;
46 DISALLOW_COPY_AND_ASSIGN(Data); 46 DISALLOW_COPY_AND_ASSIGN(Data);
47 }; 47 };
48 48
49 typedef std::list<Data*> DataList; 49 typedef std::list<Data*> DataList;
50 50
51 BasicBlockProfiler(); 51 BasicBlockProfiler();
(...skipping 12 matching lines...) Expand all
64 DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler); 64 DISALLOW_COPY_AND_ASSIGN(BasicBlockProfiler);
65 }; 65 };
66 66
67 OStream& operator<<(OStream& os, const BasicBlockProfiler& s); 67 OStream& operator<<(OStream& os, const BasicBlockProfiler& s);
68 OStream& operator<<(OStream& os, const BasicBlockProfiler::Data& s); 68 OStream& operator<<(OStream& os, const BasicBlockProfiler::Data& s);
69 69
70 } // namespace internal 70 } // namespace internal
71 } // namespace v8 71 } // namespace v8
72 72
73 #endif // V8_BASIC_BLOCK_PROFILER_H_ 73 #endif // V8_BASIC_BLOCK_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | src/basic-block-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698