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

Side by Side 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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compiler/access-builder.h" 9 #include "src/compiler/access-builder.h"
10 #include "src/compiler/compiler-source-position-table.h" 10 #include "src/compiler/compiler-source-position-table.h"
(...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 Node* call = NewNode(javascript()->Debugger()); 2210 Node* call = NewNode(javascript()->Debugger());
2211 environment()->RecordAfterState(call, Environment::kAttachFrameState); 2211 environment()->RecordAfterState(call, Environment::kAttachFrameState);
2212 } 2212 }
2213 2213
2214 // We cannot create a graph from the debugger copy of the bytecode array. 2214 // We cannot create a graph from the debugger copy of the bytecode array.
2215 #define DEBUG_BREAK(Name, ...) \ 2215 #define DEBUG_BREAK(Name, ...) \
2216 void BytecodeGraphBuilder::Visit##Name() { UNREACHABLE(); } 2216 void BytecodeGraphBuilder::Visit##Name() { UNREACHABLE(); }
2217 DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK); 2217 DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK);
2218 #undef DEBUG_BREAK 2218 #undef DEBUG_BREAK
2219 2219
2220 void BytecodeGraphBuilder::VisitIncBlockCounter() {
2221 DCHECK(FLAG_block_coverage);
2222
2223 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.
2224
2225 Node* slot = jsgraph()->Constant(bytecode_iterator().GetImmediateOperand(0));
2226 Node* vector = jsgraph()->Constant(feedback_vector());
2227
2228 const Operator* op = javascript()->CallRuntime(Runtime::kIncBlockCounter);
2229
2230 Node* node = NewNode(op, vector, slot);
2231 environment()->RecordAfterState(node, Environment::kAttachFrameState);
2232 }
2233
2220 void BytecodeGraphBuilder::VisitForInPrepare() { 2234 void BytecodeGraphBuilder::VisitForInPrepare() {
2221 PrepareEagerCheckpoint(); 2235 PrepareEagerCheckpoint();
2222 Node* receiver = 2236 Node* receiver =
2223 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); 2237 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
2224 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver); 2238 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver);
2225 environment()->BindRegistersToProjections( 2239 environment()->BindRegistersToProjections(
2226 bytecode_iterator().GetRegisterOperand(1), prepare, 2240 bytecode_iterator().GetRegisterOperand(1), prepare,
2227 Environment::kAttachFrameState); 2241 Environment::kAttachFrameState);
2228 } 2242 }
2229 2243
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 it->source_position().ScriptOffset(), start_position_.InliningId())); 2840 it->source_position().ScriptOffset(), start_position_.InliningId()));
2827 it->Advance(); 2841 it->Advance();
2828 } else { 2842 } else {
2829 DCHECK_GT(it->code_offset(), offset); 2843 DCHECK_GT(it->code_offset(), offset);
2830 } 2844 }
2831 } 2845 }
2832 2846
2833 } // namespace compiler 2847 } // namespace compiler
2834 } // namespace internal 2848 } // namespace internal
2835 } // namespace v8 2849 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698