Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: test/cctest/test-cpu-profiler.cc

Issue 18714006: Collect garbage at the beginning of cctest/test-cpu-profiler/FunctionCallSample (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 22 matching lines...) Expand all
33 #include "cctest.h" 33 #include "cctest.h"
34 #include "platform.h" 34 #include "platform.h"
35 #include "utils.h" 35 #include "utils.h"
36 #include "../include/v8-profiler.h" 36 #include "../include/v8-profiler.h"
37 #undef V8_DISABLE_DEPRECATIONS 37 #undef V8_DISABLE_DEPRECATIONS
38 38
39 using i::CodeEntry; 39 using i::CodeEntry;
40 using i::CpuProfile; 40 using i::CpuProfile;
41 using i::CpuProfiler; 41 using i::CpuProfiler;
42 using i::CpuProfilesCollection; 42 using i::CpuProfilesCollection;
43 using i::Heap;
43 using i::ProfileGenerator; 44 using i::ProfileGenerator;
44 using i::ProfileNode; 45 using i::ProfileNode;
45 using i::ProfilerEventsProcessor; 46 using i::ProfilerEventsProcessor;
46 using i::ScopedVector; 47 using i::ScopedVector;
47 using i::Vector; 48 using i::Vector;
48 49
49 50
50 TEST(StartStop) { 51 TEST(StartStop) {
51 CpuProfilesCollection profiles; 52 CpuProfilesCollection profiles;
52 ProfileGenerator generator(&profiles); 53 ProfileGenerator generator(&profiles);
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 // 1 1 (garbage collector) [-1] #4 989 // 1 1 (garbage collector) [-1] #4
989 // 5 0 (unresolved function) [-1] #5 990 // 5 0 (unresolved function) [-1] #5
990 // 5 5 call [-1] #6 991 // 5 5 call [-1] #6
991 // 71 70 start [-1] #3 992 // 71 70 start [-1] #3
992 // 1 1 bar [-1] #7 993 // 1 1 bar [-1] #7
993 // 19 19 (program) [-1] #2 994 // 19 19 (program) [-1] #2
994 TEST(FunctionCallSample) { 995 TEST(FunctionCallSample) {
995 LocalContext env; 996 LocalContext env;
996 v8::HandleScope scope(env->GetIsolate()); 997 v8::HandleScope scope(env->GetIsolate());
997 998
999 // Collect garbage that might have be generated while installing extensions.
1000 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
1001
998 v8::Script::Compile(v8::String::New(call_function_test_source))->Run(); 1002 v8::Script::Compile(v8::String::New(call_function_test_source))->Run();
999 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast( 1003 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast(
1000 env->Global()->Get(v8::String::New("start"))); 1004 env->Global()->Get(v8::String::New("start")));
1001 1005
1002 v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler(); 1006 v8::CpuProfiler* cpu_profiler = env->GetIsolate()->GetCpuProfiler();
1003 v8::Local<v8::String> profile_name = v8::String::New("my_profile"); 1007 v8::Local<v8::String> profile_name = v8::String::New("my_profile");
1004 1008
1005 cpu_profiler->StartCpuProfiling(profile_name); 1009 cpu_profiler->StartCpuProfiling(profile_name);
1006 int32_t duration_ms = 100; 1010 int32_t duration_ms = 100;
1007 #if defined(_WIN32) || defined(_WIN64) 1011 #if defined(_WIN32) || defined(_WIN64)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 FindChild(startNode, ProfileGenerator::kUnresolvedFunctionName)) { 1141 FindChild(startNode, ProfileGenerator::kUnresolvedFunctionName)) {
1138 ScopedVector<v8::Handle<v8::String> > names(1); 1142 ScopedVector<v8::Handle<v8::String> > names(1);
1139 names[0] = v8::String::New("apply"); 1143 names[0] = v8::String::New("apply");
1140 CheckChildrenNames(unresolvedNode, names); 1144 CheckChildrenNames(unresolvedNode, names);
1141 GetChild(unresolvedNode, "apply"); 1145 GetChild(unresolvedNode, "apply");
1142 } 1146 }
1143 } 1147 }
1144 1148
1145 cpu_profiler->DeleteAllCpuProfiles(); 1149 cpu_profiler->DeleteAllCpuProfiles();
1146 } 1150 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698