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

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Address comments Created 3 years, 6 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
« no previous file with comments | « src/compiler.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 Node* call = NewNode(javascript()->Debugger()); 2217 Node* call = NewNode(javascript()->Debugger());
2218 environment()->RecordAfterState(call, Environment::kAttachFrameState); 2218 environment()->RecordAfterState(call, Environment::kAttachFrameState);
2219 } 2219 }
2220 2220
2221 // We cannot create a graph from the debugger copy of the bytecode array. 2221 // We cannot create a graph from the debugger copy of the bytecode array.
2222 #define DEBUG_BREAK(Name, ...) \ 2222 #define DEBUG_BREAK(Name, ...) \
2223 void BytecodeGraphBuilder::Visit##Name() { UNREACHABLE(); } 2223 void BytecodeGraphBuilder::Visit##Name() { UNREACHABLE(); }
2224 DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK); 2224 DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK);
2225 #undef DEBUG_BREAK 2225 #undef DEBUG_BREAK
2226 2226
2227 void BytecodeGraphBuilder::VisitIncBlockCounter() {
2228 DCHECK(FLAG_block_coverage);
2229
2230 Node* closure = GetFunctionClosure();
2231 Node* coverage_array_slot =
2232 jsgraph()->Constant(bytecode_iterator().GetIndexOperand(0));
2233
2234 const Operator* op = javascript()->CallRuntime(Runtime::kIncBlockCounter);
2235
2236 NewNode(op, closure, coverage_array_slot);
2237 }
2238
2227 void BytecodeGraphBuilder::VisitForInPrepare() { 2239 void BytecodeGraphBuilder::VisitForInPrepare() {
2228 PrepareEagerCheckpoint(); 2240 PrepareEagerCheckpoint();
2229 Node* receiver = 2241 Node* receiver =
2230 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); 2242 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
2231 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver); 2243 Node* prepare = NewNode(javascript()->ForInPrepare(), receiver);
2232 environment()->BindRegistersToProjections( 2244 environment()->BindRegistersToProjections(
2233 bytecode_iterator().GetRegisterOperand(1), prepare, 2245 bytecode_iterator().GetRegisterOperand(1), prepare,
2234 Environment::kAttachFrameState); 2246 Environment::kAttachFrameState);
2235 } 2247 }
2236 2248
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2831 it->source_position().ScriptOffset(), start_position_.InliningId())); 2843 it->source_position().ScriptOffset(), start_position_.InliningId()));
2832 it->Advance(); 2844 it->Advance();
2833 } else { 2845 } else {
2834 DCHECK_GT(it->code_offset(), offset); 2846 DCHECK_GT(it->code_offset(), offset);
2835 } 2847 }
2836 } 2848 }
2837 2849
2838 } // namespace compiler 2850 } // namespace compiler
2839 } // namespace internal 2851 } // namespace internal
2840 } // namespace v8 2852 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698