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

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

Issue 109025: Have the profiler load the correct registers on x64. (Closed)
Patch Set: Created 11 years, 7 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 | « no previous file | no next file » | 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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 if (signal != SIGPROF) return; 593 if (signal != SIGPROF) return;
594 if (active_sampler_ == NULL) return; 594 if (active_sampler_ == NULL) return;
595 595
596 TickSample sample; 596 TickSample sample;
597 597
598 // If profiling, we extract the current pc and sp. 598 // If profiling, we extract the current pc and sp.
599 if (active_sampler_->IsProfiling()) { 599 if (active_sampler_->IsProfiling()) {
600 // Extracting the sample from the context is extremely machine dependent. 600 // Extracting the sample from the context is extremely machine dependent.
601 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); 601 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
602 mcontext_t& mcontext = ucontext->uc_mcontext; 602 mcontext_t& mcontext = ucontext->uc_mcontext;
603 #if defined(__arm__) || defined(__thumb__) 603 #if V8_HOST_ARCH_X86
604 sample.pc = mcontext.gregs[REG_EIP];
605 sample.sp = mcontext.gregs[REG_ESP];
606 sample.fp = mcontext.gregs[REG_EBP];
607 #elif V8_HOST_ARCH_X64
608 sample.pc = mcontext.gregs[REG_RIP];
Lasse Reichstein 2009/05/06 11:05:27 Does the assignment compile, and throw away the up
Dean McNamee 2009/05/06 11:07:15 It does compile, but I'll just do UNIMPLEMENTED :\
609 sample.sp = mcontext.gregs[REG_RSP];
610 sample.fp = mcontext.gregs[REG_RBP];
611 #elif V8_HOST_ARCH_ARM
604 sample.pc = mcontext.gregs[R15]; 612 sample.pc = mcontext.gregs[R15];
605 sample.sp = mcontext.gregs[R13]; 613 sample.sp = mcontext.gregs[R13];
606 sample.fp = mcontext.gregs[R11]; 614 sample.fp = mcontext.gregs[R11];
607 #else
608 sample.pc = mcontext.gregs[REG_EIP];
609 sample.sp = mcontext.gregs[REG_ESP];
610 sample.fp = mcontext.gregs[REG_EBP];
611 #endif 615 #endif
612 } 616 }
613 617
614 // We always sample the VM state. 618 // We always sample the VM state.
615 sample.state = Logger::state(); 619 sample.state = Logger::state();
616 620
617 active_sampler_->Tick(&sample); 621 active_sampler_->Tick(&sample);
618 } 622 }
619 623
620 624
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 } 681 }
678 682
679 // This sampler is no longer the active sampler. 683 // This sampler is no longer the active sampler.
680 active_sampler_ = NULL; 684 active_sampler_ = NULL;
681 active_ = false; 685 active_ = false;
682 } 686 }
683 687
684 #endif // ENABLE_LOGGING_AND_PROFILING 688 #endif // ENABLE_LOGGING_AND_PROFILING
685 689
686 } } // namespace v8::internal 690 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698