| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 178   T* a = NULL; | 178   T* a = NULL; | 
| 179   U* b = NULL; | 179   U* b = NULL; | 
| 180   a = b;  // Fake assignment to check assignability. | 180   a = b;  // Fake assignment to check assignability. | 
| 181   USE(a); | 181   USE(a); | 
| 182 #endif  // DEBUG | 182 #endif  // DEBUG | 
| 183 #if defined(V8_HOST_ARCH_IA32) | 183 #if defined(V8_HOST_ARCH_IA32) | 
| 184 #define STOS "stosl" | 184 #define STOS "stosl" | 
| 185 #elif defined(V8_HOST_ARCH_X64) | 185 #elif defined(V8_HOST_ARCH_X64) | 
| 186 #define STOS "stosq" | 186 #define STOS "stosq" | 
| 187 #endif | 187 #endif | 
|  | 188 #if defined(__native_client__) | 
|  | 189   // This STOS sequence does not validate for x86_64 Native Client. | 
|  | 190   // Here we #undef STOS to force use of the slower C version. | 
|  | 191   // TODO(bradchen): Profile V8 and implement a faster REP STOS | 
|  | 192   // here if the profile indicates it matters. | 
|  | 193 #undef STOS | 
|  | 194 #endif | 
| 188 | 195 | 
| 189 #if defined(__GNUC__) && defined(STOS) | 196 #if defined(__GNUC__) && defined(STOS) | 
| 190   asm volatile( | 197   asm volatile( | 
| 191       "cld;" | 198       "cld;" | 
| 192       "rep ; " STOS | 199       "rep ; " STOS | 
| 193       : "+&c" (counter), "+&D" (dest) | 200       : "+&c" (counter), "+&D" (dest) | 
| 194       : "a" (value) | 201       : "a" (value) | 
| 195       : "memory", "cc"); | 202       : "memory", "cc"); | 
| 196 #else | 203 #else | 
| 197   for (int i = 0; i < counter; i++) { | 204   for (int i = 0; i < counter; i++) { | 
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 301 | 308 | 
| 302   // Add formatted contents like printf based on a va_list. | 309   // Add formatted contents like printf based on a va_list. | 
| 303   void AddFormattedList(const char* format, va_list list); | 310   void AddFormattedList(const char* format, va_list list); | 
| 304  private: | 311  private: | 
| 305   DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); | 312   DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); | 
| 306 }; | 313 }; | 
| 307 | 314 | 
| 308 } }  // namespace v8::internal | 315 } }  // namespace v8::internal | 
| 309 | 316 | 
| 310 #endif  // V8_V8UTILS_H_ | 317 #endif  // V8_V8UTILS_H_ | 
| OLD | NEW | 
|---|