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/bytecode-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace interpreter { | 9 namespace interpreter { |
10 | 10 |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 case OperandType::kImm8: | 960 case OperandType::kImm8: |
961 case OperandType::kIdx8: | 961 case OperandType::kIdx8: |
962 return static_cast<uint8_t>(operand_value) == operand_value; | 962 return static_cast<uint8_t>(operand_value) == operand_value; |
963 case OperandType::kMaybeReg8: | 963 case OperandType::kMaybeReg8: |
964 if (operand_value == 0) { | 964 if (operand_value == 0) { |
965 return true; | 965 return true; |
966 } | 966 } |
967 // Fall-through to kReg8 case. | 967 // Fall-through to kReg8 case. |
968 case OperandType::kReg8: { | 968 case OperandType::kReg8: { |
969 Register reg = Register::FromOperand(static_cast<uint8_t>(operand_value)); | 969 Register reg = Register::FromOperand(static_cast<uint8_t>(operand_value)); |
970 if (reg.is_function_context() || reg.is_function_closure()) { | 970 if (reg.is_function_context() || reg.is_function_closure() || |
| 971 reg.is_new_target()) { |
971 return true; | 972 return true; |
972 } else if (reg.is_parameter()) { | 973 } else if (reg.is_parameter()) { |
973 int parameter_index = reg.ToParameterIndex(parameter_count_); | 974 int parameter_index = reg.ToParameterIndex(parameter_count_); |
974 return parameter_index >= 0 && parameter_index < parameter_count_; | 975 return parameter_index >= 0 && parameter_index < parameter_count_; |
975 } else if (reg.index() < fixed_register_count()) { | 976 } else if (reg.index() < fixed_register_count()) { |
976 return true; | 977 return true; |
977 } else { | 978 } else { |
978 return TemporaryRegisterIsLive(reg); | 979 return TemporaryRegisterIsLive(reg); |
979 } | 980 } |
980 } | 981 } |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 DCHECK_GT(next_consecutive_count_, 0); | 1331 DCHECK_GT(next_consecutive_count_, 0); |
1331 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); | 1332 builder_->BorrowConsecutiveTemporaryRegister(next_consecutive_register_); |
1332 allocated_.push_back(next_consecutive_register_); | 1333 allocated_.push_back(next_consecutive_register_); |
1333 next_consecutive_count_--; | 1334 next_consecutive_count_--; |
1334 return Register(next_consecutive_register_++); | 1335 return Register(next_consecutive_register_++); |
1335 } | 1336 } |
1336 | 1337 |
1337 } // namespace interpreter | 1338 } // namespace interpreter |
1338 } // namespace internal | 1339 } // namespace internal |
1339 } // namespace v8 | 1340 } // namespace v8 |
OLD | NEW |