OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6613 LocalContext env; | 6613 LocalContext env; |
6614 v8::Isolate* isolate = env->GetIsolate(); | 6614 v8::Isolate* isolate = env->GetIsolate(); |
6615 v8::HandleScope scope(isolate); | 6615 v8::HandleScope scope(isolate); |
6616 v8::debug::Coverage::SelectMode(isolate, v8::debug::Coverage::kPreciseCount); | 6616 v8::debug::Coverage::SelectMode(isolate, v8::debug::Coverage::kPreciseCount); |
6617 v8::Local<v8::String> source = v8_str( | 6617 v8::Local<v8::String> source = v8_str( |
6618 "function f() {\n" | 6618 "function f() {\n" |
6619 "}\n" | 6619 "}\n" |
6620 "f();\n" | 6620 "f();\n" |
6621 "f();"); | 6621 "f();"); |
6622 CompileRun(source); | 6622 CompileRun(source); |
6623 v8::debug::Coverage coverage = v8::debug::Coverage::Collect(isolate, false); | 6623 v8::debug::Coverage coverage = v8::debug::Coverage::CollectPrecise(isolate); |
6624 CHECK_EQ(1u, coverage.ScriptCount()); | 6624 CHECK_EQ(1u, coverage.ScriptCount()); |
6625 v8::debug::Coverage::ScriptData script_data = coverage.GetScriptData(0); | 6625 v8::debug::Coverage::ScriptData script_data = coverage.GetScriptData(0); |
6626 v8::Local<v8::debug::Script> script = script_data.GetScript(); | 6626 v8::Local<v8::debug::Script> script = script_data.GetScript(); |
6627 CHECK(script->Source() | 6627 CHECK(script->Source() |
6628 .ToLocalChecked() | 6628 .ToLocalChecked() |
6629 ->Equals(env.local(), source) | 6629 ->Equals(env.local(), source) |
6630 .FromMaybe(false)); | 6630 .FromMaybe(false)); |
6631 | 6631 |
6632 CHECK_EQ(2u, script_data.FunctionCount()); | 6632 CHECK_EQ(2u, script_data.FunctionCount()); |
6633 v8::debug::Coverage::FunctionData function_data = | 6633 v8::debug::Coverage::FunctionData function_data = |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6706 } | 6706 } |
6707 if (i::FLAG_turbo) { | 6707 if (i::FLAG_turbo) { |
6708 // With turbofan we generate one return location per return statement, | 6708 // With turbofan we generate one return location per return statement, |
6709 // each has line = 5, column = 0 as statement position. | 6709 // each has line = 5, column = 0 as statement position. |
6710 CHECK(returns_count == 4); | 6710 CHECK(returns_count == 4); |
6711 } else { | 6711 } else { |
6712 // Without turbofan we generate one return location. | 6712 // Without turbofan we generate one return location. |
6713 CHECK(returns_count == 1); | 6713 CHECK(returns_count == 1); |
6714 } | 6714 } |
6715 } | 6715 } |
OLD | NEW |