private static boolean doShallowEquals(Object[] stack, double[] sDbl, int stackTop) { Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; final Object DBL_MRK = DOUBLE_MARK; double rdbl, ldbl; if (rhs == DBL_MRK) { rdbl = sDbl[stackTop + 1]; if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; } else if (lhs instanceof Number) { ldbl = ((Number)lhs).doubleValue(); } else { return false; } } else if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; if (rhs instanceof Number) { rdbl = ((Number)rhs).doubleValue(); } else { return false; } } else { return ScriptRuntime.shallowEq(lhs, rhs); } return (ldbl == rdbl); }
private static boolean shallowEquals(Object[] stack, double[] sDbl, int stackTop) { Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; final Object DBL_MRK = UniqueTag.DOUBLE_MARK; double rdbl, ldbl; if (rhs == DBL_MRK) { rdbl = sDbl[stackTop + 1]; if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; } else if (lhs instanceof Number) { ldbl = ((Number)lhs).doubleValue(); } else { return false; } } else if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; if (rhs == DBL_MRK) { rdbl = sDbl[stackTop + 1]; } else if (rhs instanceof Number) { rdbl = ((Number)rhs).doubleValue(); } else { return false; } } else { return ScriptRuntime.shallowEq(lhs, rhs); } return (ldbl == rdbl); }
private static boolean doShallowEquals(Object[] stack, double[] sDbl, int stackTop) { Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; final Object DBL_MRK = DOUBLE_MARK; double rdbl, ldbl; if (rhs == DBL_MRK) { rdbl = sDbl[stackTop + 1]; if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; } else if (lhs instanceof Number) { ldbl = ((Number)lhs).doubleValue(); } else { return false; } } else if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; if (rhs instanceof Number) { rdbl = ((Number)rhs).doubleValue(); } else { return false; } } else { return ScriptRuntime.shallowEq(lhs, rhs); } return (ldbl == rdbl); }
private static boolean doShallowEquals(Object[] stack, double[] sDbl, int stackTop) { Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; final Object DBL_MRK = DOUBLE_MARK; double rdbl, ldbl; if (rhs == DBL_MRK) { rdbl = sDbl[stackTop + 1]; if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; } else if (lhs instanceof Number) { ldbl = ((Number)lhs).doubleValue(); } else { return false; } } else if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; if (rhs instanceof Number) { rdbl = ((Number)rhs).doubleValue(); } else { return false; } } else { return ScriptRuntime.shallowEq(lhs, rhs); } return (ldbl == rdbl); }
private static boolean doShallowEquals(Object[] stack, double[] sDbl, int stackTop) { Object rhs = stack[stackTop + 1]; Object lhs = stack[stackTop]; final Object DBL_MRK = DOUBLE_MARK; double rdbl, ldbl; if (rhs == DBL_MRK) { rdbl = sDbl[stackTop + 1]; if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; } else if (lhs instanceof Number) { ldbl = ((Number)lhs).doubleValue(); } else { return false; } } else if (lhs == DBL_MRK) { ldbl = sDbl[stackTop]; if (rhs instanceof Number) { rdbl = ((Number)rhs).doubleValue(); } else { return false; } } else { return ScriptRuntime.shallowEq(lhs, rhs); } return (ldbl == rdbl); }
/** * Implements SameValue as described in ES5 9.12, additionally checking * if new value is defined. * @param newValue the new value * @param currentValue the current value * @return true if values are the same as defined by ES5 9.12 */ protected boolean sameValue(Object newValue, Object currentValue) { if (newValue == NOT_FOUND) { return true; } if (currentValue == NOT_FOUND) { currentValue = Undefined.instance; } // Special rules for numbers: NaN is considered the same value, // while zeroes with different signs are considered different. if (currentValue instanceof Number && newValue instanceof Number) { double d1 = ((Number)currentValue).doubleValue(); double d2 = ((Number)newValue).doubleValue(); if (Double.isNaN(d1) && Double.isNaN(d2)) { return true; } if (d1 == 0.0 && Double.doubleToLongBits(d1) != Double.doubleToLongBits(d2)) { return false; } } return ScriptRuntime.shallowEq(currentValue, newValue); }
/** * Implements SameValue as described in ES5 9.12, additionally checking * if new value is defined. * @param newValue the new value * @param currentValue the current value * @return true if values are the same as defined by ES5 9.12 */ protected boolean sameValue(Object newValue, Object currentValue) { if (newValue == NOT_FOUND) { return true; } if (currentValue == NOT_FOUND) { currentValue = Undefined.instance; } // Special rules for numbers: NaN is considered the same value, // while zeroes with different signs are considered different. if (currentValue instanceof Number && newValue instanceof Number) { double d1 = ((Number)currentValue).doubleValue(); double d2 = ((Number)newValue).doubleValue(); if (Double.isNaN(d1) && Double.isNaN(d2)) { return true; } if (d1 == 0.0 && Double.doubleToLongBits(d1) != Double.doubleToLongBits(d2)) { return false; } } return ScriptRuntime.shallowEq(currentValue, newValue); }
/** * Implements SameValue as described in ES5 9.12, additionally checking * if new value is defined. * @param newValue the new value * @param currentValue the current value * @return true if values are the same as defined by ES5 9.12 */ protected boolean sameValue(Object newValue, Object currentValue) { if (newValue == NOT_FOUND) { return true; } if (currentValue == NOT_FOUND) { currentValue = Undefined.instance; } // Special rules for numbers: NaN is considered the same value, // while zeroes with different signs are considered different. if (currentValue instanceof Number && newValue instanceof Number) { double d1 = ((Number)currentValue).doubleValue(); double d2 = ((Number)newValue).doubleValue(); if (Double.isNaN(d1) && Double.isNaN(d2)) { return true; } if (d1 == 0.0 && Double.doubleToLongBits(d1) != Double.doubleToLongBits(d2)) { return false; } } return ScriptRuntime.shallowEq(currentValue, newValue); }
/** * Implements SameValue as described in ES5 9.12, additionally checking * if new value is defined. * @param newValue the new value * @param currentValue the current value * @return true if values are the same as defined by ES5 9.12 */ protected boolean sameValue(Object newValue, Object currentValue) { if (newValue == NOT_FOUND) { return true; } if (currentValue == NOT_FOUND) { currentValue = Undefined.instance; } // Special rules for numbers: NaN is considered the same value, // while zeroes with different signs are considered different. if (currentValue instanceof Number && newValue instanceof Number) { double d1 = ((Number)currentValue).doubleValue(); double d2 = ((Number)newValue).doubleValue(); if (Double.isNaN(d1) && Double.isNaN(d2)) { return true; } if (d1 == 0.0 && Double.doubleToLongBits(d1) != Double.doubleToLongBits(d2)) { return false; } } return ScriptRuntime.shallowEq(currentValue, newValue); }
for (int i=(int)start; i >= 0; i--) { if (na.dense[i] != Scriptable.NOT_FOUND && ScriptRuntime.shallowEq(na.dense[i], compareTo)) for (int i=(int)start; i < length; i++) { if (na.dense[i] != Scriptable.NOT_FOUND && ScriptRuntime.shallowEq(na.dense[i], compareTo)) for (long i=start; i >= 0; i--) { Object val = getRawElem(thisObj, i); if (val != NOT_FOUND && ScriptRuntime.shallowEq(val, compareTo)) { return Long.valueOf(i); for (long i=start; i < length; i++) { Object val = getRawElem(thisObj, i); if (val != NOT_FOUND && ScriptRuntime.shallowEq(val, compareTo)) { return Long.valueOf(i);
for (int i=(int)start; i >= 0; i--) { if (na.dense[i] != Scriptable.NOT_FOUND && ScriptRuntime.shallowEq(na.dense[i], compareTo)) for (int i=(int)start; i < length; i++) { if (na.dense[i] != Scriptable.NOT_FOUND && ScriptRuntime.shallowEq(na.dense[i], compareTo)) for (long i=start; i >= 0; i--) { Object val = getRawElem(thisObj, i); if (val != NOT_FOUND && ScriptRuntime.shallowEq(val, compareTo)) { return Long.valueOf(i); for (long i=start; i < length; i++) { Object val = getRawElem(thisObj, i); if (val != NOT_FOUND && ScriptRuntime.shallowEq(val, compareTo)) { return Long.valueOf(i);
for (int i=(int)start; i >= 0; i--) { if (na.dense[i] != Scriptable.NOT_FOUND && ScriptRuntime.shallowEq(na.dense[i], compareTo)) for (int i=(int)start; i < length; i++) { if (na.dense[i] != Scriptable.NOT_FOUND && ScriptRuntime.shallowEq(na.dense[i], compareTo)) if (ScriptRuntime.shallowEq(getElem(cx, thisObj, i), compareTo)) { return new Long(i); if (ScriptRuntime.shallowEq(getElem(cx, thisObj, i), compareTo)) { return new Long(i);
valBln = ScriptRuntime.shallowEq(lhs, rhs); break shallow_compare;