Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
7e230542
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7e230542
编写于
4月 12, 2018
作者:
R
redestad
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8201494: Avoid early initialization of java.nio.Bits
Reviewed-by: rriggs, alanb
上级
d2b9303d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
17 deletion
+12
-17
src/java.base/share/classes/java/nio/Bits.java
src/java.base/share/classes/java/nio/Bits.java
+1
-13
src/java.base/share/classes/java/nio/Buffer.java
src/java.base/share/classes/java/nio/Buffer.java
+1
-1
src/java.base/share/classes/java/nio/ByteOrder.java
src/java.base/share/classes/java/nio/ByteOrder.java
+8
-1
src/java.base/share/classes/java/nio/X-Buffer.java.template
src/java.base/share/classes/java/nio/X-Buffer.java.template
+2
-2
未找到文件。
src/java.base/share/classes/java/nio/Bits.java
浏览文件 @
7e230542
...
...
@@ -65,25 +65,13 @@ class Bits { // package-private
private
static
final
Unsafe
UNSAFE
=
Unsafe
.
getUnsafe
();
static
Unsafe
unsafe
()
{
return
UNSAFE
;
}
// -- Processor and memory-system properties --
private
static
final
ByteOrder
BYTE_ORDER
=
UNSAFE
.
isBigEndian
()
?
ByteOrder
.
BIG_ENDIAN
:
ByteOrder
.
LITTLE_ENDIAN
;
static
ByteOrder
byteOrder
()
{
return
BYTE_ORDER
;
}
private
static
int
PAGE_SIZE
=
-
1
;
static
int
pageSize
()
{
if
(
PAGE_SIZE
==
-
1
)
PAGE_SIZE
=
unsafe
()
.
pageSize
();
PAGE_SIZE
=
UNSAFE
.
pageSize
();
return
PAGE_SIZE
;
}
...
...
src/java.base/share/classes/java/nio/Buffer.java
浏览文件 @
7e230542
...
...
@@ -183,7 +183,7 @@ import java.util.Spliterator;
public
abstract
class
Buffer
{
// Cached unsafe-access object
static
final
Unsafe
UNSAFE
=
Bits
.
u
nsafe
();
static
final
Unsafe
UNSAFE
=
Unsafe
.
getU
nsafe
();
/**
* The characteristics of Spliterators that traverse and split elements
...
...
src/java.base/share/classes/java/nio/ByteOrder.java
浏览文件 @
7e230542
...
...
@@ -25,6 +25,7 @@
package
java.nio
;
import
jdk.internal.misc.Unsafe
;
/**
* A typesafe enumeration for byte orders.
...
...
@@ -57,6 +58,12 @@ public final class ByteOrder {
public
static
final
ByteOrder
LITTLE_ENDIAN
=
new
ByteOrder
(
"LITTLE_ENDIAN"
);
// Retrieve the native byte order. It's used early during bootstrap, and
// must be initialized after BIG_ENDIAN and LITTLE_ENDIAN.
private
static
final
ByteOrder
NATIVE_ORDER
=
Unsafe
.
getUnsafe
().
isBigEndian
()
?
ByteOrder
.
BIG_ENDIAN
:
ByteOrder
.
LITTLE_ENDIAN
;
/**
* Retrieves the native byte order of the underlying platform.
*
...
...
@@ -69,7 +76,7 @@ public final class ByteOrder {
* virtual machine is running
*/
public
static
ByteOrder
nativeOrder
()
{
return
Bits
.
byteOrder
()
;
return
NATIVE_ORDER
;
}
/**
...
...
src/java.base/share/classes/java/nio/X-Buffer.java.template
浏览文件 @
7e230542
...
...
@@ -1579,7 +1579,7 @@ public abstract class $Type$Buffer
boolean
bigEndian
//
package
-
private
=
true
;
boolean
nativeByteOrder
//
package
-
private
=
(
B
its
.
byt
eOrder
()
==
ByteOrder
.
BIG_ENDIAN
);
=
(
B
yteOrder
.
nativ
eOrder
()
==
ByteOrder
.
BIG_ENDIAN
);
/**
*
Retrieves
this
buffer
's byte order.
...
...
@@ -1608,7 +1608,7 @@ public abstract class $Type$Buffer
public final $Type$Buffer order(ByteOrder bo) {
bigEndian = (bo == ByteOrder.BIG_ENDIAN);
nativeByteOrder =
(bigEndian == (B
its.byt
eOrder() == ByteOrder.BIG_ENDIAN));
(bigEndian == (B
yteOrder.nativ
eOrder() == ByteOrder.BIG_ENDIAN));
return this;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录