Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5d922105
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5d922105
编写于
8月 22, 2014
作者:
B
bpb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8055785: Modifications of I/O methods for instrumentation purposes
Summary: Wrap some native methods in Java methods. Reviewed-by: rriggs
上级
cc3bab51
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
76 addition
and
19 deletion
+76
-19
make/mapfiles/libjava/mapfile-vers
make/mapfiles/libjava/mapfile-vers
+3
-3
make/mapfiles/libjava/reorder-sparc
make/mapfiles/libjava/reorder-sparc
+1
-1
make/mapfiles/libjava/reorder-sparcv9
make/mapfiles/libjava/reorder-sparcv9
+1
-1
make/mapfiles/libjava/reorder-x86
make/mapfiles/libjava/reorder-x86
+2
-2
src/share/classes/java/io/FileInputStream.java
src/share/classes/java/io/FileInputStream.java
+10
-1
src/share/classes/java/io/FileOutputStream.java
src/share/classes/java/io/FileOutputStream.java
+12
-1
src/share/classes/java/io/RandomAccessFile.java
src/share/classes/java/io/RandomAccessFile.java
+18
-1
src/share/classes/java/net/SocketInputStream.java
src/share/classes/java/net/SocketInputStream.java
+22
-2
src/share/native/java/io/FileInputStream.c
src/share/native/java/io/FileInputStream.c
+1
-1
src/share/native/java/io/RandomAccessFile.c
src/share/native/java/io/RandomAccessFile.c
+2
-2
src/solaris/native/java/io/FileOutputStream_md.c
src/solaris/native/java/io/FileOutputStream_md.c
+2
-2
src/windows/native/java/io/FileOutputStream_md.c
src/windows/native/java/io/FileOutputStream_md.c
+2
-2
未找到文件。
make/mapfiles/libjava/mapfile-vers
浏览文件 @
5d922105
...
@@ -78,13 +78,13 @@ SUNWprivate_1.1 {
...
@@ -78,13 +78,13 @@ SUNWprivate_1.1 {
Java_java_io_FileInputStream_available;
Java_java_io_FileInputStream_available;
Java_java_io_FileInputStream_close0;
Java_java_io_FileInputStream_close0;
Java_java_io_FileInputStream_initIDs;
Java_java_io_FileInputStream_initIDs;
Java_java_io_FileInputStream_open;
Java_java_io_FileInputStream_open
0
;
Java_java_io_FileInputStream_read0;
Java_java_io_FileInputStream_read0;
Java_java_io_FileInputStream_readBytes;
Java_java_io_FileInputStream_readBytes;
Java_java_io_FileInputStream_skip;
Java_java_io_FileInputStream_skip;
Java_java_io_FileOutputStream_close0;
Java_java_io_FileOutputStream_close0;
Java_java_io_FileOutputStream_initIDs;
Java_java_io_FileOutputStream_initIDs;
Java_java_io_FileOutputStream_open;
Java_java_io_FileOutputStream_open
0
;
Java_java_io_FileOutputStream_write;
Java_java_io_FileOutputStream_write;
Java_java_io_FileOutputStream_writeBytes;
Java_java_io_FileOutputStream_writeBytes;
Java_java_io_ObjectInputStream_bytesToDoubles;
Java_java_io_ObjectInputStream_bytesToDoubles;
...
@@ -97,7 +97,7 @@ SUNWprivate_1.1 {
...
@@ -97,7 +97,7 @@ SUNWprivate_1.1 {
Java_java_io_RandomAccessFile_getFilePointer;
Java_java_io_RandomAccessFile_getFilePointer;
Java_java_io_RandomAccessFile_initIDs;
Java_java_io_RandomAccessFile_initIDs;
Java_java_io_RandomAccessFile_length;
Java_java_io_RandomAccessFile_length;
Java_java_io_RandomAccessFile_open;
Java_java_io_RandomAccessFile_open
0
;
Java_java_io_RandomAccessFile_read0;
Java_java_io_RandomAccessFile_read0;
Java_java_io_RandomAccessFile_readBytes;
Java_java_io_RandomAccessFile_readBytes;
Java_java_io_RandomAccessFile_seek0;
Java_java_io_RandomAccessFile_seek0;
...
...
make/mapfiles/libjava/reorder-sparc
浏览文件 @
5d922105
...
@@ -44,7 +44,7 @@ text: .text%Java_java_io_UnixFileSystem_initIDs;
...
@@ -44,7 +44,7 @@ text: .text%Java_java_io_UnixFileSystem_initIDs;
text: .text%Java_java_io_UnixFileSystem_canonicalize;
text: .text%Java_java_io_UnixFileSystem_canonicalize;
text: .text%JNU_GetStringPlatformChars;
text: .text%JNU_GetStringPlatformChars;
text: .text%JNU_ReleaseStringPlatformChars;
text: .text%JNU_ReleaseStringPlatformChars;
text: .text%Java_java_io_FileInputStream_open;
text: .text%Java_java_io_FileInputStream_open
0
;
text: .text%fileOpen;
text: .text%fileOpen;
text: .text%Java_java_io_FileInputStream_readBytes;
text: .text%Java_java_io_FileInputStream_readBytes;
text: .text%readBytes;
text: .text%readBytes;
...
...
make/mapfiles/libjava/reorder-sparcv9
浏览文件 @
5d922105
...
@@ -47,7 +47,7 @@ text: .text%Java_java_io_UnixFileSystem_initIDs;
...
@@ -47,7 +47,7 @@ text: .text%Java_java_io_UnixFileSystem_initIDs;
text: .text%Java_java_io_UnixFileSystem_canonicalize;
text: .text%Java_java_io_UnixFileSystem_canonicalize;
text: .text%JNU_GetStringPlatformChars;
text: .text%JNU_GetStringPlatformChars;
text: .text%JNU_ReleaseStringPlatformChars;
text: .text%JNU_ReleaseStringPlatformChars;
text: .text%Java_java_io_FileInputStream_open;
text: .text%Java_java_io_FileInputStream_open
0
;
text: .text%fileOpen;
text: .text%fileOpen;
text: .text%Java_java_io_FileInputStream_readBytes;
text: .text%Java_java_io_FileInputStream_readBytes;
text: .text%readBytes;
text: .text%readBytes;
...
...
make/mapfiles/libjava/reorder-x86
浏览文件 @
5d922105
...
@@ -57,7 +57,7 @@ text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
...
@@ -57,7 +57,7 @@ text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load;
text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_find;
text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_find;
text: .text%Java_java_lang_Float_floatToIntBits;
text: .text%Java_java_lang_Float_floatToIntBits;
text: .text%Java_java_lang_Double_doubleToLongBits;
text: .text%Java_java_lang_Double_doubleToLongBits;
text: .text%Java_java_io_FileInputStream_open;
text: .text%Java_java_io_FileInputStream_open
0
;
text: .text%fileOpen;
text: .text%fileOpen;
text: .text%Java_java_io_UnixFileSystem_getLength;
text: .text%Java_java_io_UnixFileSystem_getLength;
text: .text%Java_java_io_FileInputStream_readBytes;
text: .text%Java_java_io_FileInputStream_readBytes;
...
@@ -90,7 +90,7 @@ text: .text%JNU_NotifyAll;
...
@@ -90,7 +90,7 @@ text: .text%JNU_NotifyAll;
text: .text%JNU_CallMethodByName;
text: .text%JNU_CallMethodByName;
text: .text%JNU_CallMethodByNameV;
text: .text%JNU_CallMethodByNameV;
text: .text%Java_java_util_logging_FileHandler_lockFile;
text: .text%Java_java_util_logging_FileHandler_lockFile;
text: .text%Java_java_io_FileOutputStream_open;
text: .text%Java_java_io_FileOutputStream_open
0
;
text: .text%Java_java_io_UnixFileSystem_createDirectory;
text: .text%Java_java_io_UnixFileSystem_createDirectory;
text: .text%Java_java_io_UnixFileSystem_getLastModifiedTime;
text: .text%Java_java_io_UnixFileSystem_getLastModifiedTime;
text: .text%Java_java_util_prefs_FileSystemPreferences_lockFile0;
text: .text%Java_java_util_prefs_FileSystemPreferences_lockFile0;
...
...
src/share/classes/java/io/FileInputStream.java
浏览文件 @
5d922105
...
@@ -184,7 +184,16 @@ class FileInputStream extends InputStream
...
@@ -184,7 +184,16 @@ class FileInputStream extends InputStream
* Opens the specified file for reading.
* Opens the specified file for reading.
* @param name the name of the file
* @param name the name of the file
*/
*/
private
native
void
open
(
String
name
)
throws
FileNotFoundException
;
private
native
void
open0
(
String
name
)
throws
FileNotFoundException
;
// wrap native call to allow instrumentation
/**
* Opens the specified file for reading.
* @param name the name of the file
*/
private
void
open
(
String
name
)
throws
FileNotFoundException
{
open0
(
name
);
}
/**
/**
* Reads a byte of data from this input stream. This method blocks
* Reads a byte of data from this input stream. This method blocks
...
...
src/share/classes/java/io/FileOutputStream.java
浏览文件 @
5d922105
...
@@ -256,9 +256,20 @@ class FileOutputStream extends OutputStream
...
@@ -256,9 +256,20 @@ class FileOutputStream extends OutputStream
* @param name name of file to be opened
* @param name name of file to be opened
* @param append whether the file is to be opened in append mode
* @param append whether the file is to be opened in append mode
*/
*/
private
native
void
open
(
String
name
,
boolean
append
)
private
native
void
open
0
(
String
name
,
boolean
append
)
throws
FileNotFoundException
;
throws
FileNotFoundException
;
// wrap native call to allow instrumentation
/**
* Opens a file, with the specified name, for overwriting or appending.
* @param name name of file to be opened
* @param append whether the file is to be opened in append mode
*/
private
void
open
(
String
name
,
boolean
append
)
throws
FileNotFoundException
{
open0
(
name
,
append
);
}
/**
/**
* Writes the specified byte to this file output stream.
* Writes the specified byte to this file output stream.
*
*
...
...
src/share/classes/java/io/RandomAccessFile.java
浏览文件 @
5d922105
...
@@ -296,9 +296,26 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
...
@@ -296,9 +296,26 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* @param mode the mode flags, a combination of the O_ constants
* @param mode the mode flags, a combination of the O_ constants
* defined above
* defined above
*/
*/
private
native
void
open
(
String
name
,
int
mode
)
private
native
void
open
0
(
String
name
,
int
mode
)
throws
FileNotFoundException
;
throws
FileNotFoundException
;
// wrap native call to allow instrumentation
/**
* Opens a file and returns the file descriptor. The file is
* opened in read-write mode if the O_RDWR bit in {@code mode}
* is true, else the file is opened as read-only.
* If the {@code name} refers to a directory, an IOException
* is thrown.
*
* @param name the name of the file
* @param mode the mode flags, a combination of the O_ constants
* defined above
*/
private
void
open
(
String
name
,
int
mode
)
throws
FileNotFoundException
{
open0
(
name
,
mode
);
}
// 'Read' primitives
// 'Read' primitives
/**
/**
...
...
src/share/classes/java/net/SocketInputStream.java
浏览文件 @
5d922105
...
@@ -96,6 +96,26 @@ class SocketInputStream extends FileInputStream
...
@@ -96,6 +96,26 @@ class SocketInputStream extends FileInputStream
int
timeout
)
int
timeout
)
throws
IOException
;
throws
IOException
;
// wrap native call to allow instrumentation
/**
* Reads into an array of bytes at the specified offset using
* the received socket primitive.
* @param fd the FileDescriptor
* @param b the buffer into which the data is read
* @param off the start offset of the data
* @param len the maximum number of bytes read
* @param timeout the read timeout in ms
* @return the actual number of bytes read, -1 is
* returned when the end of the stream is reached.
* @exception IOException If an I/O error has occurred.
*/
private
int
socketRead
(
FileDescriptor
fd
,
byte
b
[],
int
off
,
int
len
,
int
timeout
)
throws
IOException
{
return
socketRead0
(
fd
,
b
,
off
,
len
,
timeout
);
}
/**
/**
* Reads into a byte array data from the socket.
* Reads into a byte array data from the socket.
* @param b the buffer into which the data is read
* @param b the buffer into which the data is read
...
@@ -147,7 +167,7 @@ class SocketInputStream extends FileInputStream
...
@@ -147,7 +167,7 @@ class SocketInputStream extends FileInputStream
// acquire file descriptor and do the read
// acquire file descriptor and do the read
FileDescriptor
fd
=
impl
.
acquireFD
();
FileDescriptor
fd
=
impl
.
acquireFD
();
try
{
try
{
n
=
socketRead
0
(
fd
,
b
,
off
,
length
,
timeout
);
n
=
socketRead
(
fd
,
b
,
off
,
length
,
timeout
);
if
(
n
>
0
)
{
if
(
n
>
0
)
{
return
n
;
return
n
;
}
}
...
@@ -165,7 +185,7 @@ class SocketInputStream extends FileInputStream
...
@@ -165,7 +185,7 @@ class SocketInputStream extends FileInputStream
impl
.
setConnectionResetPending
();
impl
.
setConnectionResetPending
();
impl
.
acquireFD
();
impl
.
acquireFD
();
try
{
try
{
n
=
socketRead
0
(
fd
,
b
,
off
,
length
,
timeout
);
n
=
socketRead
(
fd
,
b
,
off
,
length
,
timeout
);
if
(
n
>
0
)
{
if
(
n
>
0
)
{
return
n
;
return
n
;
}
}
...
...
src/share/native/java/io/FileInputStream.c
浏览文件 @
5d922105
...
@@ -57,7 +57,7 @@ Java_java_io_FileInputStream_initIDs(JNIEnv *env, jclass fdClass) {
...
@@ -57,7 +57,7 @@ Java_java_io_FileInputStream_initIDs(JNIEnv *env, jclass fdClass) {
*/
*/
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
Java_java_io_FileInputStream_open
(
JNIEnv
*
env
,
jobject
this
,
jstring
path
)
{
Java_java_io_FileInputStream_open
0
(
JNIEnv
*
env
,
jobject
this
,
jstring
path
)
{
fileOpen
(
env
,
this
,
path
,
fis_fd
,
O_RDONLY
);
fileOpen
(
env
,
this
,
path
,
fis_fd
,
O_RDONLY
);
}
}
...
...
src/share/native/java/io/RandomAccessFile.c
浏览文件 @
5d922105
...
@@ -47,8 +47,8 @@ Java_java_io_RandomAccessFile_initIDs(JNIEnv *env, jclass fdClass) {
...
@@ -47,8 +47,8 @@ Java_java_io_RandomAccessFile_initIDs(JNIEnv *env, jclass fdClass) {
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
Java_java_io_RandomAccessFile_open
(
JNIEnv
*
env
,
Java_java_io_RandomAccessFile_open
0
(
JNIEnv
*
env
,
jobject
this
,
jstring
path
,
jint
mode
)
jobject
this
,
jstring
path
,
jint
mode
)
{
{
int
flags
=
0
;
int
flags
=
0
;
if
(
mode
&
java_io_RandomAccessFile_O_RDONLY
)
if
(
mode
&
java_io_RandomAccessFile_O_RDONLY
)
...
...
src/solaris/native/java/io/FileOutputStream_md.c
浏览文件 @
5d922105
...
@@ -53,8 +53,8 @@ Java_java_io_FileOutputStream_initIDs(JNIEnv *env, jclass fdClass) {
...
@@ -53,8 +53,8 @@ Java_java_io_FileOutputStream_initIDs(JNIEnv *env, jclass fdClass) {
*/
*/
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
Java_java_io_FileOutputStream_open
(
JNIEnv
*
env
,
jobject
this
,
Java_java_io_FileOutputStream_open
0
(
JNIEnv
*
env
,
jobject
this
,
jstring
path
,
jboolean
append
)
{
jstring
path
,
jboolean
append
)
{
fileOpen
(
env
,
this
,
path
,
fos_fd
,
fileOpen
(
env
,
this
,
path
,
fos_fd
,
O_WRONLY
|
O_CREAT
|
(
append
?
O_APPEND
:
O_TRUNC
));
O_WRONLY
|
O_CREAT
|
(
append
?
O_APPEND
:
O_TRUNC
));
}
}
...
...
src/windows/native/java/io/FileOutputStream_md.c
浏览文件 @
5d922105
...
@@ -54,8 +54,8 @@ Java_java_io_FileOutputStream_initIDs(JNIEnv *env, jclass fosClass) {
...
@@ -54,8 +54,8 @@ Java_java_io_FileOutputStream_initIDs(JNIEnv *env, jclass fosClass) {
*/
*/
JNIEXPORT
void
JNICALL
JNIEXPORT
void
JNICALL
Java_java_io_FileOutputStream_open
(
JNIEnv
*
env
,
jobject
this
,
Java_java_io_FileOutputStream_open
0
(
JNIEnv
*
env
,
jobject
this
,
jstring
path
,
jboolean
append
)
{
jstring
path
,
jboolean
append
)
{
fileOpen
(
env
,
this
,
path
,
fos_fd
,
fileOpen
(
env
,
this
,
path
,
fos_fd
,
O_WRONLY
|
O_CREAT
|
(
append
?
O_APPEND
:
O_TRUNC
));
O_WRONLY
|
O_CREAT
|
(
append
?
O_APPEND
:
O_TRUNC
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录