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 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 GetChild(env, start_node, "CallJsFunction"); | 1568 GetChild(env, start_node, "CallJsFunction"); |
1569 const v8::CpuProfileNode* bar_node = GetChild(env, native_node, "bar"); | 1569 const v8::CpuProfileNode* bar_node = GetChild(env, native_node, "bar"); |
1570 GetChild(env, bar_node, "foo"); | 1570 GetChild(env, bar_node, "foo"); |
1571 | 1571 |
1572 profile->Delete(); | 1572 profile->Delete(); |
1573 } | 1573 } |
1574 | 1574 |
1575 static const char* inlining_test_source = | 1575 static const char* inlining_test_source = |
1576 "%NeverOptimizeFunction(action);\n" | 1576 "%NeverOptimizeFunction(action);\n" |
1577 "%NeverOptimizeFunction(start);\n" | 1577 "%NeverOptimizeFunction(start);\n" |
| 1578 "level1()\n" |
1578 "%OptimizeFunctionOnNextCall(level1);\n" | 1579 "%OptimizeFunctionOnNextCall(level1);\n" |
1579 "%OptimizeFunctionOnNextCall(level2);\n" | 1580 "%OptimizeFunctionOnNextCall(level2);\n" |
1580 "%OptimizeFunctionOnNextCall(level3);\n" | 1581 "%OptimizeFunctionOnNextCall(level3);\n" |
1581 "var finish = false;\n" | 1582 "var finish = false;\n" |
1582 "function action(n) {\n" | 1583 "function action(n) {\n" |
1583 " var s = 0;\n" | 1584 " var s = 0;\n" |
1584 " for (var i = 0; i < n; ++i) s += i*i*i;\n" | 1585 " for (var i = 0; i < n; ++i) s += i*i*i;\n" |
1585 " if (finish)\n" | 1586 " if (finish)\n" |
1586 " startProfiling('my_profile');\n" | 1587 " startProfiling('my_profile');\n" |
1587 " return s;\n" | 1588 " return s;\n" |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2175 printf("Profile JSON: %s\n", profile_json.c_str()); | 2176 printf("Profile JSON: %s\n", profile_json.c_str()); |
2176 std::string code = profile_checker + profile_json + ")"; | 2177 std::string code = profile_checker + profile_json + ")"; |
2177 v8::Local<v8::Value> result = | 2178 v8::Local<v8::Value> result = |
2178 CompileRunChecked(CcTest::isolate(), code.c_str()); | 2179 CompileRunChecked(CcTest::isolate(), code.c_str()); |
2179 v8::String::Utf8Value value(result); | 2180 v8::String::Utf8Value value(result); |
2180 printf("Check result: %*s\n", value.length(), *value); | 2181 printf("Check result: %*s\n", value.length(), *value); |
2181 CHECK_EQ(0, value.length()); | 2182 CHECK_EQ(0, value.length()); |
2182 | 2183 |
2183 i::V8::SetPlatformForTesting(old_platform); | 2184 i::V8::SetPlatformForTesting(old_platform); |
2184 } | 2185 } |
OLD | NEW |