5 #ifndef V8_STRING_STREAM_H_
6 #define V8_STRING_STREAM_H_
22 virtual char*
grow(
unsigned* bytes) = 0;
43 explicit FmtElm(
double value) : type_(DOUBLE) {
44 data_.u_double_ = value;
46 FmtElm(
const char* value) : type_(C_STR) {
47 data_.u_c_str_ = value;
50 data_.u_lc_str_ = &value;
56 data_.u_handle_ = value.location();
58 FmtElm(
void* value) : type_(POINTER) {
59 data_.u_pointer_ = value;
63 friend class StringStream;
78 class StringStream
FINAL {
81 allocator_(allocator),
82 capacity_(kInitialCapacity),
84 buffer_(allocator_->allocate(kInitialCapacity)) {
92 void Add(
const char* format);
94 void Add(
const char* format, FmtElm arg0);
95 void Add(
const char* format, FmtElm arg0, FmtElm arg1);
96 void Add(
const char* format, FmtElm arg0, FmtElm arg1, FmtElm arg2);
97 void Add(
const char* format,
102 void Add(
const char* format,
137 static bool IsMentionedObjectCacheClear(
Isolate* isolate);
140 static const int kInitialCapacity = 16;
150 bool full()
const {
return (capacity_ - length_) == 1; }
151 int space()
const {
return capacity_ - length_; }
Source to read snapshot and builtins files from.
void Add(const char *format, FmtElm arg0, FmtElm arg1, FmtElm arg2)
FmtElm(Handle< Object > value)
void PrintFixedArray(FixedArray *array, unsigned int limit)
const Vector< const uc16 > * u_lc_str_
void Add(Vector< const char > format)
void PrintByteArray(ByteArray *ba)
int length() const
The number of Latin-1 characters in the string.
void Add(Vector< const char > format, Vector< FmtElm > elms)
void Add(const char *format, FmtElm arg0, FmtElm arg1)
void PrintObject(Object *obj)
virtual char * allocate(unsigned bytes) OVERRIDE
static void ClearMentionedObjectCache(Isolate *isolate)
void Add(const char *format, FmtElm arg0)
void PrintName(Object *o)
void PrintPrototype(JSFunction *fun, Object *receiver)
void Add(const char *format)
StringAllocator * allocator_
FmtElm(const Vector< const uc16 > &value)
Handle< String > ToString(Isolate *isolate)
StringStream(StringAllocator *allocator)
virtual char * grow(unsigned *bytes) OVERRIDE
void Add(const char *format, FmtElm arg0, FmtElm arg1, FmtElm arg2, FmtElm arg3)
void PrintMentionedObjectCache(Isolate *isolate)
SmartArrayPointer< const char > ToCString() const
void PrintSecurityTokenIfChanged(Object *function)
void Log(Isolate *isolate)
FmtElm(const char *value)
DISALLOW_IMPLICIT_CONSTRUCTORS(StringStream)
bool Put(String *str, int start, int end)
void OutputToFile(FILE *out)
void PrintUsingMap(JSObject *js_object)
void PrintFunction(Object *function, Object *receiver, Code **code)
void Add(const char *format, FmtElm arg0, FmtElm arg1, FmtElm arg2, FmtElm arg3, FmtElm arg4)
virtual char * allocate(unsigned bytes)=0
virtual char * grow(unsigned *bytes)=0
virtual ~StringAllocator()
typedef HANDLE(__stdcall *DLL_FUNC_TYPE(CreateToolhelp32Snapshot))(DWORD dwFlags
void DeleteArray(T *array)
Debugger support for the V8 JavaScript engine.