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

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

Issue 16286016: Notify CPU profiler when calling native getters (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed check that pthread_kill always succeeds Created 7 years, 6 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 | « test/cctest/test-api.cc ('k') | 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 function->Call(env->Global(), ARRAY_SIZE(args), args); 795 function->Call(env->Global(), ARRAY_SIZE(args), args);
796 const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name); 796 const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name);
797 797
798 CHECK_NE(NULL, profile); 798 CHECK_NE(NULL, profile);
799 // Dump collected profile to have a better diagnostic in case of failure. 799 // Dump collected profile to have a better diagnostic in case of failure.
800 reinterpret_cast<i::CpuProfile*>( 800 reinterpret_cast<i::CpuProfile*>(
801 const_cast<v8::CpuProfile*>(profile))->Print(); 801 const_cast<v8::CpuProfile*>(profile))->Print();
802 802
803 const v8::CpuProfileNode* root = profile->GetTopDownRoot(); 803 const v8::CpuProfileNode* root = profile->GetTopDownRoot();
804 const v8::CpuProfileNode* startNode = GetChild(root, "start"); 804 const v8::CpuProfileNode* startNode = GetChild(root, "start");
805 // TODO(yurys): in LoadIC should be changed to report external callback 805 GetChild(startNode, "get foo");
806 // invocation. See r13768 where it was LoadCallbackProperty was removed.
807 // GetChild(startNode, "get foo");
808 GetChild(startNode, "set foo"); 806 GetChild(startNode, "set foo");
809 807
810 cpu_profiler->DeleteAllCpuProfiles(); 808 cpu_profiler->DeleteAllCpuProfiles();
811 } 809 }
812 810
813 811
814 static const char* native_method_test_source = "function start(count) {\n" 812 static const char* native_method_test_source = "function start(count) {\n"
815 " for (var i = 0; i < count; i++) {\n" 813 " for (var i = 0; i < count; i++) {\n"
816 " instance.fooMethod();\n" 814 " instance.fooMethod();\n"
817 " }\n" 815 " }\n"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 function->Call(env->Global(), ARRAY_SIZE(args), args); 902 function->Call(env->Global(), ARRAY_SIZE(args), args);
905 const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name); 903 const v8::CpuProfile* profile = cpu_profiler->StopCpuProfiling(profile_name);
906 904
907 CHECK_NE(NULL, profile); 905 CHECK_NE(NULL, profile);
908 // Dump collected profile to have a better diagnostic in case of failure. 906 // Dump collected profile to have a better diagnostic in case of failure.
909 reinterpret_cast<i::CpuProfile*>( 907 reinterpret_cast<i::CpuProfile*>(
910 const_cast<v8::CpuProfile*>(profile))->Print(); 908 const_cast<v8::CpuProfile*>(profile))->Print();
911 909
912 const v8::CpuProfileNode* root = profile->GetTopDownRoot(); 910 const v8::CpuProfileNode* root = profile->GetTopDownRoot();
913 GetChild(root, "start"); 911 GetChild(root, "start");
914 // TODO(yurys): in CallIC should be changed to report external callback 912 const v8::CpuProfileNode* startNode = GetChild(root, "start");
915 // invocation. 913 GetChild(startNode, "fooMethod");
916 // GetChild(startNode, "fooMethod");
917 914
918 cpu_profiler->DeleteAllCpuProfiles(); 915 cpu_profiler->DeleteAllCpuProfiles();
919 } 916 }
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698