src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MethodEmitter.java
Print this page
*** 1589,1599 ****
}
/**
* Abstraction for performing a conditional jump of any type
*
! * @see MethodEmitter.Condition
*
* @param cond the condition to test
* @param trueLabel the destination label is condition is true
*/
void conditionalJump(final Condition cond, final Label trueLabel) {
--- 1589,1599 ----
}
/**
* Abstraction for performing a conditional jump of any type
*
! * @see Condition
*
* @param cond the condition to test
* @param trueLabel the destination label is condition is true
*/
void conditionalJump(final Condition cond, final Label trueLabel) {
*** 2215,2224 ****
--- 2215,2228 ----
* @param isMethod should it prefer retrieving methods
*
* @return the method emitter
*/
MethodEmitter dynamicGet(final Type valueType, final String name, final int flags, final boolean isMethod) {
+ if (name.length() > LARGE_STRING_THRESHOLD) { // use getIndex for extremely long names
+ return load(name).dynamicGetIndex(valueType, flags, isMethod);
+ }
+
debug("dynamic_get", name, valueType, getProgramPoint(flags));
Type type = valueType;
if (type.isObject() || type.isBoolean()) {
type = Type.OBJECT; //promote e.g strings to object generic setter
*** 2239,2248 ****
--- 2243,2257 ----
*
* @param name name of property
* @param flags call site flags
*/
void dynamicSet(final String name, final int flags) {
+ if (name.length() > LARGE_STRING_THRESHOLD) { // use setIndex for extremely long names
+ load(name).swap().dynamicSetIndex(flags);
+ return;
+ }
+
assert !isOptimistic(flags);
debug("dynamic_set", name, peekType());
Type type = peekType();
if (type.isObject() || type.isBoolean()) { //promote strings to objects etc