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
61 void Flush(FILE* out);
76 byte*
ReadBytes(
const char* filename,
int* size,
bool verbose =
true);
100 bool verbose =
true);
107 int WriteAsCFile(
const char* filename,
const char* varname,
108 const char* str,
int size,
bool verbose =
true);
113 template <
typename T>
123 template <
typename T>
131 static const int kBlockCopyLimit = 16;
133 if (num_words >= kBlockCopyLimit) {
136 int remaining = num_words;
140 }
while (remaining > 0);
145 template <
typename T,
typename U>
153 #if defined(V8_HOST_ARCH_IA32)
155 #elif defined(V8_HOST_ARCH_X64)
159 #if defined(__GNUC__) && defined(STOS)
163 :
"+&c" (counter),
"+&D" (dest)
167 for (
int i = 0; i < counter; i++) {
182 virtual const char*
data()
const {
return data_.
start(); }
194 Vector<const char>
ReadFile(
const char* filename,
196 bool verbose =
true);
197 Vector<const char>
ReadFile(FILE* file,
199 bool verbose =
true);
203 template <
typename source
char,
typename sink
char>
204 INLINE(
void CopyChars(sinkchar* dest,
const sourcechar* src,
int chars));
207 template <
typename source
char,
typename sink
char>
208 void CopyChars(sinkchar* dest,
const sourcechar* src,
int chars) {
209 sinkchar* limit = dest + chars;
210 #ifdef V8_HOST_CAN_READ_UNALIGNED
211 if (
sizeof(*dest) ==
sizeof(*src)) {
217 static const int kStepSize =
sizeof(uintptr_t) /
sizeof(*dest);
218 while (dest <= limit - kStepSize) {
219 *
reinterpret_cast<uintptr_t*
>(dest) =
220 *reinterpret_cast<const uintptr_t*>(src);
226 while (dest < limit) {
227 *dest++ =
static_cast<sinkchar
>(*src++);
239 bool remove_file_on_cleanup);
242 virtual const char*
data()
const {
return data_; }
243 virtual size_t length()
const {
return length_; }
253 void Init(
const char* filename);
260 bool remove_file_on_cleanup_;
279 #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)
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 trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt 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 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
virtual ~MemoryMappedExternalResource()
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)