44 #if defined(__MACH__) && defined(__APPLE__)
45 #define PRINTF_CHECKING
46 #define FPRINTF_CHECKING
48 #define PRINTF_CHECKING __attribute__ ((format (printf, 1, 2)))
49 #define FPRINTF_CHECKING __attribute__ ((format (printf, 2, 3)))
52 #define PRINTF_CHECKING
53 #define FPRINTF_CHECKING
64 void Flush(FILE* out);
79 byte*
ReadBytes(
const char* filename,
int* size,
bool verbose =
true);
103 bool verbose =
true);
110 int WriteAsCFile(
const char* filename,
const char* varname,
111 const char* str,
int size,
bool verbose =
true);
116 template <
typename T>
126 template <
typename T>
134 static const int kBlockCopyLimit = 16;
136 if (num_words >= kBlockCopyLimit) {
139 int remaining = num_words;
143 }
while (remaining > 0);
148 template <
typename T,
typename U>
156 #if defined(V8_HOST_ARCH_IA32)
158 #elif defined(V8_HOST_ARCH_X64)
162 #if defined(__GNUC__) && defined(STOS)
166 :
"+&c" (counter),
"+&D" (dest)
170 for (
int i = 0; i < counter; i++) {
185 virtual const char*
data()
const {
return data_.
start(); }
197 Vector<const char>
ReadFile(
const char* filename,
199 bool verbose =
true);
200 Vector<const char>
ReadFile(FILE* file,
202 bool verbose =
true);
206 template <
typename source
char,
typename sink
char>
207 INLINE(
void CopyChars(sinkchar* dest,
const sourcechar* src,
int chars));
210 template <
typename source
char,
typename sink
char>
211 void CopyChars(sinkchar* dest,
const sourcechar* src,
int chars) {
212 sinkchar* limit = dest + chars;
213 #ifdef V8_HOST_CAN_READ_UNALIGNED
214 if (
sizeof(*dest) ==
sizeof(*src)) {
220 static const int kStepSize =
sizeof(uintptr_t) /
sizeof(*dest);
221 while (dest <= limit - kStepSize) {
222 *
reinterpret_cast<uintptr_t*
>(dest) =
223 *reinterpret_cast<const uintptr_t*>(src);
229 while (dest < limit) {
230 *dest++ =
static_cast<sinkchar
>(*src++);
242 bool remove_file_on_cleanup);
245 virtual const char*
data()
const {
return data_; }
246 virtual size_t length()
const {
return length_; }
256 void Init(
const char* filename);
263 bool remove_file_on_cleanup_;
282 #endif // V8_V8UTILS_H_
void PrintF(const char *format,...)
virtual size_t length() const
#define ASSERT(condition)
byte * ReadBytes(const char *filename, int *size, bool verbose)
char * ReadLine(const char *prompt)
static const int kMinComplexMemCopy
virtual const char * data() const
void CopyWords(T *dst, T *src, int num_words)
AsciiStringAdapter(Vector< const char > data)
STATIC_ASSERT((FixedDoubleArray::kHeaderSize &kDoubleAlignmentMask)==0)
virtual size_t length() const
static void MemCopy(void *dest, const void *src, size_t size)
Vector< const char > ReadFile(const char *filename, bool *exists, bool verbose)
void AddFormatted(const char *format,...)
StringBuilder(char *buffer, int size)
#define T(name, string, precedence)
bool EnsureIsAscii() const
void AddFormattedList(const char *format, va_list list)
int WriteChars(const char *filename, const char *str, int size, bool verbose)
INLINE(static HeapObject *EnsureDoubleAligned(Heap *heap, HeapObject *object, int size))
int WriteAsCFile(const char *filename, const char *varname, const char *str, int size, bool verbose=true)
int AppendChars(const char *filename, const char *str, int size, bool verbose)
void MemsetPointer(T **dest, U *value, int counter)
void PrintPID(const char *format,...)
virtual ~MemoryMappedExternalResource()
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
int WriteBytes(const char *filename, const byte *bytes, int size, bool verbose)
Vector< Handle< Object > > HandleVector(v8::internal::Handle< T > *elms, int length)
void CopyChars(sinkchar *dest, const sourcechar *src, int chars)
virtual const char * data() const
MemoryMappedExternalResource(const char *filename)