| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 class SharedFunctionInfoMoveEventRecord : public CodeEventRecord { | 100 class SharedFunctionInfoMoveEventRecord : public CodeEventRecord { |
| 101 public: | 101 public: |
| 102 Address from; | 102 Address from; |
| 103 Address to; | 103 Address to; |
| 104 | 104 |
| 105 INLINE(void UpdateCodeMap(CodeMap* code_map)); | 105 INLINE(void UpdateCodeMap(CodeMap* code_map)); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 | 108 |
| 109 class TickSampleEventRecord BASE_EMBEDDED { | 109 class TickSampleEventRecord { |
| 110 public: | 110 public: |
| 111 TickSampleEventRecord() | 111 // The parameterless constructor is used when we dequeue data from |
| 112 : filler(1) { | 112 // the ticks buffer. |
| 113 TickSampleEventRecord() { } |
| 114 explicit TickSampleEventRecord(unsigned order) |
| 115 : filler(1), |
| 116 order(order) { |
| 113 ASSERT(filler != SamplingCircularQueue::kClear); | 117 ASSERT(filler != SamplingCircularQueue::kClear); |
| 114 } | 118 } |
| 115 | 119 |
| 116 // The first machine word of a TickSampleEventRecord must not ever | 120 // The first machine word of a TickSampleEventRecord must not ever |
| 117 // become equal to SamplingCircularQueue::kClear. As both order and | 121 // become equal to SamplingCircularQueue::kClear. As both order and |
| 118 // TickSample's first field are not reliable in this sense (order | 122 // TickSample's first field are not reliable in this sense (order |
| 119 // can overflow, TickSample can have all fields reset), we are | 123 // can overflow, TickSample can have all fields reset), we are |
| 120 // forced to use an artificial filler field. | 124 // forced to use an artificial filler field. |
| 121 int filler; | 125 int filler; |
| 122 unsigned order; | 126 unsigned order; |
| 123 TickSample sample; | 127 TickSample sample; |
| 124 | 128 |
| 125 static TickSampleEventRecord* cast(void* value) { | 129 static TickSampleEventRecord* cast(void* value) { |
| 126 return reinterpret_cast<TickSampleEventRecord*>(value); | 130 return reinterpret_cast<TickSampleEventRecord*>(value); |
| 127 } | 131 } |
| 128 | |
| 129 INLINE(static TickSampleEventRecord* init(void* value)); | |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 | 134 |
| 133 // This class implements both the profile events processor thread and | 135 // This class implements both the profile events processor thread and |
| 134 // methods called by event producers: VM and stack sampler threads. | 136 // methods called by event producers: VM and stack sampler threads. |
| 135 class ProfilerEventsProcessor : public Thread { | 137 class ProfilerEventsProcessor : public Thread { |
| 136 public: | 138 public: |
| 137 ProfilerEventsProcessor(Isolate* isolate, | 139 explicit ProfilerEventsProcessor(ProfileGenerator* generator); |
| 138 ProfileGenerator* generator); | |
| 139 virtual ~ProfilerEventsProcessor() {} | 140 virtual ~ProfilerEventsProcessor() {} |
| 140 | 141 |
| 141 // Thread control. | 142 // Thread control. |
| 142 virtual void Run(); | 143 virtual void Run(); |
| 143 inline void Stop() { running_ = false; } | 144 inline void Stop() { running_ = false; } |
| 144 INLINE(bool running()) { return running_; } | 145 INLINE(bool running()) { return running_; } |
| 145 | 146 |
| 146 // Events adding methods. Called by VM threads. | 147 // Events adding methods. Called by VM threads. |
| 147 void CallbackCreateEvent(Logger::LogEventsAndTags tag, | 148 void CallbackCreateEvent(Logger::LogEventsAndTags tag, |
| 148 const char* prefix, String* name, | 149 const char* prefix, String* name, |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 #endif // ENABLE_LOGGING_AND_PROFILING | 294 #endif // ENABLE_LOGGING_AND_PROFILING |
| 294 | 295 |
| 295 private: | 296 private: |
| 296 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 297 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
| 297 }; | 298 }; |
| 298 | 299 |
| 299 } } // namespace v8::internal | 300 } } // namespace v8::internal |
| 300 | 301 |
| 301 | 302 |
| 302 #endif // V8_CPU_PROFILER_H_ | 303 #endif // V8_CPU_PROFILER_H_ |
| OLD | NEW |