| 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 // 5 0 (unresolved function) [-1] #5 | 946 // 5 0 (unresolved function) [-1] #5 |
| 947 // 5 5 call [-1] #6 | 947 // 5 5 call [-1] #6 |
| 948 // 71 70 start [-1] #3 | 948 // 71 70 start [-1] #3 |
| 949 // 1 1 bar [-1] #7 | 949 // 1 1 bar [-1] #7 |
| 950 // 19 19 (program) [-1] #2 | 950 // 19 19 (program) [-1] #2 |
| 951 TEST(FunctionCallSample) { | 951 TEST(FunctionCallSample) { |
| 952 LocalContext env; | 952 LocalContext env; |
| 953 v8::HandleScope scope(env->GetIsolate()); | 953 v8::HandleScope scope(env->GetIsolate()); |
| 954 | 954 |
| 955 // Collect garbage that might have be generated while installing extensions. | 955 // Collect garbage that might have be generated while installing extensions. |
| 956 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 956 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); |
| 957 | 957 |
| 958 v8::Script::Compile(v8::String::New(call_function_test_source))->Run(); | 958 v8::Script::Compile(v8::String::New(call_function_test_source))->Run(); |
| 959 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast( | 959 v8::Local<v8::Function> function = v8::Local<v8::Function>::Cast( |
| 960 env->Global()->Get(v8::String::New("start"))); | 960 env->Global()->Get(v8::String::New("start"))); |
| 961 | 961 |
| 962 int32_t duration_ms = 100; | 962 int32_t duration_ms = 100; |
| 963 v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) }; | 963 v8::Handle<v8::Value> args[] = { v8::Integer::New(duration_ms) }; |
| 964 const v8::CpuProfile* profile = | 964 const v8::CpuProfile* profile = |
| 965 RunProfiler(env, function, args, ARRAY_SIZE(args), 100); | 965 RunProfiler(env, function, args, ARRAY_SIZE(args), 100); |
| 966 | 966 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1353 CHECK_EQ(0, programNode->GetChildrenCount()); | 1353 CHECK_EQ(0, programNode->GetChildrenCount()); |
| 1354 CHECK_GE(programNode->GetHitCount(), 3); | 1354 CHECK_GE(programNode->GetHitCount(), 3); |
| 1355 | 1355 |
| 1356 const v8::CpuProfileNode* idleNode = | 1356 const v8::CpuProfileNode* idleNode = |
| 1357 GetChild(root, ProfileGenerator::kIdleEntryName); | 1357 GetChild(root, ProfileGenerator::kIdleEntryName); |
| 1358 CHECK_EQ(0, idleNode->GetChildrenCount()); | 1358 CHECK_EQ(0, idleNode->GetChildrenCount()); |
| 1359 CHECK_GE(idleNode->GetHitCount(), 3); | 1359 CHECK_GE(idleNode->GetHitCount(), 3); |
| 1360 | 1360 |
| 1361 cpu_profiler->DeleteAllCpuProfiles(); | 1361 cpu_profiler->DeleteAllCpuProfiles(); |
| 1362 } | 1362 } |
| OLD | NEW |