|
1 | 1 | /* |
2 | | - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
@@ -205,9 +205,11 @@ void LIRItem::set_result(LIR_Opr opr) { |
205 | 205 | assert(value()->operand()->is_illegal() || value()->operand()->is_constant(), "operand should never change"); |
206 | 206 | value()->set_operand(opr); |
207 | 207 |
|
| 208 | +#ifdef ASSERT |
208 | 209 | if (opr->is_virtual()) { |
209 | 210 | _gen->_instruction_for_operand.at_put_grow(opr->vreg_number(), value(), nullptr); |
210 | 211 | } |
| 212 | +#endif |
211 | 213 |
|
212 | 214 | _result = opr; |
213 | 215 | } |
@@ -1494,28 +1496,22 @@ LIR_Opr LIRGenerator::operand_for_instruction(Instruction* x) { |
1494 | 1496 | assert(x->as_Phi() || x->as_Local() != nullptr, "only for Phi and Local"); |
1495 | 1497 | // allocate a virtual register for this local or phi |
1496 | 1498 | x->set_operand(rlock(x)); |
| 1499 | +#ifdef ASSERT |
1497 | 1500 | _instruction_for_operand.at_put_grow(x->operand()->vreg_number(), x, nullptr); |
| 1501 | +#endif |
1498 | 1502 | } |
1499 | 1503 | } |
1500 | 1504 | return x->operand(); |
1501 | 1505 | } |
1502 | 1506 |
|
1503 | | - |
1504 | | -Instruction* LIRGenerator::instruction_for_opr(LIR_Opr opr) { |
1505 | | - if (opr->is_virtual()) { |
1506 | | - return instruction_for_vreg(opr->vreg_number()); |
1507 | | - } |
1508 | | - return nullptr; |
1509 | | -} |
1510 | | - |
1511 | | - |
| 1507 | +#ifdef ASSERT |
1512 | 1508 | Instruction* LIRGenerator::instruction_for_vreg(int reg_num) { |
1513 | 1509 | if (reg_num < _instruction_for_operand.length()) { |
1514 | 1510 | return _instruction_for_operand.at(reg_num); |
1515 | 1511 | } |
1516 | 1512 | return nullptr; |
1517 | 1513 | } |
1518 | | - |
| 1514 | +#endif |
1519 | 1515 |
|
1520 | 1516 | void LIRGenerator::set_vreg_flag(int vreg_num, VregFlag f) { |
1521 | 1517 | if (_vreg_flags.size_in_bits() == 0) { |
@@ -2660,7 +2656,9 @@ void LIRGenerator::do_Base(Base* x) { |
2660 | 2656 | assert(as_ValueType(t)->tag() == local->type()->tag(), "check"); |
2661 | 2657 | #endif // __SOFTFP__ |
2662 | 2658 | local->set_operand(dest); |
| 2659 | +#ifdef ASSERT |
2663 | 2660 | _instruction_for_operand.at_put_grow(dest->vreg_number(), local, nullptr); |
| 2661 | +#endif |
2664 | 2662 | java_index += type2size[t]; |
2665 | 2663 | } |
2666 | 2664 |
|
|
0 commit comments