Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Comment nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/debug/debug-coverage.h" 9 #include "src/debug/debug-coverage.h"
10 #include "src/debug/debug-evaluate.h" 10 #include "src/debug/debug-evaluate.h"
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 } 1958 }
1959 1959
1960 RUNTIME_FUNCTION(Runtime_DebugTogglePreciseCoverage) { 1960 RUNTIME_FUNCTION(Runtime_DebugTogglePreciseCoverage) {
1961 SealHandleScope shs(isolate); 1961 SealHandleScope shs(isolate);
1962 CONVERT_BOOLEAN_ARG_CHECKED(enable, 0); 1962 CONVERT_BOOLEAN_ARG_CHECKED(enable, 0);
1963 Coverage::SelectMode(isolate, enable ? debug::Coverage::kPreciseCount 1963 Coverage::SelectMode(isolate, enable ? debug::Coverage::kPreciseCount
1964 : debug::Coverage::kBestEffort); 1964 : debug::Coverage::kBestEffort);
1965 return isolate->heap()->undefined_value(); 1965 return isolate->heap()->undefined_value();
1966 } 1966 }
1967 1967
1968 RUNTIME_FUNCTION(Runtime_DebugToggleBlockCoverage) {
1969 SealHandleScope shs(isolate);
1970 CONVERT_BOOLEAN_ARG_CHECKED(enable, 0);
1971 Coverage::SelectMode(isolate, enable ? debug::Coverage::kBlockBinary
1972 : debug::Coverage::kBestEffort);
1973 return isolate->heap()->undefined_value();
1974 }
1975
1976 RUNTIME_FUNCTION(Runtime_IncBlockCounter) {
1977 HandleScope scope(isolate);
1978 DCHECK_EQ(2, args.length());
1979 CONVERT_ARG_HANDLE_CHECKED(FeedbackVector, vector, 0);
rmcilroy 2017/05/18 14:17:59 Unused?
jgruber 2017/05/22 09:43:32 The vector is needed to get to the SFI below.
rmcilroy 2017/05/22 11:08:46 Sorry missed this. It's more normal to get the SFI
jgruber 2017/05/22 11:10:08 Sure, will do.
1980 CONVERT_SMI_ARG_CHECKED(slot_index, 1);
rmcilroy 2017/05/18 14:17:59 coverage_array_slot
jgruber 2017/05/22 09:43:32 Done.
1981
1982 DCHECK(FLAG_block_coverage);
1983
1984 SharedFunctionInfo* shared = vector->shared_function_info();
1985 CoverageInfo* coverage_info = CoverageInfo::cast(shared->coverage_info());
1986 coverage_info->IncrementBlockCount(slot_index);
1987
1988 return isolate->heap()->undefined_value();
1989 }
1990
1968 } // namespace internal 1991 } // namespace internal
1969 } // namespace v8 1992 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698