提交 5c67167d 编写于 作者: A asaha

Merge

......@@ -418,6 +418,10 @@ d45454002494d147c0761e6b37d8a73064f3cf92 hs25-b68
35038da7bb9ddd367a0a6bf926dfb281aee1d554 jdk8-b127
874c0b4a946c362bbf20d37c2a564b39093152e6 jdk8-b128
cb39165c4a65bbff8db356df411e762f9e5423b8 jdk8-b129
1dbaf664a611e5d9cab6d1be42537b67d0d05f94 jdk8-b130
b5e7ebfe185cb4c2eeb8a919025fc6a26be2fcef jdk8-b131
9f9179e8f0cfe74c08f3716cf3c38e21e1de4c4a hs25-b70
0c94c41dcd70e9a9b4d96e31275afd5a73daa72d jdk8-b132
4a35ef38e2a7bc64df20c7700ba69b37e3ddb8b5 jdk8u5-b01
e5561d89fe8bfc79cd6c8fcc36d270cc6a49ec6e jdk8u5-b02
2f9eb9fcab6c42c8c84ddb44170ea33235116d84 jdk8u5-b03
......@@ -429,3 +433,5 @@ b90de55aca30678ab0fec05d6a61bb3468b783d2 jdk8u5-b05
21c1dfbed277791071947eed1c93806ccf48a7d8 jdk8u5-b08
6af9ce1c56a6545ec6c992a5f61b2eec924be040 jdk8u5-b09
629267e4f0b5155608edcd71922983be98786bd7 jdk8u5-b10
17a75e692af397532e2b296b24f6b9b6c239c633 jdk8u5-b11
9b289963cb9a14636fbe8faaa2dd6d3678464a7b jdk8u5-b12
......@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2014
HS_MAJOR_VER=25
HS_MINOR_VER=5
HS_BUILD_NUMBER=01
HS_BUILD_NUMBER=02
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
......
......@@ -724,6 +724,11 @@ ciMethod* ciMethod::find_monomorphic_target(ciInstanceKlass* caller,
VM_ENTRY_MARK;
// Disable CHA for default methods for now
if (root_m->get_Method()->is_default_method()) {
return NULL;
}
methodHandle target;
{
MutexLocker locker(Compile_lock);
......
......@@ -344,6 +344,11 @@ void Compile::shorten_branches(uint* blk_starts, int& code_size, int& reloc_size
uint* jmp_offset = NEW_RESOURCE_ARRAY(uint,nblocks);
uint* jmp_size = NEW_RESOURCE_ARRAY(uint,nblocks);
int* jmp_nidx = NEW_RESOURCE_ARRAY(int ,nblocks);
// Collect worst case block paddings
int* block_worst_case_pad = NEW_RESOURCE_ARRAY(int, nblocks);
memset(block_worst_case_pad, 0, nblocks * sizeof(int));
DEBUG_ONLY( uint *jmp_target = NEW_RESOURCE_ARRAY(uint,nblocks); )
DEBUG_ONLY( uint *jmp_rule = NEW_RESOURCE_ARRAY(uint,nblocks); )
......@@ -460,6 +465,7 @@ void Compile::shorten_branches(uint* blk_starts, int& code_size, int& reloc_size
last_avoid_back_to_back_adr += max_loop_pad;
}
blk_size += max_loop_pad;
block_worst_case_pad[i + 1] = max_loop_pad;
}
}
......@@ -499,9 +505,16 @@ void Compile::shorten_branches(uint* blk_starts, int& code_size, int& reloc_size
if (bnum > i) { // adjust following block's offset
offset -= adjust_block_start;
}
// This block can be a loop header, account for the padding
// in the previous block.
int block_padding = block_worst_case_pad[i];
assert(i == 0 || block_padding == 0 || br_offs >= block_padding, "Should have at least a padding on top");
// In the following code a nop could be inserted before
// the branch which will increase the backward distance.
bool needs_padding = ((uint)br_offs == last_may_be_short_branch_adr);
bool needs_padding = ((uint)(br_offs - block_padding) == last_may_be_short_branch_adr);
assert(!needs_padding || jmp_offset[i] == 0, "padding only branches at the beginning of block");
if (needs_padding && offset <= 0)
offset -= nop_size;
......
/*
* 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 8036100
* @summary Default method returns true for a while, and then returns false
* @run main/othervm -Xcomp -XX:CompileOnly=InlineDefaultMethod1::test
* -XX:CompileOnly=I1::m -XX:CompileOnly=I2::m
* InlineDefaultMethod1
*/
interface I1 {
default public int m() { return 0; }
}
interface I2 extends I1 {
default public int m() { return 1; }
}
abstract class A implements I1 {
}
class B extends A implements I2 {
}
public class InlineDefaultMethod1 {
public static void test(A obj) {
int id = obj.m();
if (id != 1) {
throw new AssertionError("Called wrong method: 1 != "+id);
}
}
public static void main(String[] args) throws InterruptedException {
test(new B());
System.out.println("TEST PASSED");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册