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

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

Issue 543161: Added support for MIPS in architecture independent files.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 return false; 144 return false;
145 } 145 }
146 #endif // def __arm__ 146 #endif // def __arm__
147 147
148 148
149 int OS::ActivationFrameAlignment() { 149 int OS::ActivationFrameAlignment() {
150 #ifdef V8_TARGET_ARCH_ARM 150 #ifdef V8_TARGET_ARCH_ARM
151 // On EABI ARM targets this is required for fp correctness in the 151 // On EABI ARM targets this is required for fp correctness in the
152 // runtime system. 152 // runtime system.
153 return 8; 153 return 8;
154 #else 154 #elif V8_TARGET_ARCH_MIPS
155 return 8;
156 #endif
155 // With gcc 4.4 the tree vectorization optimiser can generate code 157 // With gcc 4.4 the tree vectorization optimiser can generate code
156 // that requires 16 byte alignment such as movdqa on x86. 158 // that requires 16 byte alignment such as movdqa on x86.
157 return 16; 159 return 16;
158 #endif
159 } 160 }
160 161
161 162
162 const char* OS::LocalTimezone(double time) { 163 const char* OS::LocalTimezone(double time) {
163 if (isnan(time)) return ""; 164 if (isnan(time)) return "";
164 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); 165 time_t tv = static_cast<time_t>(floor(time/msPerSecond));
165 struct tm* t = localtime(&tv); 166 struct tm* t = localtime(&tv);
166 if (NULL == t) return ""; 167 if (NULL == t) return "";
167 return t->tm_zone; 168 return t->tm_zone;
168 } 169 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 // Redirect to std abort to signal abnormal program termination. 256 // Redirect to std abort to signal abnormal program termination.
256 abort(); 257 abort();
257 } 258 }
258 259
259 260
260 void OS::DebugBreak() { 261 void OS::DebugBreak() {
261 // TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x, 262 // TODO(lrn): Introduce processor define for runtime system (!= V8_ARCH_x,
262 // which is the architecture of generated code). 263 // which is the architecture of generated code).
263 #if defined(__arm__) || defined(__thumb__) 264 #if defined(__arm__) || defined(__thumb__)
264 asm("bkpt 0"); 265 asm("bkpt 0");
266 #elif defined(__mips__)
267 asm("break");
265 #else 268 #else
266 asm("int $3"); 269 asm("int $3");
267 #endif 270 #endif
268 } 271 }
269 272
270 273
271 class PosixMemoryMappedFile : public OS::MemoryMappedFile { 274 class PosixMemoryMappedFile : public OS::MemoryMappedFile {
272 public: 275 public:
273 PosixMemoryMappedFile(FILE* file, void* memory, int size) 276 PosixMemoryMappedFile(FILE* file, void* memory, int size)
274 : file_(file), memory_(memory), size_(size) { } 277 : file_(file), memory_(memory), size_(size) { }
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 // we check Top's data. Having that ThreadManager::RestoreThread first 707 // we check Top's data. Having that ThreadManager::RestoreThread first
705 // restores ThreadLocalTop from TLS, and only then erases the TLS value, 708 // restores ThreadLocalTop from TLS, and only then erases the TLS value,
706 // reading Top::thread_id() should not be affected by races. 709 // reading Top::thread_id() should not be affected by races.
707 if (ThreadManager::HasId() && !ThreadManager::IsArchived() && 710 if (ThreadManager::HasId() && !ThreadManager::IsArchived() &&
708 ThreadManager::CurrentId() == Top::thread_id()) { 711 ThreadManager::CurrentId() == Top::thread_id()) {
709 return true; 712 return true;
710 } 713 }
711 return false; 714 return false;
712 } 715 }
713 716
714
715 static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) { 717 static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
718 #ifndef V8_HOST_ARCH_MIPS
716 USE(info); 719 USE(info);
717 if (signal != SIGPROF) return; 720 if (signal != SIGPROF) return;
718 if (active_sampler_ == NULL) return; 721 if (active_sampler_ == NULL) return;
719 722
720 TickSample sample; 723 TickSample sample;
721 724
722 // If profiling, we extract the current pc and sp. 725 // If profiling, we extract the current pc and sp.
723 if (active_sampler_->IsProfiling()) { 726 if (active_sampler_->IsProfiling()) {
724 // Extracting the sample from the context is extremely machine dependent. 727 // Extracting the sample from the context is extremely machine dependent.
725 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); 728 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
(...skipping 10 matching lines...) Expand all
736 // An undefined macro evaluates to 0, so this applies to Android's Bionic also. 739 // An undefined macro evaluates to 0, so this applies to Android's Bionic also.
737 #if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3)) 740 #if (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
738 sample.pc = reinterpret_cast<Address>(mcontext.gregs[R15]); 741 sample.pc = reinterpret_cast<Address>(mcontext.gregs[R15]);
739 sample.sp = reinterpret_cast<Address>(mcontext.gregs[R13]); 742 sample.sp = reinterpret_cast<Address>(mcontext.gregs[R13]);
740 sample.fp = reinterpret_cast<Address>(mcontext.gregs[R11]); 743 sample.fp = reinterpret_cast<Address>(mcontext.gregs[R11]);
741 #else 744 #else
742 sample.pc = reinterpret_cast<Address>(mcontext.arm_pc); 745 sample.pc = reinterpret_cast<Address>(mcontext.arm_pc);
743 sample.sp = reinterpret_cast<Address>(mcontext.arm_sp); 746 sample.sp = reinterpret_cast<Address>(mcontext.arm_sp);
744 sample.fp = reinterpret_cast<Address>(mcontext.arm_fp); 747 sample.fp = reinterpret_cast<Address>(mcontext.arm_fp);
745 #endif 748 #endif
749 #elif V8_HOST_ARCH_MIPS
750 // Implement this on MIPS.
751 UNIMPLEMENTED();
746 #endif 752 #endif
747 if (IsVmThread()) 753 if (IsVmThread())
748 active_sampler_->SampleStack(&sample); 754 active_sampler_->SampleStack(&sample);
749 } 755 }
750 756
751 // We always sample the VM state. 757 // We always sample the VM state.
752 sample.state = Logger::state(); 758 sample.state = Logger::state();
753 759
754 active_sampler_->Tick(&sample); 760 active_sampler_->Tick(&sample);
761 #endif
755 } 762 }
756 763
757 764
758 class Sampler::PlatformData : public Malloced { 765 class Sampler::PlatformData : public Malloced {
759 public: 766 public:
760 PlatformData() { 767 PlatformData() {
761 signal_handler_installed_ = false; 768 signal_handler_installed_ = false;
762 } 769 }
763 770
764 bool signal_handler_installed_; 771 bool signal_handler_installed_;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 824
818 // This sampler is no longer the active sampler. 825 // This sampler is no longer the active sampler.
819 active_sampler_ = NULL; 826 active_sampler_ = NULL;
820 active_ = false; 827 active_ = false;
821 } 828 }
822 829
823 830
824 #endif // ENABLE_LOGGING_AND_PROFILING 831 #endif // ENABLE_LOGGING_AND_PROFILING
825 832
826 } } // namespace v8::internal 833 } } // namespace v8::internal
OLDNEW
« src/mips/macro-assembler-mips.h ('K') | « src/objects.h ('k') | src/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698