| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_UTILS_H_ | 5 #ifndef V8_UTILS_H_ |
| 6 #define V8_UTILS_H_ | 6 #define V8_UTILS_H_ |
| 7 | 7 |
| 8 #include <limits.h> | 8 #include <limits.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 inline uint32_t ComputePointerHash(void* ptr) { | 359 inline uint32_t ComputePointerHash(void* ptr) { |
| 360 return ComputeIntegerHash( | 360 return ComputeIntegerHash( |
| 361 static_cast<uint32_t>(reinterpret_cast<intptr_t>(ptr)), | 361 static_cast<uint32_t>(reinterpret_cast<intptr_t>(ptr)), |
| 362 v8::internal::kZeroHashSeed); | 362 v8::internal::kZeroHashSeed); |
| 363 } | 363 } |
| 364 | 364 |
| 365 | 365 |
| 366 // ---------------------------------------------------------------------------- | 366 // ---------------------------------------------------------------------------- |
| 367 // Generated memcpy/memmove | 367 // Generated memcpy/memmove |
| 368 | 368 |
| 369 // Initializes the codegen support that depends on CPU features. This is | 369 // Initializes the codegen support that depends on CPU features. |
| 370 // called after CPU initialization. | 370 void init_memcopy_functions(Isolate* isolate); |
| 371 void init_memcopy_functions(); | |
| 372 | 371 |
| 373 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X87) | 372 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X87) |
| 374 // Limit below which the extra overhead of the MemCopy function is likely | 373 // Limit below which the extra overhead of the MemCopy function is likely |
| 375 // to outweigh the benefits of faster copying. | 374 // to outweigh the benefits of faster copying. |
| 376 const int kMinComplexMemCopy = 64; | 375 const int kMinComplexMemCopy = 64; |
| 377 | 376 |
| 378 // Copy memory area. No restrictions. | 377 // Copy memory area. No restrictions. |
| 379 void MemMove(void* dest, const void* src, size_t size); | 378 void MemMove(void* dest, const void* src, size_t size); |
| 380 typedef void (*MemMoveFunction)(void* dest, const void* src, size_t size); | 379 typedef void (*MemMoveFunction)(void* dest, const void* src, size_t size); |
| 381 | 380 |
| (...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 uint8_t* ptr = reinterpret_cast<uint8_t*>(p); | 1766 uint8_t* ptr = reinterpret_cast<uint8_t*>(p); |
| 1768 *ptr = c.b[0]; | 1767 *ptr = c.b[0]; |
| 1769 *(ptr + 1) = c.b[1]; | 1768 *(ptr + 1) = c.b[1]; |
| 1770 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 | 1769 #endif // V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 |
| 1771 } | 1770 } |
| 1772 | 1771 |
| 1773 } // namespace internal | 1772 } // namespace internal |
| 1774 } // namespace v8 | 1773 } // namespace v8 |
| 1775 | 1774 |
| 1776 #endif // V8_UTILS_H_ | 1775 #endif // V8_UTILS_H_ |
| OLD | NEW |