| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 rec->start = start; | 177 rec->start = start; |
| 178 rec->entry = generator_->NewCodeEntry(tag, prefix, name); | 178 rec->entry = generator_->NewCodeEntry(tag, prefix, name); |
| 179 rec->size = size; | 179 rec->size = size; |
| 180 events_buffer_.Enqueue(evt_rec); | 180 events_buffer_.Enqueue(evt_rec); |
| 181 } | 181 } |
| 182 | 182 |
| 183 | 183 |
| 184 void ProfilerEventsProcessor::AddCurrentStack() { | 184 void ProfilerEventsProcessor::AddCurrentStack() { |
| 185 TickSampleEventRecord record; | 185 TickSampleEventRecord record; |
| 186 TickSample* sample = &record.sample; | 186 TickSample* sample = &record.sample; |
| 187 sample->state = Isolate::Current()->current_vm_state(); | 187 Isolate* isolate = Isolate::Current(); |
| 188 sample->state = isolate->current_vm_state(); |
| 188 sample->pc = reinterpret_cast<Address>(sample); // Not NULL. | 189 sample->pc = reinterpret_cast<Address>(sample); // Not NULL. |
| 189 sample->tos = NULL; | 190 sample->tos = NULL; |
| 190 sample->has_external_callback = false; | 191 sample->has_external_callback = false; |
| 191 sample->frames_count = 0; | 192 sample->frames_count = 0; |
| 192 for (StackTraceFrameIterator it; | 193 for (StackTraceFrameIterator it(isolate); |
| 193 !it.done() && sample->frames_count < TickSample::kMaxFramesCount; | 194 !it.done() && sample->frames_count < TickSample::kMaxFramesCount; |
| 194 it.Advance()) { | 195 it.Advance()) { |
| 195 sample->stack[sample->frames_count++] = it.frame()->pc(); | 196 sample->stack[sample->frames_count++] = it.frame()->pc(); |
| 196 } | 197 } |
| 197 record.order = enqueue_order_; | 198 record.order = enqueue_order_; |
| 198 ticks_from_vm_buffer_.Enqueue(record); | 199 ticks_from_vm_buffer_.Enqueue(record); |
| 199 } | 200 } |
| 200 | 201 |
| 201 | 202 |
| 202 bool ProfilerEventsProcessor::ProcessCodeEvent(unsigned* dequeue_order) { | 203 bool ProfilerEventsProcessor::ProcessCodeEvent(unsigned* dequeue_order) { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 #ifdef ENABLE_LOGGING_AND_PROFILING | 597 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 597 Isolate* isolate = Isolate::Current(); | 598 Isolate* isolate = Isolate::Current(); |
| 598 if (isolate->cpu_profiler() != NULL) { | 599 if (isolate->cpu_profiler() != NULL) { |
| 599 delete isolate->cpu_profiler(); | 600 delete isolate->cpu_profiler(); |
| 600 } | 601 } |
| 601 isolate->set_cpu_profiler(NULL); | 602 isolate->set_cpu_profiler(NULL); |
| 602 #endif | 603 #endif |
| 603 } | 604 } |
| 604 | 605 |
| 605 } } // namespace v8::internal | 606 } } // namespace v8::internal |
| OLD | NEW |