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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Two fixes 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 14c97c832f18c2e9aa329f44c3e7838c6f31bfd3..c736cf56ed565039150ceb0fc15ddaa347c12e7f 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -2224,6 +2224,19 @@ void BytecodeGraphBuilder::VisitDebugger() {
DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK);
#undef DEBUG_BREAK
+void BytecodeGraphBuilder::VisitIncBlockCounter() {
+ DCHECK(FLAG_block_coverage);
+
+ Node* closure = GetFunctionClosure();
+ Node* coverage_array_slot =
+ jsgraph()->Constant(bytecode_iterator().GetIndexOperand(0));
+
+ const Operator* op = javascript()->CallRuntime(Runtime::kIncBlockCounter);
+
+ Node* node = NewNode(op, closure, coverage_array_slot);
+ environment()->RecordAfterState(node, Environment::kAttachFrameState);
rmcilroy 2017/06/02 09:35:59 I don't think you need this (since the runtime cal
jgruber 2017/06/02 11:38:48 Thanks, I thought so (asked this in an comment tha
+}
+
void BytecodeGraphBuilder::VisitForInPrepare() {
PrepareEagerCheckpoint();
Node* receiver =
« no previous file with comments | « src/compiler.cc ('k') | src/compiler/linkage.cc » ('j') | src/interpreter/bytecode-generator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698