提交 9cf820b5 编写于 作者: T thartmann

8044538: assert(which != imm_operand) failed: instruction is not a movq reg, imm64

Summary: Fixed internal_word_Relocation::target() to not retrieve target address from code if relocation points into the constant section. Added test.
Reviewed-by: kvn
上级 b6e19391
......@@ -877,11 +877,7 @@ address external_word_Relocation::target() {
void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
address target = _target;
if (target == NULL) {
if (addr_in_const()) {
target = new_addr_for(*(address*)addr(), src, dest);
} else {
target = new_addr_for(pd_get_address_from_code(), src, dest);
}
target = new_addr_for(this->target(), src, dest);
}
set_value(target);
}
......@@ -890,8 +886,12 @@ void internal_word_Relocation::fix_relocation_after_move(const CodeBuffer* src,
address internal_word_Relocation::target() {
address target = _target;
if (target == NULL) {
if (addr_in_const()) {
target = *(address*)addr();
} else {
target = pd_get_address_from_code();
}
}
return target;
}
......
/*
* Copyright (c) 2014, 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 8044538
* @summary assert hit while printing relocations for jump table entries
* @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -Xcomp -XX:+PrintRelocations TestPrintRelocations
*/
/**
* The test compiles all methods (-Xcomp) and prints their relocation
* entries (-XX:+PrintRelocations) to make sure the printing works.
*/
public class TestPrintRelocations {
static public void main(String[] args) { }
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册