mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-06 14:10:36 +00:00
6579789: Internal error "c1_LinearScan.cpp:1429 Error: assert(false,"")" in debuggee with fastdebug VM
Reviewed-by: kvn, iveresov
This commit is contained in:
parent
b80ad03e3f
commit
ecddc15f7c
@ -90,6 +90,7 @@ LinearScan::LinearScan(IR* ir, LIRGenerator* gen, FrameMap* frame_map)
|
||||
, _intervals(0) // initialized later with correct length
|
||||
, _new_intervals_from_allocation(new IntervalList())
|
||||
, _sorted_intervals(NULL)
|
||||
, _needs_full_resort(false)
|
||||
, _lir_ops(0) // initialized later with correct length
|
||||
, _block_of_op(0) // initialized later with correct length
|
||||
, _has_info(0)
|
||||
@ -1520,6 +1521,14 @@ void LinearScan::create_unhandled_lists(Interval** list1, Interval** list2, bool
|
||||
void LinearScan::sort_intervals_before_allocation() {
|
||||
TIME_LINEAR_SCAN(timer_sort_intervals_before);
|
||||
|
||||
if (_needs_full_resort) {
|
||||
// There is no known reason why this should occur but just in case...
|
||||
assert(false, "should never occur");
|
||||
// Re-sort existing interval list because an Interval::from() has changed
|
||||
_sorted_intervals->sort(interval_cmp);
|
||||
_needs_full_resort = false;
|
||||
}
|
||||
|
||||
IntervalList* unsorted_list = &_intervals;
|
||||
int unsorted_len = unsorted_list->length();
|
||||
int sorted_len = 0;
|
||||
@ -1559,11 +1568,18 @@ void LinearScan::sort_intervals_before_allocation() {
|
||||
}
|
||||
}
|
||||
_sorted_intervals = sorted_list;
|
||||
assert(is_sorted(_sorted_intervals), "intervals unsorted");
|
||||
}
|
||||
|
||||
void LinearScan::sort_intervals_after_allocation() {
|
||||
TIME_LINEAR_SCAN(timer_sort_intervals_after);
|
||||
|
||||
if (_needs_full_resort) {
|
||||
// Re-sort existing interval list because an Interval::from() has changed
|
||||
_sorted_intervals->sort(interval_cmp);
|
||||
_needs_full_resort = false;
|
||||
}
|
||||
|
||||
IntervalArray* old_list = _sorted_intervals;
|
||||
IntervalList* new_list = _new_intervals_from_allocation;
|
||||
int old_len = old_list->length();
|
||||
@ -1571,6 +1587,7 @@ void LinearScan::sort_intervals_after_allocation() {
|
||||
|
||||
if (new_len == 0) {
|
||||
// no intervals have been added during allocation, so sorted list is already up to date
|
||||
assert(is_sorted(_sorted_intervals), "intervals unsorted");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1593,6 +1610,7 @@ void LinearScan::sort_intervals_after_allocation() {
|
||||
}
|
||||
|
||||
_sorted_intervals = combined_list;
|
||||
assert(is_sorted(_sorted_intervals), "intervals unsorted");
|
||||
}
|
||||
|
||||
|
||||
@ -1825,6 +1843,8 @@ void LinearScan::resolve_exception_entry(BlockBegin* block, int reg_num, MoveRes
|
||||
interval = interval->split(from_op_id);
|
||||
interval->assign_reg(reg, regHi);
|
||||
append_interval(interval);
|
||||
} else {
|
||||
_needs_full_resort = true;
|
||||
}
|
||||
assert(interval->from() == from_op_id, "must be true now");
|
||||
|
||||
@ -4492,7 +4512,8 @@ void Interval::print(outputStream* out) const {
|
||||
}
|
||||
} else {
|
||||
type_name = type2name(type());
|
||||
if (assigned_reg() != -1) {
|
||||
if (assigned_reg() != -1 &&
|
||||
(LinearScan::num_physical_regs(type()) == 1 || assigned_regHi() != -1)) {
|
||||
opr = LinearScan::calc_operand_for_interval(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,6 +148,7 @@ class LinearScan : public CompilationResourceObj {
|
||||
IntervalList _intervals; // mapping from register number to interval
|
||||
IntervalList* _new_intervals_from_allocation; // list with all intervals created during allocation when an existing interval is split
|
||||
IntervalArray* _sorted_intervals; // intervals sorted by Interval::from()
|
||||
bool _needs_full_resort; // set to true if an Interval::from() is changed and _sorted_intervals must be resorted
|
||||
|
||||
LIR_OpArray _lir_ops; // mapping from LIR_Op id to LIR_Op node
|
||||
BlockBeginArray _block_of_op; // mapping from LIR_Op id to the BlockBegin containing this instruction
|
||||
|
||||
49
hotspot/test/compiler/6579789/Test6579789.java
Normal file
49
hotspot/test/compiler/6579789/Test6579789.java
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 6579789
|
||||
* @summary Internal error "c1_LinearScan.cpp:1429 Error: assert(false,"")" in debuggee with fastdebug VM
|
||||
* @run main/othervm -Xcomp -XX:UseSSE=0 -XX:CompileOnly=Test6579789.bug Test6579789
|
||||
*/
|
||||
|
||||
public class Test6579789 {
|
||||
public static void main(String[] args) {
|
||||
bug(4);
|
||||
}
|
||||
public static void bug(int n) {
|
||||
float f = 1;
|
||||
int i = 1;
|
||||
try {
|
||||
int x = 1 / n; // instruction that can trap
|
||||
f = 2;
|
||||
i = 2;
|
||||
int y = 2 / n; // instruction that can trap
|
||||
} catch (Exception ex) {
|
||||
f++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user