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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 i::HandleScope scope(isolate); | 1033 i::HandleScope scope(isolate); |
1034 | 1034 |
1035 i::EmbeddedVector<char, 512> script; | 1035 i::EmbeddedVector<char, 512> script; |
1036 i::EmbeddedVector<char, 64> optimize_call; | 1036 i::EmbeddedVector<char, 64> optimize_call; |
1037 | 1037 |
1038 const char* func_name = "func"; | 1038 const char* func_name = "func"; |
1039 if (optimize) { | 1039 if (optimize) { |
1040 i::SNPrintF(optimize_call, "%%OptimizeFunctionOnNextCall(%s);\n", | 1040 i::SNPrintF(optimize_call, "%%OptimizeFunctionOnNextCall(%s);\n", |
1041 func_name); | 1041 func_name); |
1042 } else { | 1042 } else { |
1043 i::SNPrintF(optimize_call, ""); | 1043 optimize_call[0] = '\0'; |
1044 } | 1044 } |
1045 i::SNPrintF(script, | 1045 i::SNPrintF(script, |
1046 "function %s() {\n" | 1046 "function %s() {\n" |
1047 " var n = 0;\n" | 1047 " var n = 0;\n" |
1048 " var m = 100*100;\n" | 1048 " var m = 100*100;\n" |
1049 " while (m > 1) {\n" | 1049 " while (m > 1) {\n" |
1050 " m--;\n" | 1050 " m--;\n" |
1051 " n += m * m * m;\n" | 1051 " n += m * m * m;\n" |
1052 " }\n" | 1052 " }\n" |
1053 "}\n" | 1053 "}\n" |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 iprofile->Print(); | 2091 iprofile->Print(); |
2092 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); | 2092 v8::CpuProfile* profile = reinterpret_cast<v8::CpuProfile*>(iprofile); |
2093 | 2093 |
2094 const char* branch[] = {"", "test"}; | 2094 const char* branch[] = {"", "test"}; |
2095 const ProfileNode* itest_node = | 2095 const ProfileNode* itest_node = |
2096 GetSimpleBranch(env, profile, branch, arraysize(branch)); | 2096 GetSimpleBranch(env, profile, branch, arraysize(branch)); |
2097 CHECK_EQ(0U, itest_node->deopt_infos().size()); | 2097 CHECK_EQ(0U, itest_node->deopt_infos().size()); |
2098 | 2098 |
2099 iprofiler->DeleteProfile(iprofile); | 2099 iprofiler->DeleteProfile(iprofile); |
2100 } | 2100 } |
OLD | NEW |