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