Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_nashorn
提交
be79fb5b
D
dragonwell8_nashorn
项目概览
openanolis
/
dragonwell8_nashorn
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_nashorn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
be79fb5b
编写于
8月 26, 2015
作者:
A
attila
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8134403: Nashorn react.js benchmark performance regression
Reviewed-by: hannesw, sundar
上级
fbccf142
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
3 deletion
+22
-3
src/jdk/nashorn/internal/runtime/UserAccessorProperty.java
src/jdk/nashorn/internal/runtime/UserAccessorProperty.java
+22
-3
未找到文件。
src/jdk/nashorn/internal/runtime/UserAccessorProperty.java
浏览文件 @
be79fb5b
...
...
@@ -24,7 +24,6 @@
*/
package
jdk.nashorn.internal.runtime
;
import
static
jdk
.
nashorn
.
internal
.
lookup
.
Lookup
.
MH
;
import
static
jdk
.
nashorn
.
internal
.
runtime
.
ECMAErrors
.
typeError
;
import
static
jdk
.
nashorn
.
internal
.
runtime
.
ScriptRuntime
.
UNDEFINED
;
...
...
@@ -34,6 +33,7 @@ import static jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.CALL
import
java.lang.invoke.MethodHandle
;
import
java.lang.invoke.MethodHandles
;
import
java.lang.invoke.MethodType
;
import
java.util.concurrent.Callable
;
import
jdk.nashorn.internal.lookup.Lookup
;
import
jdk.nashorn.internal.runtime.linker.Bootstrap
;
import
jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor
;
...
...
@@ -80,6 +80,15 @@ public final class UserAccessorProperty extends SpillProperty {
private
final
static
MethodHandle
INVOKE_LONG_SETTER
=
findOwnMH_S
(
"invokeLongSetter"
,
void
.
class
,
Accessors
.
class
,
MethodHandle
.
class
,
String
.
class
,
Object
.
class
,
long
.
class
);
private
final
static
MethodHandle
INVOKE_NUMBER_SETTER
=
findOwnMH_S
(
"invokeNumberSetter"
,
void
.
class
,
Accessors
.
class
,
MethodHandle
.
class
,
String
.
class
,
Object
.
class
,
double
.
class
);
private
static
final
Object
OBJECT_GETTER_INVOKER_KEY
=
new
Object
();
private
static
MethodHandle
getObjectGetterInvoker
()
{
return
Context
.
getGlobal
().
getDynamicInvoker
(
OBJECT_GETTER_INVOKER_KEY
,
new
Callable
<
MethodHandle
>()
{
@Override
public
MethodHandle
call
()
throws
Exception
{
return
getINVOKE_UA_GETTER
(
Object
.
class
,
INVALID_PROGRAM_POINT
);
}
});
}
static
MethodHandle
getINVOKE_UA_GETTER
(
final
Class
<?>
returnType
,
final
int
programPoint
)
{
if
(
UnwarrantedOptimismException
.
isValid
(
programPoint
))
{
...
...
@@ -90,6 +99,16 @@ public final class UserAccessorProperty extends SpillProperty {
}
}
private
static
final
Object
OBJECT_SETTER_INVOKER_KEY
=
new
Object
();
private
static
MethodHandle
getObjectSetterInvoker
()
{
return
Context
.
getGlobal
().
getDynamicInvoker
(
OBJECT_SETTER_INVOKER_KEY
,
new
Callable
<
MethodHandle
>()
{
@Override
public
MethodHandle
call
()
throws
Exception
{
return
getINVOKE_UA_SETTER
(
Object
.
class
);
}
});
}
static
MethodHandle
getINVOKE_UA_SETTER
(
final
Class
<?>
valueType
)
{
return
Bootstrap
.
createDynamicInvoker
(
"dyn:call"
,
void
.
class
,
Object
.
class
,
Object
.
class
,
valueType
);
}
...
...
@@ -181,7 +200,7 @@ public final class UserAccessorProperty extends SpillProperty {
@Override
public
Object
getObjectValue
(
final
ScriptObject
self
,
final
ScriptObject
owner
)
{
try
{
return
invokeObjectGetter
(
getAccessors
((
owner
!=
null
)
?
owner
:
self
),
get
INVOKE_UA_GETTER
(
Object
.
class
,
INVALID_PROGRAM_POINT
),
self
);
return
invokeObjectGetter
(
getAccessors
((
owner
!=
null
)
?
owner
:
self
),
get
ObjectGetterInvoker
(
),
self
);
}
catch
(
final
Error
|
RuntimeException
t
)
{
throw
t
;
}
catch
(
final
Throwable
t
)
{
...
...
@@ -207,7 +226,7 @@ public final class UserAccessorProperty extends SpillProperty {
@Override
public
void
setValue
(
final
ScriptObject
self
,
final
ScriptObject
owner
,
final
Object
value
,
final
boolean
strict
)
{
try
{
invokeObjectSetter
(
getAccessors
((
owner
!=
null
)
?
owner
:
self
),
get
INVOKE_UA_SETTER
(
Object
.
class
),
strict
?
getKey
()
:
null
,
self
,
value
);
invokeObjectSetter
(
getAccessors
((
owner
!=
null
)
?
owner
:
self
),
get
ObjectSetterInvoker
(
),
strict
?
getKey
()
:
null
,
self
,
value
);
}
catch
(
final
Error
|
RuntimeException
t
)
{
throw
t
;
}
catch
(
final
Throwable
t
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录