Wed, 26 Jul 2017 23:01:40 -0700
Merge
.hgtags | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Fri Jul 14 14:30:06 2017 -0700 1.2 +++ b/.hgtags Wed Jul 26 23:01:40 2017 -0700 1.3 @@ -701,6 +701,8 @@ 1.4 2c1a74bca789006be1cc7fc642048ade06fef2f2 jdk8u141-b13 1.5 8c329eab0dac3630854a56f2485f9862040bffdf jdk8u141-b14 1.6 dfb2e076f381c4ea8c84ae0309a2072ec3ac92b8 jdk8u141-b15 1.7 +6a52d202dfa3395d90cdd7dc24b8c437e5acc03d jdk8u144-b00 1.8 +7de0a688b0d910d4ef2cb89da6623b3ded431276 jdk8u144-b01 1.9 6f50b0c7c275324f76cf7f09606949195fd65f92 jdk8u141-b31 1.10 59bf0950e077f66d1f6c5ef4a3f1489b2b2048fa jdk8u141-b32 1.11 6a5473932aff2d9c0df2cdc6e1800dd7c374232f jdk8u151-b00 1.12 @@ -708,6 +710,28 @@ 1.13 296b5f81b2c28b5d7eea4a7051eae0ec34f5ec05 jdk8u151-b02 1.14 c0828d5abc8646c80236fae42d971477bfc74748 jdk8u151-b03 1.15 a593aff280ac5472a23923604f1a25c8e80e6ec7 jdk8u151-b04 1.16 +178207e92304e6717c1b2e80c56424efe4e69204 jdk8u151-b05 1.17 +b9ed966e2b873528553e27a791298205e1bc7cb5 jdk8u151-b06 1.18 +18eb73eb84c5395b3efcafa43ce224565eca02b3 jdk8u122-b00 1.19 +9e615ea961fe5732813ed7b273606e7337ea2234 jdk8u122-b01 1.20 +2f0b11882cb7ddb10e35682ab9e8343919a71c54 jdk8u122-b02 1.21 +df2a2824284f97c5edb9b9c2e6d18bb4ff838199 jdk8u122-b03 1.22 +df2a2824284f97c5edb9b9c2e6d18bb4ff838199 jdk8u122-b03 1.23 +0000000000000000000000000000000000000000 jdk8u122-b03 1.24 +0000000000000000000000000000000000000000 jdk8u122-b03 1.25 +12650d23a8fd1b27a0d28c6a276fdecf01805294 jdk8u122-b03 1.26 +3c3b4e793e7c6255a840844db077ef466940035c jdk8u122-b04 1.27 +30dc0c72f3d0aff34b6d421208b18f384d05d761 jdk8u132-b00 1.28 +91d33aea2714e63796eeab0e63e38c9d2568c00c jdk8u152-b00 1.29 +50dac2fd8689dbb820d887ce3919708d5d042891 jdk8u152-b01 1.30 +01bbd310156db7a75a46a7320d1f49beff844472 jdk8u152-b02 1.31 +2a01d94fea9a86b4038a93622f62b0986083f67e jdk8u152-b03 1.32 +9dce75561a92f096d822ebb7eb76810f191fe522 jdk8u152-b04 1.33 +cdb7d9454d254e95c73d6dc77077ab2c198e2ad6 jdk8u152-b05 1.34 +2be667f12b54fc5b57b147f60851ee63ff02e5fa jdk8u152-b06 1.35 +a44dcdfa00bee9261012f10bd3f06bea1fec4340 jdk8u152-b07 1.36 +d0a8151a276c362a6e17068d9aa8ed583309d46e jdk8u152-b08 1.37 +37e94d764d7b98e3676e54f2ad346d721fdde113 jdk8u152-b09 1.38 18eb73eb84c5395b3efcafa43ce224565eca02b3 jdk8u122-b00 1.39 9e615ea961fe5732813ed7b273606e7337ea2234 jdk8u122-b01 1.40 2f0b11882cb7ddb10e35682ab9e8343919a71c54 jdk8u122-b02
2.1 --- a/src/jdk/nashorn/internal/objects/NativeDataView.java Fri Jul 14 14:30:06 2017 -0700 2.2 +++ b/src/jdk/nashorn/internal/objects/NativeDataView.java Wed Jul 26 23:01:40 2017 -0700 2.3 @@ -416,7 +416,7 @@ 2.4 * @return 32-bit unsigned int value at the byteOffset 2.5 */ 2.6 @Function(attributes = Attribute.NOT_ENUMERABLE, arity = 1) 2.7 - public static long getUint32(final Object self, final Object byteOffset, final Object littleEndian) { 2.8 + public static double getUint32(final Object self, final Object byteOffset, final Object littleEndian) { 2.9 try { 2.10 return 0xFFFFFFFFL & getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset)); 2.11 } catch (final IllegalArgumentException iae) { 2.12 @@ -432,7 +432,7 @@ 2.13 * @return 32-bit unsigned int value at the byteOffset 2.14 */ 2.15 @SpecializedFunction 2.16 - public static long getUint32(final Object self, final int byteOffset) { 2.17 + public static double getUint32(final Object self, final int byteOffset) { 2.18 try { 2.19 return JSType.toUint32(getBuffer(self, false).getInt(JSType.toInt32(byteOffset))); 2.20 } catch (final IllegalArgumentException iae) { 2.21 @@ -449,7 +449,7 @@ 2.22 * @return 32-bit unsigned int value at the byteOffset 2.23 */ 2.24 @SpecializedFunction 2.25 - public static long getUint32(final Object self, final int byteOffset, final boolean littleEndian) { 2.26 + public static double getUint32(final Object self, final int byteOffset, final boolean littleEndian) { 2.27 try { 2.28 return JSType.toUint32(getBuffer(self, littleEndian).getInt(JSType.toInt32(byteOffset))); 2.29 } catch (final IllegalArgumentException iae) { 2.30 @@ -837,9 +837,9 @@ 2.31 * @return undefined 2.32 */ 2.33 @SpecializedFunction 2.34 - public static Object setUint32(final Object self, final int byteOffset, final long value) { 2.35 + public static Object setUint32(final Object self, final int byteOffset, final double value) { 2.36 try { 2.37 - getBuffer(self, false).putInt(byteOffset, (int)value); 2.38 + getBuffer(self, false).putInt(byteOffset, (int) JSType.toUint32(value)); 2.39 return UNDEFINED; 2.40 } catch (final IllegalArgumentException iae) { 2.41 throw rangeError(iae, "dataview.offset"); 2.42 @@ -856,9 +856,9 @@ 2.43 * @return undefined 2.44 */ 2.45 @SpecializedFunction 2.46 - public static Object setUint32(final Object self, final int byteOffset, final long value, final boolean littleEndian) { 2.47 + public static Object setUint32(final Object self, final int byteOffset, final double value, final boolean littleEndian) { 2.48 try { 2.49 - getBuffer(self, littleEndian).putInt(byteOffset, (int)value); 2.50 + getBuffer(self, littleEndian).putInt(byteOffset, (int) JSType.toUint32(value)); 2.51 return UNDEFINED; 2.52 } catch (final IllegalArgumentException iae) { 2.53 throw rangeError(iae, "dataview.offset");
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/test/script/basic/JDK-8181191.js Wed Jul 26 23:01:40 2017 -0700 3.3 @@ -0,0 +1,52 @@ 3.4 +/* 3.5 + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.7 + * 3.8 + * This code is free software; you can redistribute it and/or modify it 3.9 + * under the terms of the GNU General Public License version 2 only, as 3.10 + * published by the Free Software Foundation. 3.11 + * 3.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 3.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 3.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 3.15 + * version 2 for more details (a copy is included in the LICENSE file that 3.16 + * accompanied this code). 3.17 + * 3.18 + * You should have received a copy of the GNU General Public License version 3.19 + * 2 along with this work; if not, write to the Free Software Foundation, 3.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 3.21 + * 3.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 3.23 + * or visit www.oracle.com if you need additional information or have any 3.24 + * questions. 3.25 + */ 3.26 + 3.27 +/** 3.28 + * JDK-8181191: getUint32 returning Long 3.29 + * 3.30 + * @test 3.31 + * @run 3.32 + */ 3.33 + 3.34 + 3.35 +function uint32(x) { 3.36 + var buffer = new ArrayBuffer(16); 3.37 + var dataview = new DataView(buffer); 3.38 + dataview.setUint32(0, x); 3.39 + return dataview.getUint32(0); 3.40 +} 3.41 + 3.42 +Assert.assertTrue(typeof uint32(0x7f) === 'number'); 3.43 +Assert.assertTrue(typeof uint32(0x80) === 'number'); 3.44 +Assert.assertTrue(typeof uint32(0xffffffff) === 'number'); 3.45 +Assert.assertTrue(typeof uint32(0x100000000) === 'number'); 3.46 + 3.47 +Assert.assertTrue(uint32(0x7f) === 0x7f); 3.48 +Assert.assertTrue(uint32(0x80) === 0x80); 3.49 +Assert.assertTrue(uint32(0xffffffff) === 0xffffffff); 3.50 +Assert.assertTrue(uint32(0x100000000) === 0x0); 3.51 + 3.52 +Assert.assertTrue(uint32(0x7f) === uint32(0x7f)); 3.53 +Assert.assertTrue(uint32(0x80) === uint32(0x80)); 3.54 +Assert.assertTrue(uint32(0xffffffff) === uint32(0xffffffff)); 3.55 +Assert.assertTrue(uint32(0x100000000) === uint32(0x100000000));