| OLD | NEW |
| 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/interpreter/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 case OperandType::k##Name: \ | 562 case OperandType::k##Name: \ |
| 563 break; | 563 break; |
| 564 NON_REGISTER_OPERAND_TYPE_LIST(CASE) | 564 NON_REGISTER_OPERAND_TYPE_LIST(CASE) |
| 565 REGISTER_INPUT_OPERAND_TYPE_LIST(CASE) | 565 REGISTER_INPUT_OPERAND_TYPE_LIST(CASE) |
| 566 #undef CASE | 566 #undef CASE |
| 567 } | 567 } |
| 568 return false; | 568 return false; |
| 569 } | 569 } |
| 570 | 570 |
| 571 // static | 571 // static |
| 572 bool Bytecodes::IsStarLookahead(Bytecode bytecode, OperandScale operand_scale) { |
| 573 if (operand_scale == OperandScale::kSingle) { |
| 574 switch (bytecode) { |
| 575 case Bytecode::kLdaZero: |
| 576 case Bytecode::kLdaSmi: |
| 577 case Bytecode::kLdaNull: |
| 578 case Bytecode::kLdaTheHole: |
| 579 case Bytecode::kLdaConstant: |
| 580 case Bytecode::kAdd: |
| 581 case Bytecode::kSub: |
| 582 case Bytecode::kMul: |
| 583 case Bytecode::kAddSmi: |
| 584 case Bytecode::kSubSmi: |
| 585 case Bytecode::kInc: |
| 586 case Bytecode::kDec: |
| 587 case Bytecode::kTypeOf: |
| 588 case Bytecode::kCall: |
| 589 case Bytecode::kNew: |
| 590 return true; |
| 591 default: |
| 592 return false; |
| 593 } |
| 594 } |
| 595 return false; |
| 596 } |
| 597 |
| 598 // static |
| 572 int Bytecodes::GetNumberOfRegistersRepresentedBy(OperandType operand_type) { | 599 int Bytecodes::GetNumberOfRegistersRepresentedBy(OperandType operand_type) { |
| 573 switch (operand_type) { | 600 switch (operand_type) { |
| 574 case OperandType::kMaybeReg: | 601 case OperandType::kMaybeReg: |
| 575 case OperandType::kReg: | 602 case OperandType::kReg: |
| 576 case OperandType::kRegOut: | 603 case OperandType::kRegOut: |
| 577 return 1; | 604 return 1; |
| 578 case OperandType::kRegPair: | 605 case OperandType::kRegPair: |
| 579 case OperandType::kRegOutPair: | 606 case OperandType::kRegOutPair: |
| 580 return 2; | 607 return 2; |
| 581 case OperandType::kRegOutTriple: | 608 case OperandType::kRegOutTriple: |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 if (!FLAG_always_opt && !FLAG_prepare_always_opt && | 972 if (!FLAG_always_opt && !FLAG_prepare_always_opt && |
| 946 pretenure == NOT_TENURED && is_function_scope) { | 973 pretenure == NOT_TENURED && is_function_scope) { |
| 947 result |= FastNewClosureBit::encode(true); | 974 result |= FastNewClosureBit::encode(true); |
| 948 } | 975 } |
| 949 return result; | 976 return result; |
| 950 } | 977 } |
| 951 | 978 |
| 952 } // namespace interpreter | 979 } // namespace interpreter |
| 953 } // namespace internal | 980 } // namespace internal |
| 954 } // namespace v8 | 981 } // namespace v8 |
| OLD | NEW |