33 const char*
const StatisticsExtension::kSource =
34 "native function getV8Statistics();";
63 Isolate* isolate = Isolate::Current();
67 if (args[0]->IsBoolean() && args[0]->ToBoolean()->Value()) {
75 #define ADD_COUNTER(name, caption) \
76 AddCounter(result, counters->name(), #name);
81 #define ADD_COUNTER(name) \
82 AddCounter(result, counters->count_of_##name(), "count_of_" #name); \
83 AddCounter(result, counters->size_of_##name(), "size_of_" #name);
87 #define ADD_COUNTER(name) \
88 AddCounter(result, counters->count_of_CODE_TYPE_##name(), \
89 "count_of_CODE_TYPE_" #name); \
90 AddCounter(result, counters->size_of_CODE_TYPE_##name(), \
91 "size_of_CODE_TYPE_" #name);
95 #define ADD_COUNTER(name) \
96 AddCounter(result, counters->count_of_FIXED_ARRAY_##name(), \
97 "count_of_FIXED_ARRAY_" #name); \
98 AddCounter(result, counters->size_of_FIXED_ARRAY_##name(), \
99 "size_of_FIXED_ARRAY_" #name);
105 "total_committed_bytes");
107 "new_space_live_bytes");
109 "new_space_available_bytes");
111 "new_space_commited_bytes");
113 "old_pointer_space_live_bytes");
115 "old_pointer_space_available_bytes");
117 "old_pointer_space_commited_bytes");
119 "old_data_space_live_bytes");
121 "old_data_space_available_bytes");
123 "old_data_space_commited_bytes");
125 "code_space_live_bytes");
127 "code_space_available_bytes");
129 "code_space_commited_bytes");
131 "cell_space_live_bytes");
133 "cell_space_available_bytes");
135 "cell_space_commited_bytes");
137 "lo_space_live_bytes");
139 "lo_space_available_bytes");
141 "lo_space_commited_bytes");
143 "amount_of_external_allocated_memory");
int * GetInternalPointer()
static Local< FunctionTemplate > New(InvocationCallback callback=0, Handle< Value > data=Handle< Value >(), Handle< Signature > signature=Handle< Signature >())
#define INSTANCE_TYPE_LIST(V)
void CollectAllGarbage(int flags, const char *gc_reason=NULL)
static V8EXPORT Local< String > New(const char *data, int length=-1)
#define ASSERT(condition)
#define STATS_COUNTER_LIST_2(SC)
intptr_t CommittedMemory()
intptr_t CommittedMemory()
static const int kNoGCFlags
MemoryAllocator * memory_allocator()
OldSpace * old_pointer_space()
LargeObjectSpace * lo_space()
#define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V)
#define CODE_KIND_LIST(V)
intptr_t CommittedMemory()
static v8::Handle< v8::Value > GetCounters(const v8::Arguments &args)
static V8EXPORT Local< Number > New(double value)
#define ADD_COUNTER(name, caption)
virtual v8::Handle< v8::FunctionTemplate > GetNativeFunction(v8::Handle< v8::String > name)
intptr_t amount_of_external_allocated_memory()
#define STATS_COUNTER_LIST_1(SC)
OldSpace * old_data_space()
static V8EXPORT Local< Object > New()