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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 2882973002: [coverage] Block coverage with support for IfStatements (Closed)
Patch Set: Remove coverage infos 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
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/interpreter/bytecode-array-builder.h" 8 #include "src/interpreter/bytecode-array-builder.h"
9 #include "src/interpreter/bytecode-array-iterator.h" 9 #include "src/interpreter/bytecode-array-iterator.h"
10 #include "src/interpreter/bytecode-jump-table.h" 10 #include "src/interpreter/bytecode-jump-table.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 builder.CallRuntime(Runtime::kInlineIsArray, reg_list); 364 builder.CallRuntime(Runtime::kInlineIsArray, reg_list);
365 365
366 // Emit debugger bytecode. 366 // Emit debugger bytecode.
367 builder.Debugger(); 367 builder.Debugger();
368 368
369 // Insert dummy ops to force longer jumps. 369 // Insert dummy ops to force longer jumps.
370 for (int i = 0; i < 256; i++) { 370 for (int i = 0; i < 256; i++) {
371 builder.Debugger(); 371 builder.Debugger();
372 } 372 }
373 373
374 // Emit block counter increments.
375 FLAG_block_coverage = true; // Satisfy DCHECKs.
rmcilroy 2017/06/01 14:01:50 This will unconditionally set the flag for all fol
jgruber 2017/06/02 06:39:27 Done.
376 builder.IncBlockCounter(0);
377
374 // Bind labels for long jumps at the very end. 378 // Bind labels for long jumps at the very end.
375 for (size_t i = 0; i < arraysize(end); i++) { 379 for (size_t i = 0; i < arraysize(end); i++) {
376 builder.Bind(&end[i]); 380 builder.Bind(&end[i]);
377 } 381 }
378 382
379 // Return must be the last instruction. 383 // Return must be the last instruction.
380 builder.Return(); 384 builder.Return();
381 385
382 // Generate BytecodeArray. 386 // Generate BytecodeArray.
383 scope.SetScriptScopeInfo(factory->NewScopeInfo(1)); 387 scope.SetScriptScopeInfo(factory->NewScopeInfo(1));
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 iterator.Advance(); 832 iterator.Advance();
829 } 833 }
830 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 834 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
831 iterator.Advance(); 835 iterator.Advance();
832 CHECK(iterator.done()); 836 CHECK(iterator.done());
833 } 837 }
834 838
835 } // namespace interpreter 839 } // namespace interpreter
836 } // namespace internal 840 } // namespace internal
837 } // namespace v8 841 } // namespace v8
OLDNEW
« src/interpreter/bytecodes.h ('K') | « test/mjsunit/code-coverage-block.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698