37 #include "../include/v8-profiler.h"
54 CpuProfilesCollection profiles(isolate->
heap());
55 ProfileGenerator generator(&profiles);
56 SmartPointer<ProfilerEventsProcessor> processor(
new ProfilerEventsProcessor(
57 &generator,
NULL, TimeDelta::FromMicroseconds(100)));
59 processor->StopSynchronously();
63 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc,
72 sample->
stack[0] = frame2;
76 sample->
stack[1] = frame3;
79 proc->FinishTickSample();
87 : old_flag_prof_browser_mode_(i::FLAG_prof_browser_mode) {
88 i::FLAG_prof_browser_mode =
false;
92 i::FLAG_prof_browser_mode = old_flag_prof_browser_mode_;
96 bool old_flag_prof_browser_mode_;
103 static int counter = 0;
108 const char* name_start = name.
start();
112 "for (var i = 0; i < %d; ++i) counter += i;\n"
113 "return '%s_' + counter;\n"
115 "%s();\n", name_start, counter, name_start, name_start);
116 CompileRun(script.
start());
119 (*env)->Global()->Get(v8_str(name_start))));
129 TestSetup test_setup;
141 CpuProfilesCollection* profiles =
new CpuProfilesCollection(isolate->
heap());
142 profiles->StartProfiling(
"",
false);
143 ProfileGenerator generator(profiles);
144 SmartPointer<ProfilerEventsProcessor> processor(
new ProfilerEventsProcessor(
145 &generator,
NULL, TimeDelta::FromMicroseconds(100)));
147 CpuProfiler
profiler(isolate, profiles, &generator, processor.get());
150 const char* aaa_str =
"aaa";
153 profiler.CodeCreateEvent(i::Logger::FUNCTION_TAG, aaa_code, *aaa_name);
154 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, comment_code,
"comment");
155 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args5_code, 5);
156 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, comment2_code,
"comment2");
158 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args3_code, 3);
159 profiler.CodeCreateEvent(i::Logger::STUB_TAG, args4_code, 4);
162 EnqueueTickSampleEvent(processor.get(), aaa_code->
address());
164 processor->StopSynchronously();
167 CodeEntry* aaa = generator.code_map()->FindEntry(aaa_code->
address());
171 CodeEntry* comment = generator.code_map()->FindEntry(comment_code->
address());
173 CHECK_EQ(
"comment", comment->name());
175 CodeEntry* args5 = generator.code_map()->FindEntry(args5_code->
address());
181 CodeEntry* comment2 = generator.code_map()->FindEntry(moved_code->
address());
183 CHECK_EQ(
"comment2", comment2->name());
188 static int CompareProfileNodes(
const T*
p1,
const T*
p2) {
189 return strcmp((*p1)->entry()->name(), (*p2)->entry()->name());
194 TestSetup test_setup;
203 CpuProfilesCollection* profiles =
new CpuProfilesCollection(isolate->
heap());
204 profiles->StartProfiling(
"",
false);
205 ProfileGenerator generator(profiles);
206 SmartPointer<ProfilerEventsProcessor> processor(
new ProfilerEventsProcessor(
207 &generator,
NULL, TimeDelta::FromMicroseconds(100)));
209 CpuProfiler
profiler(isolate, profiles, &generator, processor.get());
211 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame1_code,
"bbb");
212 profiler.CodeCreateEvent(i::Logger::STUB_TAG, frame2_code, 5);
213 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, frame3_code,
"ddd");
216 EnqueueTickSampleEvent(
220 EnqueueTickSampleEvent(
226 processor->StopSynchronously();
227 CpuProfile* profile = profiles->StopProfiling(
"");
232 profile->top_down()->root()->children();
233 CHECK_EQ(1, top_down_root_children->length());
234 CHECK_EQ(
"bbb", top_down_root_children->
last()->entry()->name());
236 top_down_root_children->
last()->children();
237 CHECK_EQ(1, top_down_bbb_children->length());
238 CHECK_EQ(
"5", top_down_bbb_children->last()->entry()->name());
240 top_down_bbb_children->
last()->children();
241 CHECK_EQ(1, top_down_stub_children->length());
242 CHECK_EQ(
"ddd", top_down_stub_children->last()->entry()->name());
244 top_down_stub_children->
last()->children();
245 CHECK_EQ(0, top_down_ddd_children->length());
251 TEST(CrashIfStoppingLastNonExistentProfile) {
253 TestSetup test_setup;
256 profiler->StopProfiling(
"2");
257 profiler->StartProfiling(
"1");
258 profiler->StopProfiling(
"");
265 TestSetup test_setup;
272 CpuProfilesCollection* profiles =
new CpuProfilesCollection(isolate->
heap());
273 profiles->StartProfiling(
"",
false);
274 ProfileGenerator generator(profiles);
275 SmartPointer<ProfilerEventsProcessor> processor(
new ProfilerEventsProcessor(
276 &generator,
NULL, TimeDelta::FromMicroseconds(100)));
278 CpuProfiler
profiler(isolate, profiles, &generator, processor.get());
280 profiler.CodeCreateEvent(i::Logger::BUILTIN_TAG, code,
"bbb");
289 processor->FinishTickSample();
291 processor->StopSynchronously();
292 CpuProfile* profile = profiles->StopProfiling(
"");
295 int actual_depth = 0;
296 const ProfileNode* node = profile->top_down()->root();
297 while (node->children()->length() > 0) {
298 node = node->children()->last();
308 TestSetup test_setup;
310 CHECK_EQ(0, profiler->GetProfilesCount());
311 profiler->DeleteAllProfiles();
312 CHECK_EQ(0, profiler->GetProfilesCount());
314 profiler->StartProfiling(
"1");
315 profiler->StopProfiling(
"1");
316 CHECK_EQ(1, profiler->GetProfilesCount());
317 profiler->DeleteAllProfiles();
318 CHECK_EQ(0, profiler->GetProfilesCount());
319 profiler->StartProfiling(
"1");
320 profiler->StartProfiling(
"2");
321 profiler->StopProfiling(
"2");
322 profiler->StopProfiling(
"1");
323 CHECK_EQ(2, profiler->GetProfilesCount());
324 profiler->DeleteAllProfiles();
325 CHECK_EQ(0, profiler->GetProfilesCount());
328 profiler->StartProfiling(
"1");
329 profiler->StartProfiling(
"2");
330 CHECK_EQ(0, profiler->GetProfilesCount());
331 profiler->DeleteAllProfiles();
332 CHECK_EQ(0, profiler->GetProfilesCount());
342 for (
int i = 0; i < length; i++) {
358 cpu_profiler->StartCpuProfiling(name1);
362 CHECK(FindCpuProfile(cpu_profiler, p1));
367 cpu_profiler->StartCpuProfiling(name2);
371 CHECK(FindCpuProfile(cpu_profiler, p2));
373 cpu_profiler->StartCpuProfiling(name3);
378 CHECK(FindCpuProfile(cpu_profiler, p3));
379 CHECK(FindCpuProfile(cpu_profiler, p2));
382 CHECK(!FindCpuProfile(cpu_profiler, p2));
383 CHECK(FindCpuProfile(cpu_profiler, p3));
396 cpu_profiler->StartCpuProfiling(profile_name);
397 const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name);
405 unsigned min_js_samples) {
416 function->Call(env->
Global(), argc, argv);
432 for (
int i = 0; i < vector.length(); i++) {
433 if (string->
Equals(vector[i]))
443 for (
int i = 0; i < count; i++) {
445 CHECK(ContainsString(name, names));
447 for (
int j = 0; j < count; j++) {
448 if (j == i)
continue;
460 for (
int i = 0; i < count; i++) {
475 "Failed to GetChild: %s", name);
482 static void CheckSimpleBranch(
v8::Isolate* isolate,
484 const char* names[],
int length) {
485 for (
int i = 0; i < length; i++) {
486 const char* name = names[i];
487 node = GetChild(isolate, node, name);
488 int expectedChildrenCount = (i == length - 1) ? 0 : 1;
494 static const char* cpu_profiler_test_source =
"function loop(timeout) {\n"
496 " var start = Date.now();\n"
497 " while (Date.now() - start < timeout) {\n"
498 " var n = 100*1000;\n"
501 " this.mmm += n * n * n;\n"
505 "function delay() { try { loop(10); } catch(e) { } }\n"
506 "function bar() { delay(); }\n"
507 "function baz() { delay(); }\n"
516 "function start(timeout) {\n"
517 " var start = Date.now();\n"
520 " var duration = Date.now() - start;\n"
521 " } while (duration < timeout);\n"
522 " return duration;\n"
548 cpu_profiler_test_source))->Run();
552 int32_t profiling_interval_ms = 200;
562 ScopedVector<v8::Handle<v8::String> > names(3);
564 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
566 ProfileGenerator::kProgramEntryName);
568 CheckChildrenNames(root, names);
575 GetChild(env->
GetIsolate(), startNode,
"foo");
576 CHECK_EQ(3, fooNode->GetChildrenCount());
578 const char* barBranch[] = {
"bar",
"delay",
"loop" };
579 CheckSimpleBranch(env->
GetIsolate(), fooNode, barBranch,
581 const char* bazBranch[] = {
"baz",
"delay",
"loop" };
582 CheckSimpleBranch(env->
GetIsolate(), fooNode, bazBranch,
584 const char* delayBranch[] = {
"delay",
"loop" };
585 CheckSimpleBranch(env->
GetIsolate(), fooNode, delayBranch,
593 static const char* cpu_profiler_test_source2 =
"function loop() {}\n"
594 "function delay() { loop(); }\n"
595 "function start(count) {\n"
599 " } while (++k < count*100*1000);\n"
613 TEST(SampleWhenFrameIsNotSetup) {
618 env->
GetIsolate(), cpu_profiler_test_source2))->Run();
623 #if defined(USE_SIMULATOR)
635 ScopedVector<v8::Handle<v8::String> > names(3);
637 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
639 ProfileGenerator::kProgramEntryName);
641 CheckChildrenNames(root, names);
650 GetChild(env->
GetIsolate(), startNode,
"delay");
651 if (delayNode->GetChildrenCount() > 0) {
652 CHECK_EQ(1, delayNode->GetChildrenCount());
653 GetChild(env->
GetIsolate(), delayNode,
"loop");
661 static const char* native_accessor_test_source =
"function start(count) {\n"
662 " for (var i = 0; i < count; i++) {\n"
663 " var o = instance.foo;\n"
664 " instance.foo = o + 1;\n"
672 : min_duration_ms_(min_duration_ms),
673 is_warming_up_(
false) {}
697 if (is_warming_up_)
return;
700 while (duration < min_duration_ms_) {
712 int min_duration_ms_;
721 TEST(NativeAccessorUninitializedIC) {
755 GetChild(isolate, root,
"start");
756 GetChild(isolate, startNode,
"get foo");
757 GetChild(isolate, startNode,
"set foo");
766 TEST(NativeAccessorMonomorphicIC) {
797 int32_t warm_up_iterations = 3;
812 GetChild(isolate, root,
"start");
813 GetChild(isolate, startNode,
"get foo");
814 GetChild(isolate, startNode,
"set foo");
820 static const char* native_method_test_source =
"function start(count) {\n"
821 " for (var i = 0; i < count; i++) {\n"
822 " instance.fooMethod();\n"
827 TEST(NativeMethodUninitializedIC) {
847 data, signature, 0));
855 isolate, native_method_test_source))->Run();
866 GetChild(isolate, root,
"start");
867 GetChild(isolate, startNode,
"fooMethod");
873 TEST(NativeMethodMonomorphicIC) {
893 data, signature, 0));
901 isolate, native_method_test_source))->Run();
908 int32_t warm_up_iterations = 3;
922 GetChild(isolate, root,
"start");
924 GetChild(isolate, root,
"start");
925 GetChild(isolate, startNode,
"fooMethod");
931 static const char* bound_function_test_source =
"function foo(iterations) {\n"
933 " for (var i = 0; i < iterations; i++) { r += i; }\n"
936 "function start(duration) {\n"
937 " var callback = foo.bind(this);\n"
938 " var start = Date.now();\n"
939 " while (Date.now() - start < duration) {\n"
940 " callback(10 * 1000);\n"
963 ScopedVector<v8::Handle<v8::String> > names(3);
965 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
967 ProfileGenerator::kProgramEntryName);
970 CheckChildrenNames(root, names);
974 GetChild(env->
GetIsolate(), startNode,
"foo");
980 static const char* call_function_test_source =
"function bar(iterations) {\n"
982 "function start(duration) {\n"
983 " var start = Date.now();\n"
984 " while (Date.now() - start < duration) {\n"
986 " bar.call(this, 10 * 1000);\n"
1012 env->
GetIsolate(), call_function_test_source))->Run();
1025 ScopedVector<v8::Handle<v8::String> > names(4);
1027 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
1029 ProfileGenerator::kProgramEntryName);
1034 CheckChildrenNames(root, names);
1039 bool is_gc_stress_testing =
1040 (i::FLAG_gc_interval != -1) || i::FLAG_stress_compaction;
1043 CHECK(is_gc_stress_testing || startNode);
1045 ScopedVector<v8::Handle<v8::String> > names(2);
1048 CheckChildrenNames(startNode, names);
1053 if (unresolvedNode) {
1054 ScopedVector<v8::Handle<v8::String> > names(1);
1056 CheckChildrenNames(unresolvedNode, names);
1063 static const char* function_apply_test_source =
"function bar(iterations) {\n"
1065 "function test() {\n"
1066 " bar.apply(this, [10 * 1000]);\n"
1068 "function start(duration) {\n"
1069 " var start = Date.now();\n"
1070 " while (Date.now() - start < duration) {\n"
1108 ScopedVector<v8::Handle<v8::String> > names(3);
1110 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
1112 ProfileGenerator::kProgramEntryName);
1115 CheckChildrenNames(root, names);
1122 ScopedVector<v8::Handle<v8::String> > names(2);
1125 env->
GetIsolate(), ProfileGenerator::kUnresolvedFunctionName);
1126 CheckChildrenNames(startNode, names);
1130 FindChild(env->
GetIsolate(), startNode,
"test");
1132 ScopedVector<v8::Handle<v8::String> > names(2);
1135 CheckChildrenNames(testNode, names);
1140 ProfileGenerator::kUnresolvedFunctionName)) {
1141 ScopedVector<v8::Handle<v8::String> > names(1);
1143 CheckChildrenNames(unresolvedNode, names);
1144 GetChild(env->
GetIsolate(), unresolvedNode,
"apply");
1152 static const char* js_native_js_test_source =
1153 "var is_profiling = false;\n"
1154 "function foo(iterations) {\n"
1155 " if (!is_profiling) {\n"
1156 " is_profiling = true;\n"
1157 " startProfiling('my_profile');\n"
1160 " for (var i = 0; i < iterations; i++) { r += i; }\n"
1163 "function bar(iterations) {\n"
1164 " try { foo(iterations); } catch(e) {}\n"
1166 "function start(duration) {\n"
1167 " var start = Date.now();\n"
1168 " while (Date.now() - start < duration) {\n"
1170 " CallJsFunction(bar, 10 * 1000);\n"
1202 js_native_js_test_source))->Run();
1211 RunProfiler(env,
function, args,
ARRAY_SIZE(args), 10);
1215 ScopedVector<v8::Handle<v8::String> > names(3);
1217 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
1219 ProfileGenerator::kProgramEntryName);
1221 CheckChildrenNames(root, names);
1228 GetChild(env->
GetIsolate(), startNode,
"CallJsFunction");
1230 CHECK_EQ(1, nativeFunctionNode->GetChildrenCount());
1232 GetChild(env->
GetIsolate(), nativeFunctionNode,
"bar");
1234 CHECK_EQ(1, barNode->GetChildrenCount());
1241 static const char* js_native_js_runtime_js_test_source =
1242 "var is_profiling = false;\n"
1243 "function foo(iterations) {\n"
1244 " if (!is_profiling) {\n"
1245 " is_profiling = true;\n"
1246 " startProfiling('my_profile');\n"
1249 " for (var i = 0; i < iterations; i++) { r += i; }\n"
1252 "var bound = foo.bind(this);\n"
1253 "function bar(iterations) {\n"
1254 " try { bound(iterations); } catch(e) {}\n"
1256 "function start(duration) {\n"
1257 " var start = Date.now();\n"
1258 " while (Date.now() - start < duration) {\n"
1260 " CallJsFunction(bar, 10 * 1000);\n"
1287 js_native_js_runtime_js_test_source))->Run();
1296 RunProfiler(env,
function, args,
ARRAY_SIZE(args), 10);
1299 ScopedVector<v8::Handle<v8::String> > names(3);
1301 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
1303 ProfileGenerator::kProgramEntryName);
1305 CheckChildrenNames(root, names);
1311 GetChild(env->
GetIsolate(), startNode,
"CallJsFunction");
1313 CHECK_EQ(1, nativeFunctionNode->GetChildrenCount());
1315 GetChild(env->
GetIsolate(), nativeFunctionNode,
"bar");
1317 CHECK_EQ(1, barNode->GetChildrenCount());
1325 CallJsFunction(info);
1329 static const char* js_native1_js_native2_js_test_source =
1330 "var is_profiling = false;\n"
1331 "function foo(iterations) {\n"
1332 " if (!is_profiling) {\n"
1333 " is_profiling = true;\n"
1334 " startProfiling('my_profile');\n"
1337 " for (var i = 0; i < iterations; i++) { r += i; }\n"
1340 "function bar(iterations) {\n"
1341 " CallJsFunction2(foo, iterations);\n"
1343 "function start(duration) {\n"
1344 " var start = Date.now();\n"
1345 " while (Date.now() - start < duration) {\n"
1347 " CallJsFunction1(bar, 10 * 1000);\n"
1374 env->
GetIsolate(), CallJsFunction2)->GetFunction();
1381 js_native1_js_native2_js_test_source))->Run();
1390 RunProfiler(env,
function, args,
ARRAY_SIZE(args), 10);
1393 ScopedVector<v8::Handle<v8::String> > names(3);
1395 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
1397 ProfileGenerator::kProgramEntryName);
1399 CheckChildrenNames(root, names);
1405 GetChild(env->
GetIsolate(), startNode,
"CallJsFunction1");
1407 CHECK_EQ(1, nativeNode1->GetChildrenCount());
1409 GetChild(env->
GetIsolate(), nativeNode1,
"bar");
1411 CHECK_EQ(1, barNode->GetChildrenCount());
1413 GetChild(env->
GetIsolate(), barNode,
"CallJsFunction2");
1415 CHECK_EQ(1, nativeNode2->GetChildrenCount());
1416 GetChild(env->
GetIsolate(), nativeNode2,
"foo");
1433 cpu_profiler->StartCpuProfiling(profile_name);
1439 cpu_profiler->SetIdle(
true);
1441 for (
int i = 0; i < 3; i++) {
1445 cpu_profiler->SetIdle(
false);
1449 const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name);
1456 ScopedVector<v8::Handle<v8::String> > names(3);
1458 env->
GetIsolate(), ProfileGenerator::kGarbageCollectorEntryName);
1460 ProfileGenerator::kProgramEntryName);
1462 ProfileGenerator::kIdleEntryName);
1463 CheckChildrenNames(root, names);
1466 GetChild(env->
GetIsolate(), root, ProfileGenerator::kProgramEntryName);
1471 GetChild(env->
GetIsolate(), root, ProfileGenerator::kIdleEntryName);
1472 CHECK_EQ(0, idleNode->GetChildrenCount());
1473 CHECK_GE(idleNode->GetHitCount(), 3);
1479 static void CheckFunctionDetails(
v8::Isolate* isolate,
1481 const char* name,
const char* script_name,
1482 int script_id,
int line,
int column) {
1499 " function foo\n() { try { bar(); } catch(e) {} }\n"
1500 " function bar() { startProfiling(); }\n",
1504 "\n\n function baz() { try { foo(); } catch(e) {} }\n"
1506 "stopProfiling();\n",
1511 reinterpret_cast<ProfileNode*
>(
1521 ProfileGenerator::kAnonymousFunctionName);
1522 CheckFunctionDetails(env->
GetIsolate(), script,
1523 ProfileGenerator::kAnonymousFunctionName,
"script_b",
1524 script_b->
GetId(), 1, 1);
1526 CheckFunctionDetails(env->
GetIsolate(),
baz,
"baz",
"script_b",
1527 script_b->
GetId(), 3, 16);
1529 CheckFunctionDetails(env->
GetIsolate(),
foo,
"foo",
"script_a",
1530 script_a->
GetId(), 2, 1);
1532 CheckFunctionDetails(env->
GetIsolate(),
bar,
"bar",
"script_a",
1533 script_a->
GetId(), 3, 14);
1537 TEST(DontStopOnFinishedProfileDelete) {
1556 CHECK(inner_profile);
1559 inner_profile =
NULL;
1563 CHECK(outer_profile);
1566 outer_profile =
NULL;
void StartProfiling(const char *title, bool record_samples=false)
void SetAccessor(Handle< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None, Handle< AccessorSignature > signature=Handle< AccessorSignature >())
static Local< Signature > New(Isolate *isolate, Handle< FunctionTemplate > receiver=Handle< FunctionTemplate >(), int argc=0, Handle< FunctionTemplate > argv[]=0)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
#define CHECK_EQ(expected, value)
CpuProfiler * GetCpuProfiler()
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
unsigned js_and_external_sample_count() const
void AddCurrentStack(Isolate *isolate)
static const int kMaxFramesCount
static const char *const kUnresolvedFunctionName
Handle< String > NewStringFromAscii(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
int64_t GetStartTime() const
const CpuProfileNode * GetChild(int index) const
Local< ObjectTemplate > InstanceTemplate()
Handle< String > GetScriptResourceName() const
static const v8::CpuProfile * last_profile
static Local< Integer > New(Isolate *isolate, int32_t value)
void Set(Handle< String > name, Handle< Data > value, PropertyAttribute attributes=None)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
bool Equals(Handle< Value > that) const
void set_warming_up(bool value)
Handle< String > GetFunctionName() const
static v8::Local< v8::Context > NewContext(CcTestExtensionFlags extensions, v8::Isolate *isolate=CcTest::isolate())
TestApiCallbacks(int min_duration_ms)
v8::Isolate * GetIsolate()
void SetClassName(Handle< String > name)
void StartCpuProfiling(Handle< String > title, bool record_samples=false)
const CpuProfile * StopCpuProfiling(Handle< String > title)
static void Callback(const v8::FunctionCallbackInfo< v8::Value > &info)
byte * instruction_start()
int64_t GetEndTime() const
static Local< External > New(Isolate *isolate, void *value)
void StartCountingSamples()
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=0, Handle< Value > data=Handle< Value >(), Handle< Signature > signature=Handle< Signature >(), int length=0)
static Local< Script > Compile(Handle< String > source, ScriptOrigin *origin=NULL, ScriptData *script_data=NULL)
Local< Object > NewInstance() const
static i::Isolate * i_isolate()
static double TimeCurrentMillis()
V8_INLINE Local< Object > This() const
Address stack[kMaxFramesCount]
static V8_INLINE External * Cast(Value *obj)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization 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 VFP3 instructions if available enable use of NEON instructions if 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 d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage including on console Map counters to a file Enable debugger compile events enable GDBJIT enable GDBJIT interface for all code objects dump only objects containing this substring stress the GC compactor to flush out pretty print source code print source AST function name where to insert a breakpoint print scopes for builtins trace contexts operations print stuff during garbage collection report code statistics after GC report handles after GC trace cache state transitions print interface inference details prints when objects are turned into dictionaries report heap spill statistics along with trace isolate state changes trace regexp bytecode execution Minimal Log all events to the log file Log API events to the log file Log heap samples on garbage collection for the hp2ps tool log positions Log suspect operations Used with turns on browser compatible mode for profiling v8 Specify the name of the log file Enable low level linux profiler Enable perf linux profiler(experimental annotate support).") DEFINE_string(gc_fake_mmap
static v8::internal::Handle< To > OpenHandle(v8::Local< From > handle)
#define CHECK_NE(unexpected, value)
static V8_INLINE Local< T > Cast(Local< S > that)
static void Sleep(const int milliseconds)
int StrLength(const char *string)
#define T(name, string, precedence)
i::Code * CreateCode(LocalContext *env)
void SetName(Handle< String > name)
static int SNPrintF(Vector< char > str, const char *format,...)
const CpuProfileNode * GetTopDownRoot() const
static void InitializeVM()
CpuProfiler * cpu_profiler() const
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
Local< Function > GetFunction()
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
int GetChildrenCount() const
int GetColumnNumber() const
CpuProfile * GetProfile(int index)
Local< ObjectTemplate > PrototypeTemplate()
static void Getter(v8::Local< v8::String > name, const v8::PropertyCallbackInfo< v8::Value > &info)
unsigned GetHitCount() const
static void Setter(v8::Local< v8::String > name, v8::Local< v8::Value > value, const v8::PropertyCallbackInfo< void > &info)
ProfilerEventsProcessor * processor() const
v8::Local< v8::Context > local()
int GetLineNumber() const
static v8::Isolate * isolate()
static Local< String > NewFromUtf8(Isolate *isolate, const char *data, NewStringType type=kNormalString, int length=-1)