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

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

Issue 12475016: Maintain API compatibility with older versions of V8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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/log.cc ('k') | src/platform-freebsd.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 } 680 }
681 681
682 void SampleContext(Sampler* sampler) { 682 void SampleContext(Sampler* sampler) {
683 HANDLE profiled_thread = sampler->platform_data()->profiled_thread(); 683 HANDLE profiled_thread = sampler->platform_data()->profiled_thread();
684 if (profiled_thread == NULL) return; 684 if (profiled_thread == NULL) return;
685 685
686 // Context used for sampling the register state of the profiled thread. 686 // Context used for sampling the register state of the profiled thread.
687 CONTEXT context; 687 CONTEXT context;
688 memset(&context, 0, sizeof(context)); 688 memset(&context, 0, sizeof(context));
689 689
690 Isolate* isolate = sampler->isolate();
691 TickSample sample_obj; 690 TickSample sample_obj;
692 TickSample* sample = isolate->cpu_profiler()->TickSampleEvent(); 691 TickSample* sample = CpuProfiler::TickSampleEvent(sampler->isolate());
693 if (sample == NULL) sample = &sample_obj; 692 if (sample == NULL) sample = &sample_obj;
694 693
695 static const DWORD kSuspendFailed = static_cast<DWORD>(-1); 694 static const DWORD kSuspendFailed = static_cast<DWORD>(-1);
696 if (SuspendThread(profiled_thread) == kSuspendFailed) return; 695 if (SuspendThread(profiled_thread) == kSuspendFailed) return;
697 sample->state = isolate->current_vm_state(); 696 sample->state = sampler->isolate()->current_vm_state();
698 697
699 context.ContextFlags = CONTEXT_FULL; 698 context.ContextFlags = CONTEXT_FULL;
700 if (GetThreadContext(profiled_thread, &context) != 0) { 699 if (GetThreadContext(profiled_thread, &context) != 0) {
701 #if V8_HOST_ARCH_X64 700 #if V8_HOST_ARCH_X64
702 sample->pc = reinterpret_cast<Address>(context.Rip); 701 sample->pc = reinterpret_cast<Address>(context.Rip);
703 sample->sp = reinterpret_cast<Address>(context.Rsp); 702 sample->sp = reinterpret_cast<Address>(context.Rsp);
704 sample->fp = reinterpret_cast<Address>(context.Rbp); 703 sample->fp = reinterpret_cast<Address>(context.Rbp);
705 #else 704 #else
706 sample->pc = reinterpret_cast<Address>(context.Eip); 705 sample->pc = reinterpret_cast<Address>(context.Eip);
707 sample->sp = reinterpret_cast<Address>(context.Esp); 706 sample->sp = reinterpret_cast<Address>(context.Esp);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 770
772 771
773 void Sampler::Stop() { 772 void Sampler::Stop() {
774 ASSERT(IsActive()); 773 ASSERT(IsActive());
775 SamplerThread::RemoveActiveSampler(this); 774 SamplerThread::RemoveActiveSampler(this);
776 SetActive(false); 775 SetActive(false);
777 } 776 }
778 777
779 778
780 } } // namespace v8::internal 779 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.cc ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698