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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.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 | « test/mjsunit/code-coverage-block.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 builder.IncBlockCounter(0);
376
374 // Bind labels for long jumps at the very end. 377 // Bind labels for long jumps at the very end.
375 for (size_t i = 0; i < arraysize(end); i++) { 378 for (size_t i = 0; i < arraysize(end); i++) {
376 builder.Bind(&end[i]); 379 builder.Bind(&end[i]);
377 } 380 }
378 381
379 // Return must be the last instruction. 382 // Return must be the last instruction.
380 builder.Return(); 383 builder.Return();
381 384
382 // Generate BytecodeArray. 385 // Generate BytecodeArray.
383 scope.SetScriptScopeInfo(factory->NewScopeInfo(1)); 386 scope.SetScriptScopeInfo(factory->NewScopeInfo(1));
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 iterator.Advance(); 831 iterator.Advance();
829 } 832 }
830 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 833 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
831 iterator.Advance(); 834 iterator.Advance();
832 CHECK(iterator.done()); 835 CHECK(iterator.done());
833 } 836 }
834 837
835 } // namespace interpreter 838 } // namespace interpreter
836 } // namespace internal 839 } // namespace internal
837 } // namespace v8 840 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/code-coverage-block.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698