OLD | NEW |
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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 scorecard[Bytecodes::ToByte(Bytecode::kSubSmi)] = 1; | 440 scorecard[Bytecodes::ToByte(Bytecode::kSubSmi)] = 1; |
441 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseAndSmi)] = 1; | 441 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseAndSmi)] = 1; |
442 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseOrSmi)] = 1; | 442 scorecard[Bytecodes::ToByte(Bytecode::kBitwiseOrSmi)] = 1; |
443 scorecard[Bytecodes::ToByte(Bytecode::kShiftLeftSmi)] = 1; | 443 scorecard[Bytecodes::ToByte(Bytecode::kShiftLeftSmi)] = 1; |
444 scorecard[Bytecodes::ToByte(Bytecode::kShiftRightSmi)] = 1; | 444 scorecard[Bytecodes::ToByte(Bytecode::kShiftRightSmi)] = 1; |
445 scorecard[Bytecodes::ToByte(Bytecode::kTestUndetectable)] = 1; | 445 scorecard[Bytecodes::ToByte(Bytecode::kTestUndetectable)] = 1; |
446 scorecard[Bytecodes::ToByte(Bytecode::kTestUndefined)] = 1; | 446 scorecard[Bytecodes::ToByte(Bytecode::kTestUndefined)] = 1; |
447 scorecard[Bytecodes::ToByte(Bytecode::kTestNull)] = 1; | 447 scorecard[Bytecodes::ToByte(Bytecode::kTestNull)] = 1; |
448 } | 448 } |
449 | 449 |
450 if (!FLAG_type_profile) { | |
451 // Bytecode for CollectTypeProfile is only emitted when | |
452 // Type Information for DevTools is turned on. | |
453 scorecard[Bytecodes::ToByte(Bytecode::kCollectTypeProfile)] = 1; | |
454 } | |
455 | |
456 // Check return occurs at the end and only once in the BytecodeArray. | 450 // Check return occurs at the end and only once in the BytecodeArray. |
457 CHECK_EQ(final_bytecode, Bytecode::kReturn); | 451 CHECK_EQ(final_bytecode, Bytecode::kReturn); |
458 CHECK_EQ(scorecard[Bytecodes::ToByte(final_bytecode)], 1); | 452 CHECK_EQ(scorecard[Bytecodes::ToByte(final_bytecode)], 1); |
459 | 453 |
460 #define CHECK_BYTECODE_PRESENT(Name, ...) \ | 454 #define CHECK_BYTECODE_PRESENT(Name, ...) \ |
461 /* Check Bytecode is marked in scorecard, unless it's a debug break */ \ | 455 /* Check Bytecode is marked in scorecard, unless it's a debug break */ \ |
462 if (!Bytecodes::IsDebugBreak(Bytecode::k##Name)) { \ | 456 if (!Bytecodes::IsDebugBreak(Bytecode::k##Name)) { \ |
463 CHECK_GE(scorecard[Bytecodes::ToByte(Bytecode::k##Name)], 1); \ | 457 CHECK_GE(scorecard[Bytecodes::ToByte(Bytecode::k##Name)], 1); \ |
464 } | 458 } |
465 BYTECODE_LIST(CHECK_BYTECODE_PRESENT) | 459 BYTECODE_LIST(CHECK_BYTECODE_PRESENT) |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 iterator.Advance(); | 782 iterator.Advance(); |
789 } | 783 } |
790 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); | 784 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); |
791 iterator.Advance(); | 785 iterator.Advance(); |
792 CHECK(iterator.done()); | 786 CHECK(iterator.done()); |
793 } | 787 } |
794 | 788 |
795 } // namespace interpreter | 789 } // namespace interpreter |
796 } // namespace internal | 790 } // namespace internal |
797 } // namespace v8 | 791 } // namespace v8 |
OLD | NEW |