OLD | NEW |
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 | 166 |
167 void OS::Abort() { | 167 void OS::Abort() { |
168 // Redirect to std abort to signal abnormal program termination. | 168 // Redirect to std abort to signal abnormal program termination. |
169 abort(); | 169 abort(); |
170 } | 170 } |
171 | 171 |
172 | 172 |
173 void OS::DebugBreak() { | 173 void OS::DebugBreak() { |
| 174 // TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x, |
| 175 // which is the architecture of generated code). |
174 #if defined(__arm__) || defined(__thumb__) | 176 #if defined(__arm__) || defined(__thumb__) |
175 asm("bkpt 0"); | 177 asm("bkpt 0"); |
176 #else | 178 #else |
177 asm("int $3"); | 179 asm("int $3"); |
178 #endif | 180 #endif |
179 } | 181 } |
180 | 182 |
181 | 183 |
182 class PosixMemoryMappedFile : public OS::MemoryMappedFile { | 184 class PosixMemoryMappedFile : public OS::MemoryMappedFile { |
183 public: | 185 public: |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 if (signal != SIGPROF) return; | 593 if (signal != SIGPROF) return; |
592 if (active_sampler_ == NULL) return; | 594 if (active_sampler_ == NULL) return; |
593 | 595 |
594 TickSample sample; | 596 TickSample sample; |
595 | 597 |
596 // If profiling, we extract the current pc and sp. | 598 // If profiling, we extract the current pc and sp. |
597 if (active_sampler_->IsProfiling()) { | 599 if (active_sampler_->IsProfiling()) { |
598 // Extracting the sample from the context is extremely machine dependent. | 600 // Extracting the sample from the context is extremely machine dependent. |
599 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); | 601 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); |
600 mcontext_t& mcontext = ucontext->uc_mcontext; | 602 mcontext_t& mcontext = ucontext->uc_mcontext; |
601 #if defined (__arm__) || defined(__thumb__) | 603 #if defined(__arm__) || defined(__thumb__) |
602 sample.pc = mcontext.gregs[R15]; | 604 sample.pc = mcontext.gregs[R15]; |
603 sample.sp = mcontext.gregs[R13]; | 605 sample.sp = mcontext.gregs[R13]; |
604 sample.fp = mcontext.gregs[R11]; | 606 sample.fp = mcontext.gregs[R11]; |
605 #else | 607 #else |
606 sample.pc = mcontext.gregs[REG_EIP]; | 608 sample.pc = mcontext.gregs[REG_EIP]; |
607 sample.sp = mcontext.gregs[REG_ESP]; | 609 sample.sp = mcontext.gregs[REG_ESP]; |
608 sample.fp = mcontext.gregs[REG_EBP]; | 610 sample.fp = mcontext.gregs[REG_EBP]; |
609 #endif | 611 #endif |
610 } | 612 } |
611 | 613 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 } | 677 } |
676 | 678 |
677 // This sampler is no longer the active sampler. | 679 // This sampler is no longer the active sampler. |
678 active_sampler_ = NULL; | 680 active_sampler_ = NULL; |
679 active_ = false; | 681 active_ = false; |
680 } | 682 } |
681 | 683 |
682 #endif // ENABLE_LOGGING_AND_PROFILING | 684 #endif // ENABLE_LOGGING_AND_PROFILING |
683 | 685 |
684 } } // namespace v8::internal | 686 } } // namespace v8::internal |
OLD | NEW |