| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // If the length is zero, the assignment fails. | 308 // If the length is zero, the assignment fails. |
| 309 if (str.length() > 0) | 309 if (str.length() > 0) |
| 310 str[str.length() - 1] = '\0'; | 310 str[str.length() - 1] = '\0'; |
| 311 return -1; | 311 return -1; |
| 312 } else { | 312 } else { |
| 313 return n; | 313 return n; |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 | 316 |
| 317 | 317 |
| 318 #if defined(V8_TARGET_ARCH_IA32) | 318 #if defined(V8_GENERATED_MEMCPY) |
| 319 static OS::MemCopyFunction memcopy_function = NULL; | 319 static OS::MemCopyFunction memcopy_function = NULL; |
| 320 // Defined in codegen-ia32.cc. | 320 // Defined in codegen-<arch>.cc. |
| 321 OS::MemCopyFunction CreateMemCopyFunction(); | 321 OS::MemCopyFunction CreateMemCopyFunction(); |
| 322 | 322 |
| 323 // Copy memory area to disjoint memory area. | 323 // Copy memory area to disjoint memory area. |
| 324 void OS::MemCopy(void* dest, const void* src, size_t size) { | 324 void OS::MemCopy(void* dest, const void* src, size_t size) { |
| 325 // Note: here we rely on dependent reads being ordered. This is true | 325 // Note: here we rely on dependent reads being ordered. This is true |
| 326 // on all architectures we currently support. | 326 // on all architectures we currently support. |
| 327 (*memcopy_function)(dest, src, size); | 327 (*memcopy_function)(dest, src, size); |
| 328 #ifdef DEBUG | 328 #ifdef DEBUG |
| 329 CHECK_EQ(0, memcmp(dest, src, size)); | 329 CHECK_EQ(0, memcmp(dest, src, size)); |
| 330 #endif | 330 #endif |
| 331 } | 331 } |
| 332 #endif // V8_TARGET_ARCH_IA32 | 332 #endif // V8_GENERATED_MEMCPY |
| 333 | 333 |
| 334 | 334 |
| 335 void POSIXPostSetUp() { | 335 void POSIXPostSetUp() { |
| 336 #if defined(V8_TARGET_ARCH_IA32) | 336 #if defined(V8_GENERATED_MEMCPY) |
| 337 memcopy_function = CreateMemCopyFunction(); | 337 memcopy_function = CreateMemCopyFunction(); |
| 338 #endif | 338 #endif |
| 339 init_fast_sin_function(); | 339 init_fast_sin_function(); |
| 340 init_fast_cos_function(); | 340 init_fast_cos_function(); |
| 341 init_fast_tan_function(); | 341 init_fast_tan_function(); |
| 342 init_fast_log_function(); | 342 init_fast_log_function(); |
| 343 // fast_exp is initialized lazily. | 343 // fast_exp is initialized lazily. |
| 344 init_fast_sqrt_function(); | 344 init_fast_sqrt_function(); |
| 345 } | 345 } |
| 346 | 346 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 return ntohl(value); | 550 return ntohl(value); |
| 551 } | 551 } |
| 552 | 552 |
| 553 | 553 |
| 554 Socket* OS::CreateSocket() { | 554 Socket* OS::CreateSocket() { |
| 555 return new POSIXSocket(); | 555 return new POSIXSocket(); |
| 556 } | 556 } |
| 557 | 557 |
| 558 | 558 |
| 559 } } // namespace v8::internal | 559 } } // namespace v8::internal |
| OLD | NEW |