OLD | NEW |
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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return n; | 319 return n; |
320 } | 320 } |
321 } | 321 } |
322 | 322 |
323 | 323 |
324 #if V8_TARGET_ARCH_IA32 | 324 #if V8_TARGET_ARCH_IA32 |
325 static void MemMoveWrapper(void* dest, const void* src, size_t size) { | 325 static void MemMoveWrapper(void* dest, const void* src, size_t size) { |
326 memmove(dest, src, size); | 326 memmove(dest, src, size); |
327 } | 327 } |
328 | 328 |
| 329 |
329 // Initialize to library version so we can call this at any time during startup. | 330 // Initialize to library version so we can call this at any time during startup. |
330 static OS::MemMoveFunction memmove_function = &MemMoveWrapper; | 331 static OS::MemMoveFunction memmove_function = &MemMoveWrapper; |
331 | 332 |
332 // Defined in codegen-ia32.cc. | 333 // Defined in codegen-ia32.cc. |
333 OS::MemMoveFunction CreateMemMoveFunction(); | 334 OS::MemMoveFunction CreateMemMoveFunction(); |
334 | 335 |
335 // Copy memory area. No restrictions. | 336 // Copy memory area. No restrictions. |
336 void OS::MemMove(void* dest, const void* src, size_t size) { | 337 void OS::MemMove(void* dest, const void* src, size_t size) { |
337 if (size == 0) return; | 338 if (size == 0) return; |
338 // Note: here we rely on dependent reads being ordered. This is true | 339 // Note: here we rely on dependent reads being ordered. This is true |
(...skipping 12 matching lines...) Expand all Loading... |
351 } | 352 } |
352 #endif | 353 #endif |
353 init_fast_sin_function(); | 354 init_fast_sin_function(); |
354 init_fast_cos_function(); | 355 init_fast_cos_function(); |
355 init_fast_tan_function(); | 356 init_fast_tan_function(); |
356 init_fast_log_function(); | 357 init_fast_log_function(); |
357 // fast_exp is initialized lazily. | 358 // fast_exp is initialized lazily. |
358 init_fast_sqrt_function(); | 359 init_fast_sqrt_function(); |
359 } | 360 } |
360 | 361 |
| 362 |
361 // ---------------------------------------------------------------------------- | 363 // ---------------------------------------------------------------------------- |
362 // POSIX string support. | 364 // POSIX string support. |
363 // | 365 // |
364 | 366 |
365 char* OS::StrChr(char* str, int c) { | 367 char* OS::StrChr(char* str, int c) { |
366 return strchr(str, c); | 368 return strchr(str, c); |
367 } | 369 } |
368 | 370 |
369 | 371 |
370 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { | 372 void OS::StrNCpy(Vector<char> dest, const char* src, size_t n) { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 return ntohl(value); | 566 return ntohl(value); |
565 } | 567 } |
566 | 568 |
567 | 569 |
568 Socket* OS::CreateSocket() { | 570 Socket* OS::CreateSocket() { |
569 return new POSIXSocket(); | 571 return new POSIXSocket(); |
570 } | 572 } |
571 | 573 |
572 | 574 |
573 } } // namespace v8::internal | 575 } } // namespace v8::internal |
OLD | NEW |