Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: src/cpu-profiler.cc

Issue 7203005: Cleanup extra initialization of TickSample fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 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
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 events_buffer_.Enqueue(evt_rec); 179 events_buffer_.Enqueue(evt_rec);
180 } 180 }
181 181
182 182
183 void ProfilerEventsProcessor::AddCurrentStack() { 183 void ProfilerEventsProcessor::AddCurrentStack() {
184 TickSampleEventRecord record; 184 TickSampleEventRecord record;
185 TickSample* sample = &record.sample; 185 TickSample* sample = &record.sample;
186 Isolate* isolate = Isolate::Current(); 186 Isolate* isolate = Isolate::Current();
187 sample->state = isolate->current_vm_state(); 187 sample->state = isolate->current_vm_state();
188 sample->pc = reinterpret_cast<Address>(sample); // Not NULL. 188 sample->pc = reinterpret_cast<Address>(sample); // Not NULL.
189 sample->tos = NULL;
190 sample->has_external_callback = false;
191 sample->frames_count = 0;
192 for (StackTraceFrameIterator it(isolate); 189 for (StackTraceFrameIterator it(isolate);
193 !it.done() && sample->frames_count < TickSample::kMaxFramesCount; 190 !it.done() && sample->frames_count < TickSample::kMaxFramesCount;
194 it.Advance()) { 191 it.Advance()) {
195 sample->stack[sample->frames_count++] = it.frame()->pc(); 192 sample->stack[sample->frames_count++] = it.frame()->pc();
196 } 193 }
197 record.order = enqueue_order_; 194 record.order = enqueue_order_;
198 ticks_from_vm_buffer_.Enqueue(record); 195 ticks_from_vm_buffer_.Enqueue(record);
199 } 196 }
200 197
201 198
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 #ifdef ENABLE_LOGGING_AND_PROFILING 596 #ifdef ENABLE_LOGGING_AND_PROFILING
600 Isolate* isolate = Isolate::Current(); 597 Isolate* isolate = Isolate::Current();
601 if (isolate->cpu_profiler() != NULL) { 598 if (isolate->cpu_profiler() != NULL) {
602 delete isolate->cpu_profiler(); 599 delete isolate->cpu_profiler();
603 } 600 }
604 isolate->set_cpu_profiler(NULL); 601 isolate->set_cpu_profiler(NULL);
605 #endif 602 #endif
606 } 603 }
607 604
608 } } // namespace v8::internal 605 } } // namespace v8::internal
OLDNEW
« src/cpu-profiler.h ('K') | « src/cpu-profiler.h ('k') | src/cpu-profiler-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698