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 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_V8UTILS_H_ | 28 #ifndef V8_V8UTILS_H_ |
29 #define V8_V8UTILS_H_ | 29 #define V8_V8UTILS_H_ |
30 | 30 |
31 #include "utils.h" | 31 #include "utils.h" |
32 #include "platform.h" // For va_list on Solaris. | 32 #include "platform.h" // For va_list on Solaris. |
| 33 #include "msan.h" |
33 | 34 |
34 namespace v8 { | 35 namespace v8 { |
35 namespace internal { | 36 namespace internal { |
36 | 37 |
37 // ---------------------------------------------------------------------------- | 38 // ---------------------------------------------------------------------------- |
38 // I/O support. | 39 // I/O support. |
39 | 40 |
40 #if __GNUC__ >= 4 | 41 #if __GNUC__ >= 4 |
41 // On gcc we can ask the compiler to check the types of %d-style format | 42 // On gcc we can ask the compiler to check the types of %d-style format |
42 // specifiers and their associated arguments. TODO(erikcorry) fix this | 43 // specifiers and their associated arguments. TODO(erikcorry) fix this |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 #define STOS "stosq" | 264 #define STOS "stosq" |
264 #endif | 265 #endif |
265 #if defined(__native_client__) | 266 #if defined(__native_client__) |
266 // This STOS sequence does not validate for x86_64 Native Client. | 267 // This STOS sequence does not validate for x86_64 Native Client. |
267 // Here we #undef STOS to force use of the slower C version. | 268 // Here we #undef STOS to force use of the slower C version. |
268 // TODO(bradchen): Profile V8 and implement a faster REP STOS | 269 // TODO(bradchen): Profile V8 and implement a faster REP STOS |
269 // here if the profile indicates it matters. | 270 // here if the profile indicates it matters. |
270 #undef STOS | 271 #undef STOS |
271 #endif | 272 #endif |
272 | 273 |
| 274 #if defined(MEMORY_SANITIZER) |
| 275 // MemorySanitizer does not understand inline assembly. |
| 276 #undef STOS |
| 277 #endif |
| 278 |
273 #if defined(__GNUC__) && defined(STOS) | 279 #if defined(__GNUC__) && defined(STOS) |
274 asm volatile( | 280 asm volatile( |
275 "cld;" | 281 "cld;" |
276 "rep ; " STOS | 282 "rep ; " STOS |
277 : "+&c" (counter), "+&D" (dest) | 283 : "+&c" (counter), "+&D" (dest) |
278 : "a" (value) | 284 : "a" (value) |
279 : "memory", "cc"); | 285 : "memory", "cc"); |
280 #else | 286 #else |
281 for (int i = 0; i < counter; i++) { | 287 for (int i = 0; i < counter; i++) { |
282 dest[i] = value; | 288 dest[i] = value; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 495 |
490 // Add formatted contents like printf based on a va_list. | 496 // Add formatted contents like printf based on a va_list. |
491 void AddFormattedList(const char* format, va_list list); | 497 void AddFormattedList(const char* format, va_list list); |
492 private: | 498 private: |
493 DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); | 499 DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); |
494 }; | 500 }; |
495 | 501 |
496 } } // namespace v8::internal | 502 } } // namespace v8::internal |
497 | 503 |
498 #endif // V8_V8UTILS_H_ | 504 #endif // V8_V8UTILS_H_ |
OLD | NEW |