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/cpu-profiler.cc

Issue 6794019: Simplify isolates access during stack iteration (WAS: Move SafeStackFrameIterator::active_count_...) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A couple more changes Created 9 years, 8 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 | « src/compiler.cc ('k') | src/debug.h » ('j') | src/frames.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/debug.h » ('j') | src/frames.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698