OLD | NEW |
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 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1171 // 5 5 call [-1] #6 | 1171 // 5 5 call [-1] #6 |
1172 // 71 70 start [-1] #3 | 1172 // 71 70 start [-1] #3 |
1173 // 1 1 bar [-1] #7 | 1173 // 1 1 bar [-1] #7 |
1174 // 19 19 (program) [-1] #2 | 1174 // 19 19 (program) [-1] #2 |
1175 TEST(FunctionCallSample) { | 1175 TEST(FunctionCallSample) { |
1176 LocalContext env; | 1176 LocalContext env; |
1177 v8::HandleScope scope(env->GetIsolate()); | 1177 v8::HandleScope scope(env->GetIsolate()); |
1178 | 1178 |
1179 // Collect garbage that might have be generated while installing | 1179 // Collect garbage that might have be generated while installing |
1180 // extensions. | 1180 // extensions. |
1181 CcTest::heap()->CollectAllGarbage(); | 1181 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); |
1182 | 1182 |
1183 CompileRun(call_function_test_source); | 1183 CompileRun(call_function_test_source); |
1184 v8::Local<v8::Function> function = GetFunction(*env, "start"); | 1184 v8::Local<v8::Function> function = GetFunction(*env, "start"); |
1185 | 1185 |
1186 int32_t duration_ms = 100; | 1186 int32_t duration_ms = 100; |
1187 v8::Handle<v8::Value> args[] = { | 1187 v8::Handle<v8::Value> args[] = { |
1188 v8::Integer::New(env->GetIsolate(), duration_ms) | 1188 v8::Integer::New(env->GetIsolate(), duration_ms) |
1189 }; | 1189 }; |
1190 v8::CpuProfile* profile = | 1190 v8::CpuProfile* profile = |
1191 RunProfiler(env.local(), function, args, arraysize(args), 100); | 1191 RunProfiler(env.local(), function, args, arraysize(args), 100); |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2028 iprofile->Print(); | 2028 iprofile->Print(); |
2029 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); | 2029 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); |
2030 | 2030 |
2031 const char* branch[] = {"", "test"}; | 2031 const char* branch[] = {"", "test"}; |
2032 const ProfileNode* itest_node = | 2032 const ProfileNode* itest_node = |
2033 GetSimpleBranch(profile, branch, arraysize(branch)); | 2033 GetSimpleBranch(profile, branch, arraysize(branch)); |
2034 CHECK_EQ(0U, itest_node->deopt_infos().size()); | 2034 CHECK_EQ(0U, itest_node->deopt_infos().size()); |
2035 | 2035 |
2036 iprofiler->DeleteProfile(iprofile); | 2036 iprofiler->DeleteProfile(iprofile); |
2037 } | 2037 } |
OLD | NEW |