Chromium Code Reviews

Unified Diff: src/compiler/bytecode-graph-builder.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.
Jump to:
View side-by-side diff with in-line comments
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 4ac24027f32614f113054a3ca164c18246acc345..5cac112e188ff107daf969eecb2230d8c8e0e192 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -2217,6 +2217,20 @@ void BytecodeGraphBuilder::VisitDebugger() {
DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK);
#undef DEBUG_BREAK
+void BytecodeGraphBuilder::VisitIncBlockCounter() {
+ DCHECK(FLAG_block_coverage);
+
+ PrepareEagerCheckpoint();
rmcilroy 2017/05/18 14:17:59 I don't think you would need a Checkpoint for this
jgruber 2017/05/22 09:43:32 Done.
+
+ Node* slot = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0));
+ Node* vector = jsgraph()->Constant(feedback_vector());
+
+ const Operator* op = javascript()->CallRuntime(Runtime::kIncBlockCounter);
+
+ Node* node = NewNode(op, vector, slot);
+ environment()->RecordAfterState(node, Environment::kAttachFrameState);
+}
+
void BytecodeGraphBuilder::VisitForInPrepare() {
PrepareEagerCheckpoint();
Node* receiver =

Powered by Google App Engine