| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 for (StackTraceFrameIterator it(isolate); | 184 for (StackTraceFrameIterator it(isolate); |
| 185 !it.done() && sample->frames_count < TickSample::kMaxFramesCount; | 185 !it.done() && sample->frames_count < TickSample::kMaxFramesCount; |
| 186 it.Advance()) { | 186 it.Advance()) { |
| 187 sample->stack[sample->frames_count++] = it.frame()->pc(); | 187 sample->stack[sample->frames_count++] = it.frame()->pc(); |
| 188 } | 188 } |
| 189 ticks_from_vm_buffer_.Enqueue(record); | 189 ticks_from_vm_buffer_.Enqueue(record); |
| 190 } | 190 } |
| 191 | 191 |
| 192 | 192 |
| 193 bool ProfilerEventsProcessor::ProcessCodeEvent(unsigned* dequeue_order) { | 193 bool ProfilerEventsProcessor::ProcessCodeEvent(unsigned* dequeue_order) { |
| 194 if (!events_buffer_.IsEmpty()) { | 194 CodeEventsContainer record; |
| 195 CodeEventsContainer record; | 195 if (events_buffer_.Dequeue(&record)) { |
| 196 events_buffer_.Dequeue(&record); | |
| 197 switch (record.generic.type) { | 196 switch (record.generic.type) { |
| 198 #define PROFILER_TYPE_CASE(type, clss) \ | 197 #define PROFILER_TYPE_CASE(type, clss) \ |
| 199 case CodeEventRecord::type: \ | 198 case CodeEventRecord::type: \ |
| 200 record.clss##_.UpdateCodeMap(generator_->code_map()); \ | 199 record.clss##_.UpdateCodeMap(generator_->code_map()); \ |
| 201 break; | 200 break; |
| 202 | 201 |
| 203 CODE_EVENTS_TYPE_LIST(PROFILER_TYPE_CASE) | 202 CODE_EVENTS_TYPE_LIST(PROFILER_TYPE_CASE) |
| 204 | 203 |
| 205 #undef PROFILER_TYPE_CASE | 204 #undef PROFILER_TYPE_CASE |
| 206 default: return true; // Skip record. | 205 default: return true; // Skip record. |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 processor_->Join(); | 519 processor_->Join(); |
| 521 delete processor_; | 520 delete processor_; |
| 522 delete generator_; | 521 delete generator_; |
| 523 processor_ = NULL; | 522 processor_ = NULL; |
| 524 generator_ = NULL; | 523 generator_ = NULL; |
| 525 logger->logging_nesting_ = saved_logging_nesting_; | 524 logger->logging_nesting_ = saved_logging_nesting_; |
| 526 } | 525 } |
| 527 | 526 |
| 528 | 527 |
| 529 } } // namespace v8::internal | 528 } } // namespace v8::internal |
| OLD | NEW |