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

Side by Side Diff: src/platform-macos.cc

Issue 1519027: Make VM state tracking to be independent of logging and profiling. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-openbsd.cc » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 TickSample* sample = CpuProfiler::TickSampleEvent(); 550 TickSample* sample = CpuProfiler::TickSampleEvent();
551 if (sample == NULL) continue; 551 if (sample == NULL) continue;
552 sample->pc = NULL; // Impossible value if sampling succeeds. 552 sample->pc = NULL; // Impossible value if sampling succeeds.
553 sample->frames_count = 0; 553 sample->frames_count = 0;
554 #else 554 #else
555 TickSample sample_obj; 555 TickSample sample_obj;
556 TickSample* sample = &sample_obj; 556 TickSample* sample = &sample_obj;
557 #endif // ENABLE_CPP_PROFILES_PROCESSOR 557 #endif // ENABLE_CPP_PROFILES_PROCESSOR
558 558
559 // We always sample the VM state. 559 // We always sample the VM state.
560 sample->state = Logger::state(); 560 sample->state = VMState::current_state();
561 // If profiling, we record the pc and sp of the profiled thread. 561 // If profiling, we record the pc and sp of the profiled thread.
562 if (sampler_->IsProfiling() 562 if (sampler_->IsProfiling()
563 && KERN_SUCCESS == thread_suspend(profiled_thread_)) { 563 && KERN_SUCCESS == thread_suspend(profiled_thread_)) {
564 #if V8_HOST_ARCH_X64 564 #if V8_HOST_ARCH_X64
565 thread_state_flavor_t flavor = x86_THREAD_STATE64; 565 thread_state_flavor_t flavor = x86_THREAD_STATE64;
566 x86_thread_state64_t state; 566 x86_thread_state64_t state;
567 mach_msg_type_number_t count = x86_THREAD_STATE64_COUNT; 567 mach_msg_type_number_t count = x86_THREAD_STATE64_COUNT;
568 #if __DARWIN_UNIX03 568 #if __DARWIN_UNIX03
569 #define REGISTER_FIELD(name) __r ## name 569 #define REGISTER_FIELD(name) __r ## name
570 #else 570 #else
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 659
660 // Deallocate Mach port for thread. 660 // Deallocate Mach port for thread.
661 if (IsProfiling()) { 661 if (IsProfiling()) {
662 mach_port_deallocate(data_->task_self_, data_->profiled_thread_); 662 mach_port_deallocate(data_->task_self_, data_->profiled_thread_);
663 } 663 }
664 } 664 }
665 665
666 #endif // ENABLE_LOGGING_AND_PROFILING 666 #endif // ENABLE_LOGGING_AND_PROFILING
667 667
668 } } // namespace v8::internal 668 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-linux.cc ('k') | src/platform-openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698