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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 | 1023 |
1024 profile->Delete(); | 1024 profile->Delete(); |
1025 } | 1025 } |
1026 | 1026 |
1027 // This tests checks distribution of the samples through the source lines. | 1027 // This tests checks distribution of the samples through the source lines. |
1028 static void TickLines(bool optimize) { | 1028 static void TickLines(bool optimize) { |
1029 if (!optimize) i::FLAG_crankshaft = false; | 1029 if (!optimize) i::FLAG_crankshaft = false; |
1030 CcTest::InitializeVM(); | 1030 CcTest::InitializeVM(); |
1031 LocalContext env; | 1031 LocalContext env; |
1032 i::FLAG_allow_natives_syntax = true; | 1032 i::FLAG_allow_natives_syntax = true; |
1033 i::FLAG_turbo_source_positions = true; | |
1034 i::Isolate* isolate = CcTest::i_isolate(); | 1033 i::Isolate* isolate = CcTest::i_isolate(); |
1035 i::Factory* factory = isolate->factory(); | 1034 i::Factory* factory = isolate->factory(); |
1036 i::HandleScope scope(isolate); | 1035 i::HandleScope scope(isolate); |
1037 | 1036 |
1038 i::EmbeddedVector<char, 512> script; | 1037 i::EmbeddedVector<char, 512> script; |
1039 i::EmbeddedVector<char, 64> optimize_call; | 1038 i::EmbeddedVector<char, 64> optimize_call; |
1040 | 1039 |
1041 const char* func_name = "func"; | 1040 const char* func_name = "func"; |
1042 if (optimize) { | 1041 if (optimize) { |
1043 i::SNPrintF(optimize_call, "%%OptimizeFunctionOnNextCall(%s);\n", | 1042 i::SNPrintF(optimize_call, "%%OptimizeFunctionOnNextCall(%s);\n", |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 printf("Profile JSON: %s\n", profile_json.c_str()); | 2169 printf("Profile JSON: %s\n", profile_json.c_str()); |
2171 std::string code = profile_checker + profile_json + ")"; | 2170 std::string code = profile_checker + profile_json + ")"; |
2172 v8::Local<v8::Value> result = | 2171 v8::Local<v8::Value> result = |
2173 CompileRunChecked(CcTest::isolate(), code.c_str()); | 2172 CompileRunChecked(CcTest::isolate(), code.c_str()); |
2174 v8::String::Utf8Value value(result); | 2173 v8::String::Utf8Value value(result); |
2175 printf("Check result: %*s\n", value.length(), *value); | 2174 printf("Check result: %*s\n", value.length(), *value); |
2176 CHECK_EQ(0, value.length()); | 2175 CHECK_EQ(0, value.length()); |
2177 | 2176 |
2178 i::V8::SetPlatformForTesting(old_platform); | 2177 i::V8::SetPlatformForTesting(old_platform); |
2179 } | 2178 } |
OLD | NEW |