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

Side by Side Diff: src/platform.h

Issue 12920009: Use generated Neon version of MemCopy() on ARM, if platform supports it. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 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 | Annotate | Revision Log
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 namespace internal { 106 namespace internal {
107 107
108 // Use AtomicWord for a machine-sized pointer. It is assumed that 108 // Use AtomicWord for a machine-sized pointer. It is assumed that
109 // reads and writes of naturally aligned values of this type are atomic. 109 // reads and writes of naturally aligned values of this type are atomic.
110 #if defined(__OpenBSD__) && defined(__i386__) 110 #if defined(__OpenBSD__) && defined(__i386__)
111 typedef Atomic32 AtomicWord; 111 typedef Atomic32 AtomicWord;
112 #else 112 #else
113 typedef intptr_t AtomicWord; 113 typedef intptr_t AtomicWord;
114 #endif 114 #endif
115 115
116 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_ARM)
117 #define V8_GENERATED_MEMCPY 1
118 #endif
119
116 class Semaphore; 120 class Semaphore;
117 class Mutex; 121 class Mutex;
118 122
119 double ceiling(double x); 123 double ceiling(double x);
120 double modulo(double x, double y); 124 double modulo(double x, double y);
121 125
122 // Custom implementation of math functions. 126 // Custom implementation of math functions.
123 double fast_sin(double input); 127 double fast_sin(double input);
124 double fast_cos(double input); 128 double fast_cos(double input);
125 double fast_tan(double input); 129 double fast_tan(double input);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 333
330 // Support runtime detection of FPU on MIPS CPUs. 334 // Support runtime detection of FPU on MIPS CPUs.
331 static bool MipsCpuHasFeature(CpuFeature feature); 335 static bool MipsCpuHasFeature(CpuFeature feature);
332 336
333 // Returns the activation frame alignment constraint or zero if 337 // Returns the activation frame alignment constraint or zero if
334 // the platform doesn't care. Guaranteed to be a power of two. 338 // the platform doesn't care. Guaranteed to be a power of two.
335 static int ActivationFrameAlignment(); 339 static int ActivationFrameAlignment();
336 340
337 static void ReleaseStore(volatile AtomicWord* ptr, AtomicWord value); 341 static void ReleaseStore(volatile AtomicWord* ptr, AtomicWord value);
338 342
339 #if defined(V8_TARGET_ARCH_IA32) 343 #if defined(V8_GENERATED_MEMCPY)
340 // Copy memory area to disjoint memory area. 344 // Copy memory area to disjoint memory area.
341 static void MemCopy(void* dest, const void* src, size_t size); 345 static void MemCopy(void* dest, const void* src, size_t size);
342 // Limit below which the extra overhead of the MemCopy function is likely 346 // Limit below which the extra overhead of the MemCopy function is likely
343 // to outweigh the benefits of faster copying. 347 // to outweigh the benefits of faster copying.
344 static const int kMinComplexMemCopy = 64; 348 static const int kMinComplexMemCopy = 64;
345 typedef void (*MemCopyFunction)(void* dest, const void* src, size_t size); 349 typedef void (*MemCopyFunction)(void* dest, const void* src, size_t size);
346 350
347 #else // V8_TARGET_ARCH_IA32 351 #else // V8_GENERATED_MEMCPY
348 static void MemCopy(void* dest, const void* src, size_t size) { 352 static void MemCopy(void* dest, const void* src, size_t size) {
349 memcpy(dest, src, size); 353 memcpy(dest, src, size);
350 } 354 }
351 static const int kMinComplexMemCopy = 16 * kPointerSize; 355 static const int kMinComplexMemCopy = 16 * kPointerSize;
352 #endif // V8_TARGET_ARCH_IA32 356 #endif // V8_GENERATED_MEMCPY
353 357
354 static int GetCurrentProcessId(); 358 static int GetCurrentProcessId();
355 359
356 private: 360 private:
357 static const int msPerSecond = 1000; 361 static const int msPerSecond = 1000;
358 362
359 DISALLOW_IMPLICIT_CONSTRUCTORS(OS); 363 DISALLOW_IMPLICIT_CONSTRUCTORS(OS);
360 }; 364 };
361 365
362 // Represents and controls an area of reserved memory. 366 // Represents and controls an area of reserved memory.
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 Atomic32 active_; 802 Atomic32 active_;
799 PlatformData* data_; // Platform specific data. 803 PlatformData* data_; // Platform specific data.
800 int samples_taken_; // Counts stack samples taken. 804 int samples_taken_; // Counts stack samples taken.
801 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 805 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
802 }; 806 };
803 807
804 808
805 } } // namespace v8::internal 809 } } // namespace v8::internal
806 810
807 #endif // V8_PLATFORM_H_ 811 #endif // V8_PLATFORM_H_
OLDNEW
« src/arm/codegen-arm.cc ('K') | « src/arm/codegen-arm.cc ('k') | src/platform-linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698