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

Side by Side Diff: src/sampler.cc

Issue 16858013: Notify CPU profiler when calling native getters (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
« no previous file with comments | « src/mips/stub-cache-mips.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 OS::Sleep(interval_); 489 OS::Sleep(interval_);
490 } 490 }
491 } 491 }
492 492
493 private: 493 private:
494 #if defined(USE_SIGNALS) 494 #if defined(USE_SIGNALS)
495 495
496 void SampleContext(Sampler* sampler) { 496 void SampleContext(Sampler* sampler) {
497 if (!SignalHandler::Installed()) return; 497 if (!SignalHandler::Installed()) return;
498 pthread_t tid = sampler->platform_data()->vm_tid(); 498 pthread_t tid = sampler->platform_data()->vm_tid();
499 int result = pthread_kill(tid, SIGPROF); 499 pthread_kill(tid, SIGPROF);
500 USE(result);
501 ASSERT(result == 0);
502 } 500 }
503 501
504 #elif defined(__MACH__) 502 #elif defined(__MACH__)
505 503
506 void SampleContext(Sampler* sampler) { 504 void SampleContext(Sampler* sampler) {
507 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread(); 505 thread_act_t profiled_thread = sampler->platform_data()->profiled_thread();
508 Isolate* isolate = sampler->isolate(); 506 Isolate* isolate = sampler->isolate();
509 507
510 SampleHelper helper; 508 SampleHelper helper;
511 TickSample* sample = helper.Init(sampler, isolate); 509 TickSample* sample = helper.Init(sampler, isolate);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 SamplerThread::RemoveActiveSampler(this); 683 SamplerThread::RemoveActiveSampler(this);
686 SetActive(false); 684 SetActive(false);
687 } 685 }
688 686
689 void Sampler::SampleStack(TickSample* sample) { 687 void Sampler::SampleStack(TickSample* sample) {
690 sample->Trace(isolate_); 688 sample->Trace(isolate_);
691 if (++samples_taken_ < 0) samples_taken_ = 0; 689 if (++samples_taken_ < 0) samples_taken_ = 0;
692 } 690 }
693 691
694 } } // namespace v8::internal 692 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/stub-cache-mips.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698