| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 INLINE(void UpdateCodeMap(CodeMap* code_map)); | 104 INLINE(void UpdateCodeMap(CodeMap* code_map)); |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 | 107 |
| 108 class TickSampleEventRecord { | 108 class TickSampleEventRecord { |
| 109 public: | 109 public: |
| 110 // The parameterless constructor is used when we dequeue data from | 110 // The parameterless constructor is used when we dequeue data from |
| 111 // the ticks buffer. | 111 // the ticks buffer. |
| 112 TickSampleEventRecord() { } | 112 TickSampleEventRecord() { } |
| 113 explicit TickSampleEventRecord(unsigned order) | 113 explicit TickSampleEventRecord(unsigned order) : order(order) { } |
| 114 : filler(1), | |
| 115 order(order) { | |
| 116 ASSERT(filler != SamplingCircularQueue::kClear); | |
| 117 } | |
| 118 | 114 |
| 119 // The first machine word of a TickSampleEventRecord must not ever | |
| 120 // become equal to SamplingCircularQueue::kClear. As both order and | |
| 121 // TickSample's first field are not reliable in this sense (order | |
| 122 // can overflow, TickSample can have all fields reset), we are | |
| 123 // forced to use an artificial filler field. | |
| 124 int filler; | |
| 125 unsigned order; | 115 unsigned order; |
| 126 TickSample sample; | 116 TickSample sample; |
| 127 | 117 |
| 128 static TickSampleEventRecord* cast(void* value) { | 118 static TickSampleEventRecord* cast(void* value) { |
| 129 return reinterpret_cast<TickSampleEventRecord*>(value); | 119 return reinterpret_cast<TickSampleEventRecord*>(value); |
| 130 } | 120 } |
| 131 }; | 121 }; |
| 132 | 122 |
| 133 | 123 |
| 134 class CodeEventsContainer { | 124 class CodeEventsContainer { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 bool is_profiling_; | 259 bool is_profiling_; |
| 270 | 260 |
| 271 private: | 261 private: |
| 272 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 262 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
| 273 }; | 263 }; |
| 274 | 264 |
| 275 } } // namespace v8::internal | 265 } } // namespace v8::internal |
| 276 | 266 |
| 277 | 267 |
| 278 #endif // V8_CPU_PROFILER_H_ | 268 #endif // V8_CPU_PROFILER_H_ |
| OLD | NEW |