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

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

Issue 2707873002: Collect type profile for DevTools. (Closed)
Patch Set: Delete unused var Created 3 years, 9 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-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 scorecard[Bytecodes::ToByte(Bytecode::kSubSmi)] = 1; 433 scorecard[Bytecodes::ToByte(Bytecode::kSubSmi)] = 1;
434 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseAndSmi)] = 1; 434 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseAndSmi)] = 1;
435 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseOrSmi)] = 1; 435 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseOrSmi)] = 1;
436 scorecard[Bytecodes::ToByte(Bytecode::kShiftLeftSmi)] = 1; 436 scorecard[Bytecodes::ToByte(Bytecode::kShiftLeftSmi)] = 1;
437 scorecard[Bytecodes::ToByte(Bytecode::kShiftRightSmi)] = 1; 437 scorecard[Bytecodes::ToByte(Bytecode::kShiftRightSmi)] = 1;
438 scorecard[Bytecodes::ToByte(Bytecode::kTestUndetectable)] = 1; 438 scorecard[Bytecodes::ToByte(Bytecode::kTestUndetectable)] = 1;
439 scorecard[Bytecodes::ToByte(Bytecode::kTestUndefined)] = 1; 439 scorecard[Bytecodes::ToByte(Bytecode::kTestUndefined)] = 1;
440 scorecard[Bytecodes::ToByte(Bytecode::kTestNull)] = 1; 440 scorecard[Bytecodes::ToByte(Bytecode::kTestNull)] = 1;
441 } 441 }
442 442
443 if (!FLAG_type_profile) {
444 // Bytecode for CollectTypeProfile is only emitted when
445 // Type Information for DevTools is turned on.
446 scorecard[Bytecodes::ToByte(Bytecode::kCollectTypeProfile)] = 1;
447 }
448
443 // Check return occurs at the end and only once in the BytecodeArray. 449 // Check return occurs at the end and only once in the BytecodeArray.
444 CHECK_EQ(final_bytecode, Bytecode::kReturn); 450 CHECK_EQ(final_bytecode, Bytecode::kReturn);
445 CHECK_EQ(scorecard[Bytecodes::ToByte(final_bytecode)], 1); 451 CHECK_EQ(scorecard[Bytecodes::ToByte(final_bytecode)], 1);
446 452
447 #define CHECK_BYTECODE_PRESENT(Name, ...) \ 453 #define CHECK_BYTECODE_PRESENT(Name, ...) \
448 /* Check Bytecode is marked in scorecard, unless it's a debug break */ \ 454 /* Check Bytecode is marked in scorecard, unless it's a debug break */ \
449 if (!Bytecodes::IsDebugBreak(Bytecode::k##Name)) { \ 455 if (!Bytecodes::IsDebugBreak(Bytecode::k##Name)) { \
450 CHECK_GE(scorecard[Bytecodes::ToByte(Bytecode::k##Name)], 1); \ 456 CHECK_GE(scorecard[Bytecodes::ToByte(Bytecode::k##Name)], 1); \
451 } 457 }
452 BYTECODE_LIST(CHECK_BYTECODE_PRESENT) 458 BYTECODE_LIST(CHECK_BYTECODE_PRESENT)
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 iterator.Advance(); 781 iterator.Advance();
776 } 782 }
777 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 783 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
778 iterator.Advance(); 784 iterator.Advance();
779 CHECK(iterator.done()); 785 CHECK(iterator.done());
780 } 786 }
781 787
782 } // namespace interpreter 788 } // namespace interpreter
783 } // namespace internal 789 } // namespace internal
784 } // namespace v8 790 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698