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 case Bytecode::kToNumber: | |
591 case Bytecode::kCreateRegExpLiteral: | |
592 case Bytecode::kCreateArrayLiteral: | |
593 case Bytecode::kCreateObjectLiteral: | |
594 case Bytecode::kCreateMappedArguments: | |
595 case Bytecode::kCreateUnmappedArguments: | |
596 case Bytecode::kForInPrepare: | |
klaasb
2016/07/18 19:45:46
This one doesn't write the accumulator, but in all
rmcilroy
2016/07/19 10:03:55
As discussed offline, let's remove the ones which
| |
597 case Bytecode::kForInStep: | |
598 case Bytecode::kResumeGenerator: | |
599 return true; | |
600 default: | |
601 return false; | |
602 } | |
603 } | |
604 return false; | |
605 } | |
606 | |
607 // static | |
572 int Bytecodes::GetNumberOfRegistersRepresentedBy(OperandType operand_type) { | 608 int Bytecodes::GetNumberOfRegistersRepresentedBy(OperandType operand_type) { |
573 switch (operand_type) { | 609 switch (operand_type) { |
574 case OperandType::kMaybeReg: | 610 case OperandType::kMaybeReg: |
575 case OperandType::kReg: | 611 case OperandType::kReg: |
576 case OperandType::kRegOut: | 612 case OperandType::kRegOut: |
577 return 1; | 613 return 1; |
578 case OperandType::kRegPair: | 614 case OperandType::kRegPair: |
579 case OperandType::kRegOutPair: | 615 case OperandType::kRegOutPair: |
580 return 2; | 616 return 2; |
581 case OperandType::kRegOutTriple: | 617 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 && | 981 if (!FLAG_always_opt && !FLAG_prepare_always_opt && |
946 pretenure == NOT_TENURED && is_function_scope) { | 982 pretenure == NOT_TENURED && is_function_scope) { |
947 result |= FastNewClosureBit::encode(true); | 983 result |= FastNewClosureBit::encode(true); |
948 } | 984 } |
949 return result; | 985 return result; |
950 } | 986 } |
951 | 987 |
952 } // namespace interpreter | 988 } // namespace interpreter |
953 } // namespace internal | 989 } // namespace internal |
954 } // namespace v8 | 990 } // namespace v8 |
OLD | NEW |