Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
8a82836a
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,发现更多精彩内容 >>
提交
8a82836a
编写于
7月 07, 2015
作者:
S
sundar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8130663: 6 fields can be static fields in Global class
Reviewed-by: hannesw, attila
上级
60db28fa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
24 deletion
+23
-24
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java
...es/jdk/nashorn/internal/codegen/ObjectClassGenerator.java
+0
-1
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java
...rn/share/classes/jdk/nashorn/internal/objects/Global.java
+12
-12
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java
...lasses/jdk/nashorn/internal/runtime/CompiledFunction.java
+1
-1
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Property.java
.../share/classes/jdk/nashorn/internal/runtime/Property.java
+7
-7
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java
...are/classes/jdk/nashorn/internal/runtime/PropertyMap.java
+3
-3
未找到文件。
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ObjectClassGenerator.java
浏览文件 @
8a82836a
...
...
@@ -69,7 +69,6 @@ import jdk.nashorn.internal.runtime.UnwarrantedOptimismException;
import
jdk.nashorn.internal.runtime.logging.DebugLogger
;
import
jdk.nashorn.internal.runtime.logging.Loggable
;
import
jdk.nashorn.internal.runtime.logging.Logger
;
import
jdk.nashorn.internal.runtime.options.Options
;
/**
* Generates the ScriptObject subclass structure with fields for a user objects.
...
...
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/Global.java
浏览文件 @
8a82836a
...
...
@@ -88,14 +88,14 @@ import jdk.nashorn.tools.ShellFunctions;
*/
@ScriptClass
(
"Global"
)
public
final
class
Global
extends
Scope
{
// Placeholder value used in place of a location property (__FILE__, __DIR__, __LINE__)
private
static
final
Object
LOCATION_PROPERTY_PLACEHOLDER
=
new
Object
();
// This special value is used to flag a lazily initialized global property.
// This also serves as placeholder value used in place of a location property
// (__FILE__, __DIR__, __LINE__)
private
static
final
Object
LAZY_SENTINEL
=
new
Object
();
private
final
InvokeByName
TO_STRING
=
new
InvokeByName
(
"toString"
,
ScriptObject
.
class
);
private
final
InvokeByName
VALUE_OF
=
new
InvokeByName
(
"valueOf"
,
ScriptObject
.
class
);
// placeholder value for lazily initialized global objects
private
static
final
Object
LAZY_SENTINEL
=
new
Object
();
/**
* Optimistic builtin names that require switchpoint invalidation
* upon assignment. Overly conservative, but works for now, to avoid
...
...
@@ -182,15 +182,15 @@ public final class Global extends Scope {
/** Value property NaN of the Global Object - ECMA 15.1.1.1 NaN */
@Property
(
attributes
=
Attribute
.
NON_ENUMERABLE_CONSTANT
)
public
final
double
NaN
=
Double
.
NaN
;
public
static
final
double
NaN
=
Double
.
NaN
;
/** Value property Infinity of the Global Object - ECMA 15.1.1.2 Infinity */
@Property
(
attributes
=
Attribute
.
NON_ENUMERABLE_CONSTANT
)
public
final
double
Infinity
=
Double
.
POSITIVE_INFINITY
;
public
static
final
double
Infinity
=
Double
.
POSITIVE_INFINITY
;
/** Value property Undefined of the Global Object - ECMA 15.1.1.3 Undefined */
@Property
(
attributes
=
Attribute
.
NON_ENUMERABLE_CONSTANT
)
public
final
Object
undefined
=
UNDEFINED
;
public
static
final
Object
undefined
=
UNDEFINED
;
/** ECMA 15.1.2.1 eval(x) */
@Property
(
attributes
=
Attribute
.
NOT_ENUMERABLE
)
...
...
@@ -830,15 +830,15 @@ public final class Global extends Scope {
/** Nashorn extension: current script's file name */
@Property
(
name
=
"__FILE__"
,
attributes
=
Attribute
.
NON_ENUMERABLE_CONSTANT
)
public
final
Object
__FILE__
=
LOCATION_PROPERTY_PLACEHOLDER
;
public
static
final
Object
__FILE__
=
LAZY_SENTINEL
;
/** Nashorn extension: current script's directory */
@Property
(
name
=
"__DIR__"
,
attributes
=
Attribute
.
NON_ENUMERABLE_CONSTANT
)
public
final
Object
__DIR__
=
LOCATION_PROPERTY_PLACEHOLDER
;
public
static
final
Object
__DIR__
=
LAZY_SENTINEL
;
/** Nashorn extension: current source line number being executed */
@Property
(
name
=
"__LINE__"
,
attributes
=
Attribute
.
NON_ENUMERABLE_CONSTANT
)
public
final
Object
__LINE__
=
LOCATION_PROPERTY_PLACEHOLDER
;
public
static
final
Object
__LINE__
=
LAZY_SENTINEL
;
private
volatile
NativeDate
DEFAULT_DATE
;
...
...
@@ -2020,7 +2020,7 @@ public final class Global extends Scope {
* @return true if the value is a placeholder, false otherwise.
*/
public
static
boolean
isLocationPropertyPlaceholder
(
final
Object
placeholder
)
{
return
placeholder
==
L
OCATION_PROPERTY_PLACEHOLDER
;
return
placeholder
==
L
AZY_SENTINEL
;
}
/**
...
...
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CompiledFunction.java
浏览文件 @
8a82836a
...
...
@@ -907,7 +907,7 @@ final class CompiledFunction {
OptimismInfo
(
final
RecompilableScriptFunctionData
data
,
final
Map
<
Integer
,
Type
>
invalidatedProgramPoints
)
{
this
.
data
=
data
;
this
.
log
=
data
.
getLogger
();
this
.
invalidatedProgramPoints
=
invalidatedProgramPoints
==
null
?
new
TreeMap
<
Integer
,
Type
>()
:
invalidatedProgramPoints
;
this
.
invalidatedProgramPoints
=
invalidatedProgramPoints
==
null
?
new
TreeMap
<>()
:
invalidatedProgramPoints
;
newOptimisticAssumptions
();
}
...
...
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Property.java
浏览文件 @
8a82836a
...
...
@@ -562,8 +562,8 @@ public abstract class Property implements Serializable {
@Override
public
int
hashCode
()
{
final
Class
<?>
t
ype
=
getLocalType
();
return
Objects
.
hashCode
(
this
.
key
)
^
flags
^
getSlot
()
^
(
t
ype
==
null
?
0
:
type
.
hashCode
());
final
Class
<?>
t
=
getLocalType
();
return
Objects
.
hashCode
(
this
.
key
)
^
flags
^
getSlot
()
^
(
t
==
null
?
0
:
t
.
hashCode
());
}
@Override
...
...
@@ -588,7 +588,7 @@ public abstract class Property implements Serializable {
getKey
().
equals
(
otherProperty
.
getKey
());
}
private
static
final
String
type
(
final
Class
<?>
type
)
{
private
static
String
type
(
final
Class
<?>
type
)
{
if
(
type
==
null
)
{
return
"undef"
;
}
else
if
(
type
==
int
.
class
)
{
...
...
@@ -608,8 +608,8 @@ public abstract class Property implements Serializable {
*/
public
final
String
toStringShort
()
{
final
StringBuilder
sb
=
new
StringBuilder
();
final
Class
<?>
t
ype
=
getLocalType
();
sb
.
append
(
getKey
()).
append
(
" ("
).
append
(
type
(
t
ype
)).
append
(
')'
);
final
Class
<?>
t
=
getLocalType
();
sb
.
append
(
getKey
()).
append
(
" ("
).
append
(
type
(
t
)).
append
(
')'
);
return
sb
.
toString
();
}
...
...
@@ -625,7 +625,7 @@ public abstract class Property implements Serializable {
@Override
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
();
final
Class
<?>
t
ype
=
getLocalType
();
final
Class
<?>
t
=
getLocalType
();
sb
.
append
(
indent
(
getKey
(),
20
)).
append
(
" id="
).
...
...
@@ -635,7 +635,7 @@ public abstract class Property implements Serializable {
append
(
") "
).
append
(
getClass
().
getSimpleName
()).
append
(
" {"
).
append
(
indent
(
type
(
t
ype
),
5
)).
append
(
indent
(
type
(
t
),
5
)).
append
(
'}'
);
if
(
slot
!=
-
1
)
{
...
...
nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/PropertyMap.java
浏览文件 @
8a82836a
...
...
@@ -999,10 +999,10 @@ public final class PropertyMap implements Iterable<Object>, Serializable {
for
(
final
Property
p
:
map0
.
getProperties
())
{
final
Property
p2
=
map1
.
findProperty
(
p
.
getKey
());
if
(
p2
==
null
)
{
sb
.
append
(
"FIRST ONLY : ["
+
p
+
"]"
);
sb
.
append
(
"FIRST ONLY : ["
).
append
(
p
).
append
(
"]"
);
found
=
true
;
}
else
if
(
p2
!=
p
)
{
sb
.
append
(
"DIFFERENT : ["
+
p
+
"] != ["
+
p2
+
"]"
);
sb
.
append
(
"DIFFERENT : ["
).
append
(
p
).
append
(
"] != ["
).
append
(
p2
).
append
(
"]"
);
found
=
true
;
}
}
...
...
@@ -1010,7 +1010,7 @@ public final class PropertyMap implements Iterable<Object>, Serializable {
for
(
final
Property
p2
:
map1
.
getProperties
())
{
final
Property
p1
=
map0
.
findProperty
(
p2
.
getKey
());
if
(
p1
==
null
)
{
sb
.
append
(
"SECOND ONLY: ["
+
p2
+
"]"
);
sb
.
append
(
"SECOND ONLY: ["
).
append
(
p2
).
append
(
"]"
);
found
=
true
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录