Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
b8a0e79b
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b8a0e79b
编写于
4月 29, 2010
作者:
J
jrose
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
9ab27780
d7df102a
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
516 addition
and
139 deletion
+516
-139
make/linux/makefiles/adlc.make
make/linux/makefiles/adlc.make
+4
-1
make/solaris/makefiles/adlc.make
make/solaris/makefiles/adlc.make
+4
-1
src/cpu/sparc/vm/assembler_sparc.hpp
src/cpu/sparc/vm/assembler_sparc.hpp
+0
-3
src/cpu/sparc/vm/sparc.ad
src/cpu/sparc/vm/sparc.ad
+121
-63
src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
+1
-7
src/cpu/x86/vm/x86_32.ad
src/cpu/x86/vm/x86_32.ad
+25
-1
src/cpu/x86/vm/x86_64.ad
src/cpu/x86/vm/x86_64.ad
+25
-1
src/share/vm/adlc/formssel.cpp
src/share/vm/adlc/formssel.cpp
+3
-1
src/share/vm/c1/c1_Compilation.cpp
src/share/vm/c1/c1_Compilation.cpp
+1
-3
src/share/vm/c1/c1_Compilation.hpp
src/share/vm/c1/c1_Compilation.hpp
+1
-4
src/share/vm/c1/c1_GraphBuilder.cpp
src/share/vm/c1/c1_GraphBuilder.cpp
+0
-1
src/share/vm/c1/c1_LinearScan.cpp
src/share/vm/c1/c1_LinearScan.cpp
+1
-4
src/share/vm/c1/c1_globals.hpp
src/share/vm/c1/c1_globals.hpp
+1
-4
src/share/vm/ci/bcEscapeAnalyzer.cpp
src/share/vm/ci/bcEscapeAnalyzer.cpp
+5
-2
src/share/vm/ci/ciEnv.cpp
src/share/vm/ci/ciEnv.cpp
+0
-3
src/share/vm/ci/ciEnv.hpp
src/share/vm/ci/ciEnv.hpp
+0
-2
src/share/vm/classfile/vmSymbols.hpp
src/share/vm/classfile/vmSymbols.hpp
+7
-1
src/share/vm/opto/c2compiler.cpp
src/share/vm/opto/c2compiler.cpp
+2
-3
src/share/vm/opto/classes.hpp
src/share/vm/opto/classes.hpp
+3
-1
src/share/vm/opto/compile.cpp
src/share/vm/opto/compile.cpp
+0
-1
src/share/vm/opto/compile.hpp
src/share/vm/opto/compile.hpp
+0
-2
src/share/vm/opto/graphKit.cpp
src/share/vm/opto/graphKit.cpp
+3
-8
src/share/vm/opto/library_call.cpp
src/share/vm/opto/library_call.cpp
+18
-4
src/share/vm/opto/subnode.hpp
src/share/vm/opto/subnode.hpp
+21
-1
src/share/vm/prims/jvmtiExport.cpp
src/share/vm/prims/jvmtiExport.cpp
+0
-1
src/share/vm/prims/jvmtiExport.hpp
src/share/vm/prims/jvmtiExport.hpp
+0
-3
src/share/vm/prims/jvmtiManageCapabilities.cpp
src/share/vm/prims/jvmtiManageCapabilities.cpp
+6
-13
test/compiler/6431242/Test.java
test/compiler/6431242/Test.java
+176
-0
test/compiler/6946040/TestCharShortByteSwap.java
test/compiler/6946040/TestCharShortByteSwap.java
+88
-0
未找到文件。
make/linux/makefiles/adlc.make
浏览文件 @
b8a0e79b
...
@@ -127,6 +127,9 @@ $(GENERATEDFILES): refresh_adfiles
...
@@ -127,6 +127,9 @@ $(GENERATEDFILES): refresh_adfiles
# Note that product files are updated via "mv", which is atomic.
# Note that product files are updated via "mv", which is atomic.
TEMPDIR
:=
$(OUTDIR)
/mktmp
$(
shell
echo
$$$$
)
TEMPDIR
:=
$(OUTDIR)
/mktmp
$(
shell
echo
$$$$
)
# Debuggable by default
CFLAGS
+=
-g
# Pass -D flags into ADLC.
# Pass -D flags into ADLC.
ADLCFLAGS
+=
$(SYSDEFS)
ADLCFLAGS
+=
$(SYSDEFS)
...
@@ -135,7 +138,7 @@ ADLCFLAGS += -q -T
...
@@ -135,7 +138,7 @@ ADLCFLAGS += -q -T
# Normally, debugging is done directly on the ad_<arch>*.cpp files.
# Normally, debugging is done directly on the ad_<arch>*.cpp files.
# But -g will put #line directives in those files pointing back to <arch>.ad.
# But -g will put #line directives in those files pointing back to <arch>.ad.
#
ADLCFLAGS += -g
ADLCFLAGS
+=
-g
ifdef
LP64
ifdef
LP64
ADLCFLAGS
+=
-D_LP64
ADLCFLAGS
+=
-D_LP64
...
...
make/solaris/makefiles/adlc.make
浏览文件 @
b8a0e79b
...
@@ -147,6 +147,9 @@ $(GENERATEDFILES): refresh_adfiles
...
@@ -147,6 +147,9 @@ $(GENERATEDFILES): refresh_adfiles
# Note that product files are updated via "mv", which is atomic.
# Note that product files are updated via "mv", which is atomic.
TEMPDIR
:=
$(OUTDIR)
/mktmp
$(
shell
echo
$$$$
)
TEMPDIR
:=
$(OUTDIR)
/mktmp
$(
shell
echo
$$$$
)
# Debuggable by default
CFLAGS
+=
-g
# Pass -D flags into ADLC.
# Pass -D flags into ADLC.
ADLCFLAGS
+=
$(SYSDEFS)
ADLCFLAGS
+=
$(SYSDEFS)
...
@@ -155,7 +158,7 @@ ADLCFLAGS += -q -T
...
@@ -155,7 +158,7 @@ ADLCFLAGS += -q -T
# Normally, debugging is done directly on the ad_<arch>*.cpp files.
# Normally, debugging is done directly on the ad_<arch>*.cpp files.
# But -g will put #line directives in those files pointing back to <arch>.ad.
# But -g will put #line directives in those files pointing back to <arch>.ad.
#
ADLCFLAGS += -g
ADLCFLAGS
+=
-g
ifdef
LP64
ifdef
LP64
ADLCFLAGS
+=
-D_LP64
ADLCFLAGS
+=
-D_LP64
...
...
src/cpu/sparc/vm/assembler_sparc.hpp
浏览文件 @
b8a0e79b
...
@@ -661,9 +661,6 @@ class Assembler : public AbstractAssembler {
...
@@ -661,9 +661,6 @@ class Assembler : public AbstractAssembler {
stx_op3
=
0x0e
,
stx_op3
=
0x0e
,
swap_op3
=
0x0f
,
swap_op3
=
0x0f
,
lduwa_op3
=
0x10
,
ldxa_op3
=
0x1b
,
stwa_op3
=
0x14
,
stwa_op3
=
0x14
,
stxa_op3
=
0x1e
,
stxa_op3
=
0x1e
,
...
...
src/cpu/sparc/vm/sparc.ad
浏览文件 @
b8a0e79b
...
@@ -923,38 +923,6 @@ void emit_form3_mem_reg(CodeBuffer &cbuf, const MachNode* n, int primary, int te
...
@@ -923,38 +923,6 @@ void emit_form3_mem_reg(CodeBuffer &cbuf, const MachNode* n, int primary, int te
#endif
#endif
}
}
void emit_form3_mem_reg_asi(CodeBuffer &cbuf, const MachNode* n, int primary, int tertiary,
int src1_enc, int disp32, int src2_enc, int dst_enc, int asi) {
uint instr;
instr = (Assembler::ldst_op << 30)
| (dst_enc << 25)
| (primary << 19)
| (src1_enc << 14);
int disp = disp32;
int index = src2_enc;
if (src1_enc == R_SP_enc || src1_enc == R_FP_enc)
disp += STACK_BIAS;
// We should have a compiler bailout here rather than a guarantee.
// Better yet would be some mechanism to handle variable-size matches correctly.
guarantee(Assembler::is_simm13(disp), "Do not match large constant offsets" );
if( disp != 0 ) {
// use reg-reg form
// set src2=R_O7 contains offset
index = R_O7_enc;
emit3_simm13( cbuf, Assembler::arith_op, index, Assembler::or_op3, 0, disp);
}
instr |= (asi << 5);
instr |= index;
uint *code = (uint*)cbuf.code_end();
*code = instr;
cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord);
}
void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false, bool force_far_call = false) {
void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false, bool force_far_call = false) {
// The method which records debug information at every safepoint
// The method which records debug information at every safepoint
// expects the call to be the first instruction in the snippet as
// expects the call to be the first instruction in the snippet as
...
@@ -1954,11 +1922,6 @@ encode %{
...
@@ -1954,11 +1922,6 @@ encode %{
$mem$$base, $mem$$disp, $mem$$index, $dst$$reg);
$mem$$base, $mem$$disp, $mem$$index, $dst$$reg);
%}
%}
enc_class form3_mem_reg_little( memory mem, iRegI dst) %{
emit_form3_mem_reg_asi(cbuf, this, $primary, -1,
$mem$$base, $mem$$disp, $mem$$index, $dst$$reg, Assembler::ASI_PRIMARY_LITTLE);
%}
enc_class form3_mem_prefetch_read( memory mem ) %{
enc_class form3_mem_prefetch_read( memory mem ) %{
emit_form3_mem_reg(cbuf, this, $primary, -1,
emit_form3_mem_reg(cbuf, this, $primary, -1,
$mem$$base, $mem$$disp, $mem$$index, 0/*prefetch function many-reads*/);
$mem$$base, $mem$$disp, $mem$$index, 0/*prefetch function many-reads*/);
...
@@ -4311,8 +4274,8 @@ operand cmpOp_commute() %{
...
@@ -4311,8 +4274,8 @@ operand cmpOp_commute() %{
// instructions for every form of operand when the instruction accepts
// instructions for every form of operand when the instruction accepts
// multiple operand types with the same basic encoding and format. The classic
// multiple operand types with the same basic encoding and format. The classic
// case of this is memory operands.
// case of this is memory operands.
// Indirect is not included since its use is limited to Compare & Swap
opclass memory( indirect, indOffset13, indIndex );
opclass memory( indirect, indOffset13, indIndex );
opclass indIndexMemory( indIndex );
//----------PIPELINE-----------------------------------------------------------
//----------PIPELINE-----------------------------------------------------------
pipeline %{
pipeline %{
...
@@ -9666,84 +9629,179 @@ instruct popCountL(iRegI dst, iRegL src) %{
...
@@ -9666,84 +9629,179 @@ instruct popCountL(iRegI dst, iRegL src) %{
instruct bytes_reverse_int(iRegI dst, stackSlotI src) %{
instruct bytes_reverse_int(iRegI dst, stackSlotI src) %{
match(Set dst (ReverseBytesI src));
match(Set dst (ReverseBytesI src));
effect(DEF dst, USE src);
// Op cost is artificially doubled to make sure that load or store
// Op cost is artificially doubled to make sure that load or store
// instructions are preferred over this one which requires a spill
// instructions are preferred over this one which requires a spill
// onto a stack slot.
// onto a stack slot.
ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
size(8);
format %{ "LDUWA $src, $dst\t!asi=primary_little" %}
format %{ "LDUWA $src, $dst\t!asi=primary_little" %}
opcode(Assembler::lduwa_op3);
ins_encode( form3_mem_reg_little(src, dst) );
ins_encode %{
__ set($src$$disp + STACK_BIAS, O7);
__ lduwa($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe( iload_mem );
ins_pipe( iload_mem );
%}
%}
instruct bytes_reverse_long(iRegL dst, stackSlotL src) %{
instruct bytes_reverse_long(iRegL dst, stackSlotL src) %{
match(Set dst (ReverseBytesL src));
match(Set dst (ReverseBytesL src));
effect(DEF dst, USE src);
// Op cost is artificially doubled to make sure that load or store
// Op cost is artificially doubled to make sure that load or store
// instructions are preferred over this one which requires a spill
// instructions are preferred over this one which requires a spill
// onto a stack slot.
// onto a stack slot.
ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
size(8);
format %{ "LDXA $src, $dst\t!asi=primary_little" %}
format %{ "LDXA $src, $dst\t!asi=primary_little" %}
opcode(Assembler::ldxa_op3);
ins_encode %{
ins_encode( form3_mem_reg_little(src, dst) );
__ set($src$$disp + STACK_BIAS, O7);
__ ldxa($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe( iload_mem );
%}
instruct bytes_reverse_unsigned_short(iRegI dst, stackSlotI src) %{
match(Set dst (ReverseBytesUS src));
// Op cost is artificially doubled to make sure that load or store
// instructions are preferred over this one which requires a spill
// onto a stack slot.
ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
format %{ "LDUHA $src, $dst\t!asi=primary_little\n\t" %}
ins_encode %{
// the value was spilled as an int so bias the load
__ set($src$$disp + STACK_BIAS + 2, O7);
__ lduha($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe( iload_mem );
%}
instruct bytes_reverse_short(iRegI dst, stackSlotI src) %{
match(Set dst (ReverseBytesS src));
// Op cost is artificially doubled to make sure that load or store
// instructions are preferred over this one which requires a spill
// onto a stack slot.
ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
format %{ "LDSHA $src, $dst\t!asi=primary_little\n\t" %}
ins_encode %{
// the value was spilled as an int so bias the load
__ set($src$$disp + STACK_BIAS + 2, O7);
__ ldsha($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe( iload_mem );
ins_pipe( iload_mem );
%}
%}
// Load Integer reversed byte order
// Load Integer reversed byte order
instruct loadI_reversed(iRegI dst,
m
emory src) %{
instruct loadI_reversed(iRegI dst,
indIndexM
emory src) %{
match(Set dst (ReverseBytesI (LoadI src)));
match(Set dst (ReverseBytesI (LoadI src)));
ins_cost(DEFAULT_COST + MEMORY_REF_COST);
ins_cost(DEFAULT_COST + MEMORY_REF_COST);
size(
8
);
size(
4
);
format %{ "LDUWA $src, $dst\t!asi=primary_little" %}
format %{ "LDUWA $src, $dst\t!asi=primary_little" %}
opcode(Assembler::lduwa_op3);
ins_encode %{
ins_encode( form3_mem_reg_little( src, dst) );
__ lduwa($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe(iload_mem);
ins_pipe(iload_mem);
%}
%}
// Load Long - aligned and reversed
// Load Long - aligned and reversed
instruct loadL_reversed(iRegL dst,
m
emory src) %{
instruct loadL_reversed(iRegL dst,
indIndexM
emory src) %{
match(Set dst (ReverseBytesL (LoadL src)));
match(Set dst (ReverseBytesL (LoadL src)));
ins_cost(
DEFAULT_COST +
MEMORY_REF_COST);
ins_cost(MEMORY_REF_COST);
size(
8
);
size(
4
);
format %{ "LDXA $src, $dst\t!asi=primary_little" %}
format %{ "LDXA $src, $dst\t!asi=primary_little" %}
opcode(Assembler::ldxa_op3);
ins_encode %{
ins_encode( form3_mem_reg_little( src, dst ) );
__ ldxa($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe(iload_mem);
%}
// Load unsigned short / char reversed byte order
instruct loadUS_reversed(iRegI dst, indIndexMemory src) %{
match(Set dst (ReverseBytesUS (LoadUS src)));
ins_cost(MEMORY_REF_COST);
size(4);
format %{ "LDUHA $src, $dst\t!asi=primary_little" %}
ins_encode %{
__ lduha($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe(iload_mem);
%}
// Load short reversed byte order
instruct loadS_reversed(iRegI dst, indIndexMemory src) %{
match(Set dst (ReverseBytesS (LoadS src)));
ins_cost(MEMORY_REF_COST);
size(4);
format %{ "LDSHA $src, $dst\t!asi=primary_little" %}
ins_encode %{
__ ldsha($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
%}
ins_pipe(iload_mem);
ins_pipe(iload_mem);
%}
%}
// Store Integer reversed byte order
// Store Integer reversed byte order
instruct storeI_reversed(
m
emory dst, iRegI src) %{
instruct storeI_reversed(
indIndexM
emory dst, iRegI src) %{
match(Set dst (StoreI dst (ReverseBytesI src)));
match(Set dst (StoreI dst (ReverseBytesI src)));
ins_cost(MEMORY_REF_COST);
ins_cost(MEMORY_REF_COST);
size(
8
);
size(
4
);
format %{ "STWA $src, $dst\t!asi=primary_little" %}
format %{ "STWA $src, $dst\t!asi=primary_little" %}
opcode(Assembler::stwa_op3);
ins_encode %{
ins_encode( form3_mem_reg_little( dst, src) );
__ stwa($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
%}
ins_pipe(istore_mem_reg);
ins_pipe(istore_mem_reg);
%}
%}
// Store Long reversed byte order
// Store Long reversed byte order
instruct storeL_reversed(
m
emory dst, iRegL src) %{
instruct storeL_reversed(
indIndexM
emory dst, iRegL src) %{
match(Set dst (StoreL dst (ReverseBytesL src)));
match(Set dst (StoreL dst (ReverseBytesL src)));
ins_cost(MEMORY_REF_COST);
ins_cost(MEMORY_REF_COST);
size(
8
);
size(
4
);
format %{ "STXA $src, $dst\t!asi=primary_little" %}
format %{ "STXA $src, $dst\t!asi=primary_little" %}
opcode(Assembler::stxa_op3);
ins_encode %{
ins_encode( form3_mem_reg_little( dst, src) );
__ stxa($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
%}
ins_pipe(istore_mem_reg);
%}
// Store unsighed short/char reversed byte order
instruct storeUS_reversed(indIndexMemory dst, iRegI src) %{
match(Set dst (StoreC dst (ReverseBytesUS src)));
ins_cost(MEMORY_REF_COST);
size(4);
format %{ "STHA $src, $dst\t!asi=primary_little" %}
ins_encode %{
__ stha($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
%}
ins_pipe(istore_mem_reg);
%}
// Store short reversed byte order
instruct storeS_reversed(indIndexMemory dst, iRegI src) %{
match(Set dst (StoreC dst (ReverseBytesS src)));
ins_cost(MEMORY_REF_COST);
size(4);
format %{ "STHA $src, $dst\t!asi=primary_little" %}
ins_encode %{
__ stha($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
%}
ins_pipe(istore_mem_reg);
ins_pipe(istore_mem_reg);
%}
%}
...
...
src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
浏览文件 @
b8a0e79b
...
@@ -1244,8 +1244,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
...
@@ -1244,8 +1244,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
break
;
break
;
#endif // _L64
#endif // _L64
case
T_INT
:
case
T_INT
:
// %%% could this be a movl? this is safer but longer instruction
__
movl
(
dest
->
as_register
(),
from_addr
);
__
movl2ptr
(
dest
->
as_register
(),
from_addr
);
break
;
break
;
case
T_LONG
:
{
case
T_LONG
:
{
...
@@ -1303,7 +1302,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
...
@@ -1303,7 +1302,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
__
shll
(
dest_reg
,
24
);
__
shll
(
dest_reg
,
24
);
__
sarl
(
dest_reg
,
24
);
__
sarl
(
dest_reg
,
24
);
}
}
// These are unsigned so the zero extension on 64bit is just what we need
break
;
break
;
}
}
...
@@ -1315,8 +1313,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
...
@@ -1315,8 +1313,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
}
else
{
}
else
{
__
movw
(
dest_reg
,
from_addr
);
__
movw
(
dest_reg
,
from_addr
);
}
}
// This is unsigned so the zero extension on 64bit is just what we need
// __ movl2ptr(dest_reg, dest_reg);
break
;
break
;
}
}
...
@@ -1329,8 +1325,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
...
@@ -1329,8 +1325,6 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
__
shll
(
dest_reg
,
16
);
__
shll
(
dest_reg
,
16
);
__
sarl
(
dest_reg
,
16
);
__
sarl
(
dest_reg
,
16
);
}
}
// Might not be needed in 64bit but certainly doesn't hurt (except for code size)
__
movl2ptr
(
dest_reg
,
dest_reg
);
break
;
break
;
}
}
...
...
src/cpu/x86/vm/x86_32.ad
浏览文件 @
b8a0e79b
//
//
// Copyright 1997-20
09
Sun Microsystems, Inc. All Rights Reserved.
// Copyright 1997-20
10
Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
//
// This code is free software; you can redistribute it and/or modify it
// This code is free software; you can redistribute it and/or modify it
...
@@ -6272,6 +6272,30 @@ instruct bytes_reverse_long(eRegL dst) %{
...
@@ -6272,6 +6272,30 @@ instruct bytes_reverse_long(eRegL dst) %{
ins_pipe( ialu_reg_reg);
ins_pipe( ialu_reg_reg);
%}
%}
instruct bytes_reverse_unsigned_short(eRegI dst) %{
match(Set dst (ReverseBytesUS dst));
format %{ "BSWAP $dst\n\t"
"SHR $dst,16\n\t" %}
ins_encode %{
__ bswapl($dst$$Register);
__ shrl($dst$$Register, 16);
%}
ins_pipe( ialu_reg );
%}
instruct bytes_reverse_short(eRegI dst) %{
match(Set dst (ReverseBytesS dst));
format %{ "BSWAP $dst\n\t"
"SAR $dst,16\n\t" %}
ins_encode %{
__ bswapl($dst$$Register);
__ sarl($dst$$Register, 16);
%}
ins_pipe( ialu_reg );
%}
//---------- Zeros Count Instructions ------------------------------------------
//---------- Zeros Count Instructions ------------------------------------------
...
...
src/cpu/x86/vm/x86_64.ad
浏览文件 @
b8a0e79b
//
//
// Copyright 2003-20
09
Sun Microsystems, Inc. All Rights Reserved.
// Copyright 2003-20
10
Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
//
// This code is free software; you can redistribute it and/or modify it
// This code is free software; you can redistribute it and/or modify it
...
@@ -7371,6 +7371,30 @@ instruct bytes_reverse_long(rRegL dst) %{
...
@@ -7371,6 +7371,30 @@ instruct bytes_reverse_long(rRegL dst) %{
ins_pipe( ialu_reg);
ins_pipe( ialu_reg);
%}
%}
instruct bytes_reverse_unsigned_short(rRegI dst) %{
match(Set dst (ReverseBytesUS dst));
format %{ "bswapl $dst\n\t"
"shrl $dst,16\n\t" %}
ins_encode %{
__ bswapl($dst$$Register);
__ shrl($dst$$Register, 16);
%}
ins_pipe( ialu_reg );
%}
instruct bytes_reverse_short(rRegI dst) %{
match(Set dst (ReverseBytesS dst));
format %{ "bswapl $dst\n\t"
"sar $dst,16\n\t" %}
ins_encode %{
__ bswapl($dst$$Register);
__ sarl($dst$$Register, 16);
%}
ins_pipe( ialu_reg );
%}
instruct loadI_reversed(rRegI dst, memory src) %{
instruct loadI_reversed(rRegI dst, memory src) %{
match(Set dst (ReverseBytesI (LoadI src)));
match(Set dst (ReverseBytesI (LoadI src)));
...
...
src/share/vm/adlc/formssel.cpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 1998-20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1998-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -3861,6 +3861,8 @@ int MatchRule::is_expensive() const {
...
@@ -3861,6 +3861,8 @@ int MatchRule::is_expensive() const {
strcmp
(
opType
,
"RoundFloat"
)
==
0
||
strcmp
(
opType
,
"RoundFloat"
)
==
0
||
strcmp
(
opType
,
"ReverseBytesI"
)
==
0
||
strcmp
(
opType
,
"ReverseBytesI"
)
==
0
||
strcmp
(
opType
,
"ReverseBytesL"
)
==
0
||
strcmp
(
opType
,
"ReverseBytesL"
)
==
0
||
strcmp
(
opType
,
"ReverseBytesUS"
)
==
0
||
strcmp
(
opType
,
"ReverseBytesS"
)
==
0
||
strcmp
(
opType
,
"Replicate16B"
)
==
0
||
strcmp
(
opType
,
"Replicate16B"
)
==
0
||
strcmp
(
opType
,
"Replicate8B"
)
==
0
||
strcmp
(
opType
,
"Replicate8B"
)
==
0
||
strcmp
(
opType
,
"Replicate4B"
)
==
0
||
strcmp
(
opType
,
"Replicate4B"
)
==
0
||
...
...
src/share/vm/c1/c1_Compilation.cpp
浏览文件 @
b8a0e79b
...
@@ -316,7 +316,7 @@ void Compilation::install_code(int frame_size) {
...
@@ -316,7 +316,7 @@ void Compilation::install_code(int frame_size) {
implicit_exception_table
(),
implicit_exception_table
(),
compiler
(),
compiler
(),
_env
->
comp_level
(),
_env
->
comp_level
(),
needs_debug_information
()
,
true
,
has_unsafe_access
()
has_unsafe_access
()
);
);
}
}
...
@@ -449,8 +449,6 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho
...
@@ -449,8 +449,6 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho
assert
(
_arena
==
NULL
,
"shouldn't only one instance of Compilation in existence at a time"
);
assert
(
_arena
==
NULL
,
"shouldn't only one instance of Compilation in existence at a time"
);
_arena
=
Thread
::
current
()
->
resource_area
();
_arena
=
Thread
::
current
()
->
resource_area
();
_compilation
=
this
;
_compilation
=
this
;
_needs_debug_information
=
_env
->
jvmti_can_examine_or_deopt_anywhere
()
||
JavaMonitorsInStackTrace
||
AlwaysEmitDebugInfo
||
DeoptimizeALot
;
_exception_info_list
=
new
ExceptionInfoList
();
_exception_info_list
=
new
ExceptionInfoList
();
_implicit_exception_table
.
set_size
(
0
);
_implicit_exception_table
.
set_size
(
0
);
compile_method
();
compile_method
();
...
...
src/share/vm/c1/c1_Compilation.hpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 1999-20
07
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1999-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -70,7 +70,6 @@ class Compilation: public StackObj {
...
@@ -70,7 +70,6 @@ class Compilation: public StackObj {
int
_max_spills
;
int
_max_spills
;
FrameMap
*
_frame_map
;
FrameMap
*
_frame_map
;
C1_MacroAssembler
*
_masm
;
C1_MacroAssembler
*
_masm
;
bool
_needs_debug_information
;
bool
_has_exception_handlers
;
bool
_has_exception_handlers
;
bool
_has_fpu_code
;
bool
_has_fpu_code
;
bool
_has_unsafe_access
;
bool
_has_unsafe_access
;
...
@@ -117,7 +116,6 @@ class Compilation: public StackObj {
...
@@ -117,7 +116,6 @@ class Compilation: public StackObj {
// accessors
// accessors
ciEnv
*
env
()
const
{
return
_env
;
}
ciEnv
*
env
()
const
{
return
_env
;
}
AbstractCompiler
*
compiler
()
const
{
return
_compiler
;
}
AbstractCompiler
*
compiler
()
const
{
return
_compiler
;
}
bool
needs_debug_information
()
const
{
return
_needs_debug_information
;
}
bool
has_exception_handlers
()
const
{
return
_has_exception_handlers
;
}
bool
has_exception_handlers
()
const
{
return
_has_exception_handlers
;
}
bool
has_fpu_code
()
const
{
return
_has_fpu_code
;
}
bool
has_fpu_code
()
const
{
return
_has_fpu_code
;
}
bool
has_unsafe_access
()
const
{
return
_has_unsafe_access
;
}
bool
has_unsafe_access
()
const
{
return
_has_unsafe_access
;
}
...
@@ -132,7 +130,6 @@ class Compilation: public StackObj {
...
@@ -132,7 +130,6 @@ class Compilation: public StackObj {
CodeOffsets
*
offsets
()
{
return
&
_offsets
;
}
CodeOffsets
*
offsets
()
{
return
&
_offsets
;
}
// setters
// setters
void
set_needs_debug_information
(
bool
f
)
{
_needs_debug_information
=
f
;
}
void
set_has_exception_handlers
(
bool
f
)
{
_has_exception_handlers
=
f
;
}
void
set_has_exception_handlers
(
bool
f
)
{
_has_exception_handlers
=
f
;
}
void
set_has_fpu_code
(
bool
f
)
{
_has_fpu_code
=
f
;
}
void
set_has_fpu_code
(
bool
f
)
{
_has_fpu_code
=
f
;
}
void
set_has_unsafe_access
(
bool
f
)
{
_has_unsafe_access
=
f
;
}
void
set_has_unsafe_access
(
bool
f
)
{
_has_unsafe_access
=
f
;
}
...
...
src/share/vm/c1/c1_GraphBuilder.cpp
浏览文件 @
b8a0e79b
...
@@ -1493,7 +1493,6 @@ void GraphBuilder::access_field(Bytecodes::Code code) {
...
@@ -1493,7 +1493,6 @@ void GraphBuilder::access_field(Bytecodes::Code code) {
Dependencies
*
GraphBuilder
::
dependency_recorder
()
const
{
Dependencies
*
GraphBuilder
::
dependency_recorder
()
const
{
assert
(
DeoptC1
,
"need debug information"
);
assert
(
DeoptC1
,
"need debug information"
);
compilation
()
->
set_needs_debug_information
(
true
);
return
compilation
()
->
dependency_recorder
();
return
compilation
()
->
dependency_recorder
();
}
}
...
...
src/share/vm/c1/c1_LinearScan.cpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 2005-20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2005-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -2814,9 +2814,6 @@ IRScopeDebugInfo* LinearScan::compute_debug_info_for_scope(int op_id, IRScope* c
...
@@ -2814,9 +2814,6 @@ IRScopeDebugInfo* LinearScan::compute_debug_info_for_scope(int op_id, IRScope* c
void
LinearScan
::
compute_debug_info
(
CodeEmitInfo
*
info
,
int
op_id
)
{
void
LinearScan
::
compute_debug_info
(
CodeEmitInfo
*
info
,
int
op_id
)
{
if
(
!
compilation
()
->
needs_debug_information
())
{
return
;
}
TRACE_LINEAR_SCAN
(
3
,
tty
->
print_cr
(
"creating debug information at op_id %d"
,
op_id
));
TRACE_LINEAR_SCAN
(
3
,
tty
->
print_cr
(
"creating debug information at op_id %d"
,
op_id
));
IRScope
*
innermost_scope
=
info
->
scope
();
IRScope
*
innermost_scope
=
info
->
scope
();
...
...
src/share/vm/c1/c1_globals.hpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 2000-20
07
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2000-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -252,9 +252,6 @@
...
@@ -252,9 +252,6 @@
develop(bool, BailoutOnExceptionHandlers, false, \
develop(bool, BailoutOnExceptionHandlers, false, \
"bailout of compilation for methods with exception handlers") \
"bailout of compilation for methods with exception handlers") \
\
\
develop(bool, AlwaysEmitDebugInfo, false, \
"always emit debug info") \
\
develop(bool, InstallMethods, true, \
develop(bool, InstallMethods, true, \
"Install methods at the end of successful compilations") \
"Install methods at the end of successful compilations") \
\
\
...
...
src/share/vm/ci/bcEscapeAnalyzer.cpp
浏览文件 @
b8a0e79b
...
@@ -1408,8 +1408,11 @@ BCEscapeAnalyzer::BCEscapeAnalyzer(ciMethod* method, BCEscapeAnalyzer* parent)
...
@@ -1408,8 +1408,11 @@ BCEscapeAnalyzer::BCEscapeAnalyzer(ciMethod* method, BCEscapeAnalyzer* parent)
}
}
void
BCEscapeAnalyzer
::
copy_dependencies
(
Dependencies
*
deps
)
{
void
BCEscapeAnalyzer
::
copy_dependencies
(
Dependencies
*
deps
)
{
if
(
!
has_dependencies
())
if
(
ciEnv
::
current
()
->
jvmti_can_hotswap_or_post_breakpoint
())
{
return
;
// Also record evol dependencies so redefinition of the
// callee will trigger recompilation.
deps
->
assert_evol_method
(
method
());
}
for
(
int
i
=
0
;
i
<
_dependencies
.
length
();
i
+=
2
)
{
for
(
int
i
=
0
;
i
<
_dependencies
.
length
();
i
+=
2
)
{
ciKlass
*
k
=
_dependencies
[
i
]
->
as_klass
();
ciKlass
*
k
=
_dependencies
[
i
]
->
as_klass
();
ciMethod
*
m
=
_dependencies
[
i
+
1
]
->
as_method
();
ciMethod
*
m
=
_dependencies
[
i
+
1
]
->
as_method
();
...
...
src/share/vm/ci/ciEnv.cpp
浏览文件 @
b8a0e79b
...
@@ -176,7 +176,6 @@ void ciEnv::cache_jvmti_state() {
...
@@ -176,7 +176,6 @@ void ciEnv::cache_jvmti_state() {
// Get Jvmti capabilities under lock to get consistant values.
// Get Jvmti capabilities under lock to get consistant values.
MutexLocker
mu
(
JvmtiThreadState_lock
);
MutexLocker
mu
(
JvmtiThreadState_lock
);
_jvmti_can_hotswap_or_post_breakpoint
=
JvmtiExport
::
can_hotswap_or_post_breakpoint
();
_jvmti_can_hotswap_or_post_breakpoint
=
JvmtiExport
::
can_hotswap_or_post_breakpoint
();
_jvmti_can_examine_or_deopt_anywhere
=
JvmtiExport
::
can_examine_or_deopt_anywhere
();
_jvmti_can_access_local_variables
=
JvmtiExport
::
can_access_local_variables
();
_jvmti_can_access_local_variables
=
JvmtiExport
::
can_access_local_variables
();
_jvmti_can_post_on_exceptions
=
JvmtiExport
::
can_post_on_exceptions
();
_jvmti_can_post_on_exceptions
=
JvmtiExport
::
can_post_on_exceptions
();
}
}
...
@@ -887,8 +886,6 @@ void ciEnv::register_method(ciMethod* target,
...
@@ -887,8 +886,6 @@ void ciEnv::register_method(ciMethod* target,
if
(
!
failing
()
&&
if
(
!
failing
()
&&
(
(
!
jvmti_can_hotswap_or_post_breakpoint
()
&&
(
(
!
jvmti_can_hotswap_or_post_breakpoint
()
&&
JvmtiExport
::
can_hotswap_or_post_breakpoint
())
||
JvmtiExport
::
can_hotswap_or_post_breakpoint
())
||
(
!
jvmti_can_examine_or_deopt_anywhere
()
&&
JvmtiExport
::
can_examine_or_deopt_anywhere
())
||
(
!
jvmti_can_access_local_variables
()
&&
(
!
jvmti_can_access_local_variables
()
&&
JvmtiExport
::
can_access_local_variables
())
||
JvmtiExport
::
can_access_local_variables
())
||
(
!
jvmti_can_post_on_exceptions
()
&&
(
!
jvmti_can_post_on_exceptions
()
&&
...
...
src/share/vm/ci/ciEnv.hpp
浏览文件 @
b8a0e79b
...
@@ -55,7 +55,6 @@ private:
...
@@ -55,7 +55,6 @@ private:
// Cache Jvmti state
// Cache Jvmti state
bool
_jvmti_can_hotswap_or_post_breakpoint
;
bool
_jvmti_can_hotswap_or_post_breakpoint
;
bool
_jvmti_can_examine_or_deopt_anywhere
;
bool
_jvmti_can_access_local_variables
;
bool
_jvmti_can_access_local_variables
;
bool
_jvmti_can_post_on_exceptions
;
bool
_jvmti_can_post_on_exceptions
;
...
@@ -257,7 +256,6 @@ public:
...
@@ -257,7 +256,6 @@ public:
// Cache Jvmti state
// Cache Jvmti state
void
cache_jvmti_state
();
void
cache_jvmti_state
();
bool
jvmti_can_hotswap_or_post_breakpoint
()
const
{
return
_jvmti_can_hotswap_or_post_breakpoint
;
}
bool
jvmti_can_hotswap_or_post_breakpoint
()
const
{
return
_jvmti_can_hotswap_or_post_breakpoint
;
}
bool
jvmti_can_examine_or_deopt_anywhere
()
const
{
return
_jvmti_can_examine_or_deopt_anywhere
;
}
bool
jvmti_can_access_local_variables
()
const
{
return
_jvmti_can_access_local_variables
;
}
bool
jvmti_can_access_local_variables
()
const
{
return
_jvmti_can_access_local_variables
;
}
bool
jvmti_can_post_on_exceptions
()
const
{
return
_jvmti_can_post_on_exceptions
;
}
bool
jvmti_can_post_on_exceptions
()
const
{
return
_jvmti_can_post_on_exceptions
;
}
...
...
src/share/vm/classfile/vmSymbols.hpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 1997-20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -357,6 +357,8 @@
...
@@ -357,6 +357,8 @@
template(void_double_signature, "()D") \
template(void_double_signature, "()D") \
template(int_void_signature, "(I)V") \
template(int_void_signature, "(I)V") \
template(int_int_signature, "(I)I") \
template(int_int_signature, "(I)I") \
template(char_char_signature, "(C)C") \
template(short_short_signature, "(S)S") \
template(int_bool_signature, "(I)Z") \
template(int_bool_signature, "(I)Z") \
template(float_int_signature, "(F)I") \
template(float_int_signature, "(F)I") \
template(double_long_signature, "(D)J") \
template(double_long_signature, "(D)J") \
...
@@ -584,6 +586,10 @@
...
@@ -584,6 +586,10 @@
do_intrinsic(_reverseBytes_i, java_lang_Integer, reverseBytes_name, int_int_signature, F_S) \
do_intrinsic(_reverseBytes_i, java_lang_Integer, reverseBytes_name, int_int_signature, F_S) \
do_name( reverseBytes_name, "reverseBytes") \
do_name( reverseBytes_name, "reverseBytes") \
do_intrinsic(_reverseBytes_l, java_lang_Long, reverseBytes_name, long_long_signature, F_S) \
do_intrinsic(_reverseBytes_l, java_lang_Long, reverseBytes_name, long_long_signature, F_S) \
/* (symbol reverseBytes_name defined above) */
\
do_intrinsic(_reverseBytes_c, java_lang_Character, reverseBytes_name, char_char_signature, F_S) \
/* (symbol reverseBytes_name defined above) */
\
do_intrinsic(_reverseBytes_s, java_lang_Short, reverseBytes_name, short_short_signature, F_S) \
/* (symbol reverseBytes_name defined above) */
\
/* (symbol reverseBytes_name defined above) */
\
\
\
do_intrinsic(_identityHashCode, java_lang_System, identityHashCode_name, object_int_signature, F_S) \
do_intrinsic(_identityHashCode, java_lang_System, identityHashCode_name, object_int_signature, F_S) \
...
...
src/share/vm/opto/c2compiler.cpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 1999-20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1999-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -105,8 +105,7 @@ void C2Compiler::compile_method(ciEnv* env,
...
@@ -105,8 +105,7 @@ void C2Compiler::compile_method(ciEnv* env,
}
}
bool
subsume_loads
=
true
;
bool
subsume_loads
=
true
;
bool
do_escape_analysis
=
DoEscapeAnalysis
&&
bool
do_escape_analysis
=
DoEscapeAnalysis
&&
!
(
env
->
jvmti_can_hotswap_or_post_breakpoint
()
||
!
env
->
jvmti_can_access_local_variables
();
env
->
jvmti_can_examine_or_deopt_anywhere
());
while
(
!
env
->
failing
())
{
while
(
!
env
->
failing
())
{
// Attempt to compile while subsuming loads into machine instructions.
// Attempt to compile while subsuming loads into machine instructions.
Compile
C
(
env
,
this
,
target
,
entry_bci
,
subsume_loads
,
do_escape_analysis
);
Compile
C
(
env
,
this
,
target
,
entry_bci
,
subsume_loads
,
do_escape_analysis
);
...
...
src/share/vm/opto/classes.hpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 1997-20
09
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -44,6 +44,8 @@ macro(Bool)
...
@@ -44,6 +44,8 @@ macro(Bool)
macro
(
BoxLock
)
macro
(
BoxLock
)
macro
(
ReverseBytesI
)
macro
(
ReverseBytesI
)
macro
(
ReverseBytesL
)
macro
(
ReverseBytesL
)
macro
(
ReverseBytesUS
)
macro
(
ReverseBytesS
)
macro
(
CProj
)
macro
(
CProj
)
macro
(
CallDynamicJava
)
macro
(
CallDynamicJava
)
macro
(
CallJava
)
macro
(
CallJava
)
...
...
src/share/vm/opto/compile.cpp
浏览文件 @
b8a0e79b
...
@@ -871,7 +871,6 @@ void Compile::Init(int aliaslevel) {
...
@@ -871,7 +871,6 @@ void Compile::Init(int aliaslevel) {
set_has_split_ifs
(
false
);
set_has_split_ifs
(
false
);
set_has_loops
(
has_method
()
&&
method
()
->
has_loops
());
// first approximation
set_has_loops
(
has_method
()
&&
method
()
->
has_loops
());
// first approximation
set_has_stringbuilder
(
false
);
set_has_stringbuilder
(
false
);
_deopt_happens
=
true
;
// start out assuming the worst
_trap_can_recompile
=
false
;
// no traps emitted yet
_trap_can_recompile
=
false
;
// no traps emitted yet
_major_progress
=
true
;
// start out assuming good things will happen
_major_progress
=
true
;
// start out assuming good things will happen
set_has_unsafe_access
(
false
);
set_has_unsafe_access
(
false
);
...
...
src/share/vm/opto/compile.hpp
浏览文件 @
b8a0e79b
...
@@ -146,7 +146,6 @@ class Compile : public Phase {
...
@@ -146,7 +146,6 @@ class Compile : public Phase {
int
_orig_pc_slot_offset_in_bytes
;
int
_orig_pc_slot_offset_in_bytes
;
int
_major_progress
;
// Count of something big happening
int
_major_progress
;
// Count of something big happening
bool
_deopt_happens
;
// TRUE if de-optimization CAN happen
bool
_has_loops
;
// True if the method _may_ have some loops
bool
_has_loops
;
// True if the method _may_ have some loops
bool
_has_split_ifs
;
// True if the method _may_ have some split-if
bool
_has_split_ifs
;
// True if the method _may_ have some split-if
bool
_has_unsafe_access
;
// True if the method _may_ produce faults in unsafe loads or stores.
bool
_has_unsafe_access
;
// True if the method _may_ produce faults in unsafe loads or stores.
...
@@ -300,7 +299,6 @@ class Compile : public Phase {
...
@@ -300,7 +299,6 @@ class Compile : public Phase {
void
set_freq_inline_size
(
int
n
)
{
_freq_inline_size
=
n
;
}
void
set_freq_inline_size
(
int
n
)
{
_freq_inline_size
=
n
;
}
int
freq_inline_size
()
const
{
return
_freq_inline_size
;
}
int
freq_inline_size
()
const
{
return
_freq_inline_size
;
}
void
set_max_inline_size
(
int
n
)
{
_max_inline_size
=
n
;
}
void
set_max_inline_size
(
int
n
)
{
_max_inline_size
=
n
;
}
bool
deopt_happens
()
const
{
return
_deopt_happens
;
}
bool
has_loops
()
const
{
return
_has_loops
;
}
bool
has_loops
()
const
{
return
_has_loops
;
}
void
set_has_loops
(
bool
z
)
{
_has_loops
=
z
;
}
void
set_has_loops
(
bool
z
)
{
_has_loops
=
z
;
}
bool
has_split_ifs
()
const
{
return
_has_split_ifs
;
}
bool
has_split_ifs
()
const
{
return
_has_split_ifs
;
}
...
...
src/share/vm/opto/graphKit.cpp
浏览文件 @
b8a0e79b
...
@@ -812,10 +812,6 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
...
@@ -812,10 +812,6 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
JVMState
*
youngest_jvms
=
sync_jvms
();
JVMState
*
youngest_jvms
=
sync_jvms
();
// Do we need debug info here? If it is a SafePoint and this method
// cannot de-opt, then we do NOT need any debug info.
bool
full_info
=
(
C
->
deopt_happens
()
||
call
->
Opcode
()
!=
Op_SafePoint
);
// If we are guaranteed to throw, we can prune everything but the
// If we are guaranteed to throw, we can prune everything but the
// input to the current bytecode.
// input to the current bytecode.
bool
can_prune_locals
=
false
;
bool
can_prune_locals
=
false
;
...
@@ -829,10 +825,9 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
...
@@ -829,10 +825,9 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
}
}
}
}
if
(
env
()
->
jvmti_can_
examine_or_deopt_anywhere
())
{
if
(
env
()
->
jvmti_can_
access_local_variables
())
{
// At any safepoint, this method can get breakpointed, which would
// At any safepoint, this method can get breakpointed, which would
// then require an immediate deoptimization.
// then require an immediate deoptimization.
full_info
=
true
;
can_prune_locals
=
false
;
// do not prune locals
can_prune_locals
=
false
;
// do not prune locals
stack_slots_not_pruned
=
0
;
stack_slots_not_pruned
=
0
;
}
}
...
@@ -890,7 +885,7 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
...
@@ -890,7 +885,7 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
k
=
in_jvms
->
locoff
();
k
=
in_jvms
->
locoff
();
l
=
in_jvms
->
loc_size
();
l
=
in_jvms
->
loc_size
();
out_jvms
->
set_locoff
(
p
);
out_jvms
->
set_locoff
(
p
);
if
(
full_info
&&
!
can_prune_locals
)
{
if
(
!
can_prune_locals
)
{
for
(
j
=
0
;
j
<
l
;
j
++
)
for
(
j
=
0
;
j
<
l
;
j
++
)
call
->
set_req
(
p
++
,
in_map
->
in
(
k
+
j
));
call
->
set_req
(
p
++
,
in_map
->
in
(
k
+
j
));
}
else
{
}
else
{
...
@@ -901,7 +896,7 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
...
@@ -901,7 +896,7 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) {
k
=
in_jvms
->
stkoff
();
k
=
in_jvms
->
stkoff
();
l
=
in_jvms
->
sp
();
l
=
in_jvms
->
sp
();
out_jvms
->
set_stkoff
(
p
);
out_jvms
->
set_stkoff
(
p
);
if
(
full_info
&&
!
can_prune_locals
)
{
if
(
!
can_prune_locals
)
{
for
(
j
=
0
;
j
<
l
;
j
++
)
for
(
j
=
0
;
j
<
l
;
j
++
)
call
->
set_req
(
p
++
,
in_map
->
in
(
k
+
j
));
call
->
set_req
(
p
++
,
in_map
->
in
(
k
+
j
));
}
else
if
(
can_prune_locals
&&
stack_slots_not_pruned
!=
0
)
{
}
else
if
(
can_prune_locals
&&
stack_slots_not_pruned
!=
0
)
{
...
...
src/share/vm/opto/library_call.cpp
浏览文件 @
b8a0e79b
...
@@ -636,6 +636,8 @@ bool LibraryCallKit::try_to_inline() {
...
@@ -636,6 +636,8 @@ bool LibraryCallKit::try_to_inline() {
case
vmIntrinsics
::
_reverseBytes_i
:
case
vmIntrinsics
::
_reverseBytes_i
:
case
vmIntrinsics
::
_reverseBytes_l
:
case
vmIntrinsics
::
_reverseBytes_l
:
case
vmIntrinsics
::
_reverseBytes_s
:
case
vmIntrinsics
::
_reverseBytes_c
:
return
inline_reverseBytes
((
vmIntrinsics
::
ID
)
intrinsic_id
());
return
inline_reverseBytes
((
vmIntrinsics
::
ID
)
intrinsic_id
());
case
vmIntrinsics
::
_get_AtomicLong
:
case
vmIntrinsics
::
_get_AtomicLong
:
...
@@ -2010,13 +2012,19 @@ bool LibraryCallKit::inline_bitCount(vmIntrinsics::ID id) {
...
@@ -2010,13 +2012,19 @@ bool LibraryCallKit::inline_bitCount(vmIntrinsics::ID id) {
return
true
;
return
true
;
}
}
//----------------------------inline_reverseBytes_int/long-------------------
//----------------------------inline_reverseBytes_int/long
/char/short
-------------------
// inline Integer.reverseBytes(int)
// inline Integer.reverseBytes(int)
// inline Long.reverseBytes(long)
// inline Long.reverseBytes(long)
// inline Character.reverseBytes(char)
// inline Short.reverseBytes(short)
bool
LibraryCallKit
::
inline_reverseBytes
(
vmIntrinsics
::
ID
id
)
{
bool
LibraryCallKit
::
inline_reverseBytes
(
vmIntrinsics
::
ID
id
)
{
assert
(
id
==
vmIntrinsics
::
_reverseBytes_i
||
id
==
vmIntrinsics
::
_reverseBytes_l
,
"not reverse Bytes"
);
assert
(
id
==
vmIntrinsics
::
_reverseBytes_i
||
id
==
vmIntrinsics
::
_reverseBytes_l
||
if
(
id
==
vmIntrinsics
::
_reverseBytes_i
&&
!
Matcher
::
has_match_rule
(
Op_ReverseBytesI
))
return
false
;
id
==
vmIntrinsics
::
_reverseBytes_c
||
id
==
vmIntrinsics
::
_reverseBytes_s
,
if
(
id
==
vmIntrinsics
::
_reverseBytes_l
&&
!
Matcher
::
has_match_rule
(
Op_ReverseBytesL
))
return
false
;
"not reverse Bytes"
);
if
(
id
==
vmIntrinsics
::
_reverseBytes_i
&&
!
Matcher
::
has_match_rule
(
Op_ReverseBytesI
))
return
false
;
if
(
id
==
vmIntrinsics
::
_reverseBytes_l
&&
!
Matcher
::
has_match_rule
(
Op_ReverseBytesL
))
return
false
;
if
(
id
==
vmIntrinsics
::
_reverseBytes_c
&&
!
Matcher
::
has_match_rule
(
Op_ReverseBytesUS
))
return
false
;
if
(
id
==
vmIntrinsics
::
_reverseBytes_s
&&
!
Matcher
::
has_match_rule
(
Op_ReverseBytesS
))
return
false
;
_sp
+=
arg_size
();
// restore stack pointer
_sp
+=
arg_size
();
// restore stack pointer
switch
(
id
)
{
switch
(
id
)
{
case
vmIntrinsics
::
_reverseBytes_i
:
case
vmIntrinsics
::
_reverseBytes_i
:
...
@@ -2025,6 +2033,12 @@ bool LibraryCallKit::inline_reverseBytes(vmIntrinsics::ID id) {
...
@@ -2025,6 +2033,12 @@ bool LibraryCallKit::inline_reverseBytes(vmIntrinsics::ID id) {
case
vmIntrinsics
::
_reverseBytes_l
:
case
vmIntrinsics
::
_reverseBytes_l
:
push_pair
(
_gvn
.
transform
(
new
(
C
,
2
)
ReverseBytesLNode
(
0
,
pop_pair
())));
push_pair
(
_gvn
.
transform
(
new
(
C
,
2
)
ReverseBytesLNode
(
0
,
pop_pair
())));
break
;
break
;
case
vmIntrinsics
::
_reverseBytes_c
:
push
(
_gvn
.
transform
(
new
(
C
,
2
)
ReverseBytesUSNode
(
0
,
pop
())));
break
;
case
vmIntrinsics
::
_reverseBytes_s
:
push
(
_gvn
.
transform
(
new
(
C
,
2
)
ReverseBytesSNode
(
0
,
pop
())));
break
;
default:
default:
;
;
}
}
...
...
src/share/vm/opto/subnode.hpp
浏览文件 @
b8a0e79b
/*
/*
* Copyright 1997-20
08
Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1997-20
10
Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -509,3 +509,23 @@ public:
...
@@ -509,3 +509,23 @@ public:
const
Type
*
bottom_type
()
const
{
return
TypeLong
::
LONG
;
}
const
Type
*
bottom_type
()
const
{
return
TypeLong
::
LONG
;
}
virtual
uint
ideal_reg
()
const
{
return
Op_RegL
;
}
virtual
uint
ideal_reg
()
const
{
return
Op_RegL
;
}
};
};
//-------------------------------ReverseBytesUSNode--------------------------------
// reverse bytes of an unsigned short / char
class
ReverseBytesUSNode
:
public
Node
{
public:
ReverseBytesUSNode
(
Node
*
c
,
Node
*
in1
)
:
Node
(
c
,
in1
)
{}
virtual
int
Opcode
()
const
;
const
Type
*
bottom_type
()
const
{
return
TypeInt
::
CHAR
;
}
virtual
uint
ideal_reg
()
const
{
return
Op_RegI
;
}
};
//-------------------------------ReverseBytesSNode--------------------------------
// reverse bytes of a short
class
ReverseBytesSNode
:
public
Node
{
public:
ReverseBytesSNode
(
Node
*
c
,
Node
*
in1
)
:
Node
(
c
,
in1
)
{}
virtual
int
Opcode
()
const
;
const
Type
*
bottom_type
()
const
{
return
TypeInt
::
SHORT
;
}
virtual
uint
ideal_reg
()
const
{
return
Op_RegI
;
}
};
src/share/vm/prims/jvmtiExport.cpp
浏览文件 @
b8a0e79b
...
@@ -270,7 +270,6 @@ int JvmtiExport::_field_access_count = 0;
...
@@ -270,7 +270,6 @@ int JvmtiExport::_field_access_count = 0;
int
JvmtiExport
::
_field_modification_count
=
0
;
int
JvmtiExport
::
_field_modification_count
=
0
;
bool
JvmtiExport
::
_can_access_local_variables
=
false
;
bool
JvmtiExport
::
_can_access_local_variables
=
false
;
bool
JvmtiExport
::
_can_examine_or_deopt_anywhere
=
false
;
bool
JvmtiExport
::
_can_hotswap_or_post_breakpoint
=
false
;
bool
JvmtiExport
::
_can_hotswap_or_post_breakpoint
=
false
;
bool
JvmtiExport
::
_can_modify_any_class
=
false
;
bool
JvmtiExport
::
_can_modify_any_class
=
false
;
bool
JvmtiExport
::
_can_walk_any_space
=
false
;
bool
JvmtiExport
::
_can_walk_any_space
=
false
;
...
...
src/share/vm/prims/jvmtiExport.hpp
浏览文件 @
b8a0e79b
...
@@ -58,7 +58,6 @@ class JvmtiExport : public AllStatic {
...
@@ -58,7 +58,6 @@ class JvmtiExport : public AllStatic {
static
int
_field_modification_count
;
static
int
_field_modification_count
;
static
bool
_can_access_local_variables
;
static
bool
_can_access_local_variables
;
static
bool
_can_examine_or_deopt_anywhere
;
static
bool
_can_hotswap_or_post_breakpoint
;
static
bool
_can_hotswap_or_post_breakpoint
;
static
bool
_can_modify_any_class
;
static
bool
_can_modify_any_class
;
static
bool
_can_walk_any_space
;
static
bool
_can_walk_any_space
;
...
@@ -112,7 +111,6 @@ class JvmtiExport : public AllStatic {
...
@@ -112,7 +111,6 @@ class JvmtiExport : public AllStatic {
// these should only be called by the friend class
// these should only be called by the friend class
friend
class
JvmtiManageCapabilities
;
friend
class
JvmtiManageCapabilities
;
inline
static
void
set_can_examine_or_deopt_anywhere
(
bool
on
)
{
_can_examine_or_deopt_anywhere
=
(
on
!=
0
);
}
inline
static
void
set_can_modify_any_class
(
bool
on
)
{
_can_modify_any_class
=
(
on
!=
0
);
}
inline
static
void
set_can_modify_any_class
(
bool
on
)
{
_can_modify_any_class
=
(
on
!=
0
);
}
inline
static
void
set_can_access_local_variables
(
bool
on
)
{
_can_access_local_variables
=
(
on
!=
0
);
}
inline
static
void
set_can_access_local_variables
(
bool
on
)
{
_can_access_local_variables
=
(
on
!=
0
);
}
inline
static
void
set_can_hotswap_or_post_breakpoint
(
bool
on
)
{
_can_hotswap_or_post_breakpoint
=
(
on
!=
0
);
}
inline
static
void
set_can_hotswap_or_post_breakpoint
(
bool
on
)
{
_can_hotswap_or_post_breakpoint
=
(
on
!=
0
);
}
...
@@ -220,7 +218,6 @@ class JvmtiExport : public AllStatic {
...
@@ -220,7 +218,6 @@ class JvmtiExport : public AllStatic {
static
void
enter_live_phase
();
static
void
enter_live_phase
();
// ------ can_* conditions (below) are set at OnLoad and never changed ------------
// ------ can_* conditions (below) are set at OnLoad and never changed ------------
inline
static
bool
can_examine_or_deopt_anywhere
()
{
return
_can_examine_or_deopt_anywhere
;
}
inline
static
bool
can_modify_any_class
()
{
return
_can_modify_any_class
;
}
inline
static
bool
can_modify_any_class
()
{
return
_can_modify_any_class
;
}
inline
static
bool
can_access_local_variables
()
{
return
_can_access_local_variables
;
}
inline
static
bool
can_access_local_variables
()
{
return
_can_access_local_variables
;
}
inline
static
bool
can_hotswap_or_post_breakpoint
()
{
return
_can_hotswap_or_post_breakpoint
;
}
inline
static
bool
can_hotswap_or_post_breakpoint
()
{
return
_can_hotswap_or_post_breakpoint
;
}
...
...
src/share/vm/prims/jvmtiManageCapabilities.cpp
浏览文件 @
b8a0e79b
...
@@ -332,16 +332,6 @@ void JvmtiManageCapabilities::update() {
...
@@ -332,16 +332,6 @@ void JvmtiManageCapabilities::update() {
}
}
JvmtiExport
::
set_can_get_source_debug_extension
(
avail
.
can_get_source_debug_extension
);
JvmtiExport
::
set_can_get_source_debug_extension
(
avail
.
can_get_source_debug_extension
);
JvmtiExport
::
set_can_examine_or_deopt_anywhere
(
avail
.
can_generate_breakpoint_events
||
interp_events
||
avail
.
can_redefine_classes
||
avail
.
can_retransform_classes
||
avail
.
can_access_local_variables
||
avail
.
can_get_owned_monitor_info
||
avail
.
can_get_current_contended_monitor
||
avail
.
can_get_monitor_info
||
avail
.
can_get_owned_monitor_stack_depth_info
);
JvmtiExport
::
set_can_maintain_original_method_order
(
avail
.
can_maintain_original_method_order
);
JvmtiExport
::
set_can_maintain_original_method_order
(
avail
.
can_maintain_original_method_order
);
JvmtiExport
::
set_can_post_interpreter_events
(
interp_events
);
JvmtiExport
::
set_can_post_interpreter_events
(
interp_events
);
JvmtiExport
::
set_can_hotswap_or_post_breakpoint
(
JvmtiExport
::
set_can_hotswap_or_post_breakpoint
(
...
@@ -353,10 +343,13 @@ void JvmtiManageCapabilities::update() {
...
@@ -353,10 +343,13 @@ void JvmtiManageCapabilities::update() {
avail
.
can_generate_all_class_hook_events
);
avail
.
can_generate_all_class_hook_events
);
JvmtiExport
::
set_can_walk_any_space
(
JvmtiExport
::
set_can_walk_any_space
(
avail
.
can_tag_objects
);
// disable sharing in onload phase
avail
.
can_tag_objects
);
// disable sharing in onload phase
// This controls whether the compilers keep extra locals live to
// improve the debugging experience so only set them if the selected
// capabilities look like a debugger.
JvmtiExport
::
set_can_access_local_variables
(
JvmtiExport
::
set_can_access_local_variables
(
avail
.
can_access_local_variables
||
avail
.
can_access_local_variables
||
avail
.
can_
redefine_classe
s
||
avail
.
can_
generate_breakpoint_event
s
||
avail
.
can_
retransform_classe
s
);
avail
.
can_
generate_frame_pop_event
s
);
JvmtiExport
::
set_can_post_on_exceptions
(
JvmtiExport
::
set_can_post_on_exceptions
(
avail
.
can_generate_exception_events
||
avail
.
can_generate_exception_events
||
avail
.
can_generate_frame_pop_events
||
avail
.
can_generate_frame_pop_events
||
...
...
test/compiler/6431242/Test.java
0 → 100644
浏览文件 @
b8a0e79b
/*
* Copyright 2006 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
/*
* @test
* @bug 6431242
* @run main/othervm -server -XX:+PrintCompilation Test
*/
public
class
Test
{
int
_len
=
8
;
int
[]
_arr_i
=
new
int
[
_len
];
long
[]
_arr_l
=
new
long
[
_len
];
int
[]
_arr_i_cp
=
new
int
[
_len
];
long
[]
_arr_l_cp
=
new
long
[
_len
];
int
_k
=
0x12345678
;
int
_j
=
0
;
int
_ir
=
0x78563412
;
int
_ir1
=
0x78563413
;
int
_ir2
=
0x79563412
;
long
_m
=
0x123456789abcdef0
L
;
long
_l
=
0L
;
long
_lr
=
0xf0debc9a78563412
L
;
long
_lr1
=
0xf0debc9a78563413
L
;
long
_lr2
=
0xf1debc9a78563412
L
;
void
init
()
{
for
(
int
i
=
0
;
i
<
_arr_i
.
length
;
i
++)
{
_arr_i
[
i
]
=
_k
;
_arr_l
[
i
]
=
_m
;
}
}
public
int
test_int_reversed
(
int
i
)
{
return
Integer
.
reverseBytes
(
i
);
}
public
long
test_long_reversed
(
long
i
)
{
return
Long
.
reverseBytes
(
i
);
}
public
void
test_copy_ints
(
int
[]
dst
,
int
[]
src
)
{
for
(
int
i
=
0
;
i
<
src
.
length
;
i
++)
{
dst
[
i
]
=
Integer
.
reverseBytes
(
src
[
i
]);
}
}
public
void
test_copy_ints_reversed
(
int
[]
dst
,
int
[]
src
)
{
for
(
int
i
=
0
;
i
<
src
.
length
;
i
++)
{
dst
[
i
]
=
1
+
Integer
.
reverseBytes
(
src
[
i
]);
}
}
public
void
test_copy_ints_store_reversed
(
int
[]
dst
,
int
[]
src
)
{
for
(
int
i
=
0
;
i
<
src
.
length
;
i
++)
{
dst
[
i
]
=
Integer
.
reverseBytes
(
1
+
src
[
i
]);
}
}
public
void
test_copy_longs
(
long
[]
dst
,
long
[]
src
)
{
for
(
int
i
=
0
;
i
<
src
.
length
;
i
++)
{
dst
[
i
]
=
Long
.
reverseBytes
(
src
[
i
]);
}
}
public
void
test_copy_longs_reversed
(
long
[]
dst
,
long
[]
src
)
{
for
(
int
i
=
0
;
i
<
src
.
length
;
i
++)
{
dst
[
i
]
=
1
+
Long
.
reverseBytes
(
src
[
i
]);
}
}
public
void
test_copy_longs_store_reversed
(
long
[]
dst
,
long
[]
src
)
{
for
(
int
i
=
0
;
i
<
src
.
length
;
i
++)
{
dst
[
i
]
=
Long
.
reverseBytes
(
1
+
src
[
i
]);
}
}
public
void
test
()
throws
Exception
{
int
up_limit
=
90000
;
//test single
for
(
int
loop
=
0
;
loop
<
up_limit
;
loop
++)
{
_j
=
test_int_reversed
(
_k
);
if
(
_j
!=
_ir
)
{
throw
new
Exception
(
"Interger.reverseBytes failed "
+
_j
+
" iter "
+
loop
);
}
_l
=
test_long_reversed
(
_m
);
if
(
_l
!=
_lr
)
{
throw
new
Exception
(
"Long.reverseBytes failed "
+
_l
+
" iter "
+
loop
);
}
}
// test scalar load/store
for
(
int
loop
=
0
;
loop
<
up_limit
;
loop
++)
{
test_copy_ints
(
_arr_i_cp
,
_arr_i
);
for
(
int
j
=
0
;
j
<
_arr_i
.
length
;
j
++)
{
if
(
_arr_i_cp
[
j
]
!=
_ir
)
{
throw
new
Exception
(
"Interger.reverseBytes failed test_copy_ints iter "
+
loop
);
}
}
test_copy_ints_reversed
(
_arr_i_cp
,
_arr_i
);
for
(
int
j
=
0
;
j
<
_arr_i
.
length
;
j
++)
{
if
(
_arr_i_cp
[
j
]
!=
_ir1
)
{
throw
new
Exception
(
"Interger.reverseBytes failed test_copy_ints_reversed iter "
+
loop
);
}
}
test_copy_ints_store_reversed
(
_arr_i_cp
,
_arr_i
);
for
(
int
j
=
0
;
j
<
_arr_i
.
length
;
j
++)
{
if
(
_arr_i_cp
[
j
]
!=
_ir2
)
{
throw
new
Exception
(
"Interger.reverseBytes failed test_copy_ints_store_reversed iter "
+
loop
);
}
}
test_copy_longs
(
_arr_l_cp
,
_arr_l
);
for
(
int
j
=
0
;
j
<
_arr_i
.
length
;
j
++)
{
if
(
_arr_l_cp
[
j
]
!=
_lr
)
{
throw
new
Exception
(
"Long.reverseBytes failed test_copy_longs iter "
+
loop
);
}
}
test_copy_longs_reversed
(
_arr_l_cp
,
_arr_l
);
for
(
int
j
=
0
;
j
<
_arr_i
.
length
;
j
++)
{
if
(
_arr_l_cp
[
j
]
!=
_lr1
)
{
throw
new
Exception
(
"Long.reverseBytes failed test_copy_longs_reversed iter "
+
loop
);
}
}
test_copy_longs_store_reversed
(
_arr_l_cp
,
_arr_l
);
for
(
int
j
=
0
;
j
<
_arr_i
.
length
;
j
++)
{
if
(
_arr_l_cp
[
j
]
!=
_lr2
)
{
throw
new
Exception
(
"Long.reverseBytes failed test_copy_longs_store_reversed iter "
+
loop
);
}
}
}
}
public
static
void
main
(
String
args
[])
{
try
{
Test
t
=
new
Test
();
t
.
init
();
t
.
test
();
System
.
out
.
println
(
"Passed"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"Failed"
);
}
}
}
test/compiler/6946040/TestCharShortByteSwap.java
0 → 100644
浏览文件 @
b8a0e79b
/*
* Copyright 2010 Google, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
/*
* @test
* @bug 6946040
* @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler
* @run main/othervm -Xbatch -server -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap
*/
// This test must run without any command line arguments.
public
class
TestCharShortByteSwap
{
private
static
short
initShort
(
String
[]
args
,
short
v
)
{
if
(
args
.
length
>
0
)
{
try
{
return
(
short
)
Integer
.
valueOf
(
args
[
0
]).
intValue
();
}
catch
(
NumberFormatException
e
)
{
}
}
return
v
;
}
private
static
char
initChar
(
String
[]
args
,
char
v
)
{
if
(
args
.
length
>
0
)
{
try
{
return
(
char
)
Integer
.
valueOf
(
args
[
0
]).
intValue
();
}
catch
(
NumberFormatException
e
)
{
}
}
return
v
;
}
private
static
void
testChar
(
char
a
,
char
b
)
{
if
(
a
!=
Character
.
reverseBytes
(
b
))
{
throw
new
RuntimeException
(
"FAIL: "
+
(
int
)
a
+
" != Character.reverseBytes("
+
(
int
)
b
+
")"
);
}
if
(
b
!=
Character
.
reverseBytes
(
a
))
{
throw
new
RuntimeException
(
"FAIL: "
+
(
int
)
b
+
" != Character.reverseBytes("
+
(
int
)
a
+
")"
);
}
}
private
static
void
testShort
(
short
a
,
short
b
)
{
if
(
a
!=
Short
.
reverseBytes
(
b
))
{
throw
new
RuntimeException
(
"FAIL: "
+
(
int
)
a
+
" != Short.reverseBytes("
+
(
int
)
b
+
")"
);
}
if
(
b
!=
Short
.
reverseBytes
(
a
))
{
throw
new
RuntimeException
(
"FAIL: "
+
(
int
)
b
+
" != Short.reverseBytes("
+
(
int
)
a
+
")"
);
}
}
public
static
void
main
(
String
[]
args
)
{
for
(
int
i
=
0
;
i
<
100000
;
++
i
)
{
// Trigger compilation
char
c1
=
initChar
(
args
,
(
char
)
0x0123
);
char
c2
=
initChar
(
args
,
(
char
)
0x2301
);
char
c3
=
initChar
(
args
,
(
char
)
0xaabb
);
char
c4
=
initChar
(
args
,
(
char
)
0xbbaa
);
short
s1
=
initShort
(
args
,
(
short
)
0x0123
);
short
s2
=
initShort
(
args
,
(
short
)
0x2301
);
short
s3
=
initShort
(
args
,
(
short
)
0xaabb
);
short
s4
=
initShort
(
args
,
(
short
)
0xbbaa
);
testChar
(
c1
,
c2
);
testChar
(
c3
,
c4
);
testShort
(
s1
,
s2
);
testShort
(
s3
,
s4
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录