Skip to content

Commit 8f8934f

Browse files
author
duke
committed
Added webrev for jdk/6930
1 parent 91c9411 commit 8f8934f

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

jdk/6930/00/commits.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"commit":{"message":"clean"},"files":[{"filename":"src\/hotspot\/share\/utilities\/globalDefinitions.hpp"}],"sha":"3960982eb4a52c03a8142a8b788c60c7b4eca364"},{"commit":{"message":"Merge branch 'master' into undefinedBehaviour"},"files":[],"sha":"3fc52fae3cd9912e1d1741ca55d129e2b837ec41"},{"commit":{"message":"Merge branch 'master' of github.com:MeryKitty\/jdk into undefinedBehaviour"},"files":[{"filename":"src\/hotspot\/share\/utilities\/globalDefinitions.hpp"}],"sha":"f6d0a8259dbf8a3b258fcc83205fd43372cd5af3"},{"commit":{"message":"implementation limits"},"files":[{"filename":"src\/hotspot\/share\/utilities\/globalDefinitions.hpp"}],"sha":"32a3f0b37cd033b3ef3f0297a99778bb047debd8"},{"commit":{"message":"const reference"},"files":[{"filename":"src\/hotspot\/share\/utilities\/globalDefinitions.hpp"}],"sha":"20905eb042d7f0dda9f59d95dbed34dcbbc5c7a1"},{"commit":{"message":"words not need to be initialized"},"files":[{"filename":"src\/hotspot\/share\/utilities\/globalDefinitions.hpp"}],"sha":"7ebb1ce0717ceacc302947b90af7b4140e8c754b"},{"commit":{"message":"undefined behaviour in globalDefinitions.hpp"},"files":[{"filename":"src\/hotspot\/share\/interpreter\/interpreterRuntime.cpp"},{"filename":"src\/hotspot\/share\/opto\/output.cpp"},{"filename":"src\/hotspot\/share\/services\/heapDumper.cpp"},{"filename":"src\/hotspot\/share\/utilities\/globalDefinitions.hpp"}],"sha":"5cd26be6498efe263b8afa4a08826517ebd2bc09"}]

jdk/6930/00/comparison.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"files":[{"patch":"@@ -1212,1 +1212,1 @@\n- fvalue.j = u.long_value;\n+ fvalue.j = u.long_value();\n","filename":"src\/hotspot\/share\/interpreter\/interpreterRuntime.cpp","additions":1,"deletions":1,"binary":false,"changes":2,"status":"modified"},{"patch":"@@ -956,2 +956,1 @@\n- jlong_accessor acc;\n- acc.long_value = jlong_cast(d);\n+ jlong_accessor acc(jlong_cast(d));\n@@ -976,2 +975,1 @@\n- jlong_accessor acc;\n- acc.long_value = d;\n+ jlong_accessor acc(d);\n","filename":"src\/hotspot\/share\/opto\/output.cpp","additions":2,"deletions":4,"binary":false,"changes":6,"status":"modified"},{"patch":"@@ -1000,7 +1000,0 @@\n-template<typename T, typename F> T bit_cast(F from) { \/\/ replace with the real thing when we can use c++20\n- T to;\n- static_assert(sizeof(to) == sizeof(from), \"must be of the same size\");\n- memcpy(&to, &from, sizeof(to));\n- return to;\n-}\n-\n","filename":"src\/hotspot\/share\/services\/heapDumper.cpp","additions":0,"deletions":7,"binary":false,"changes":7,"status":"modified"},{"patch":"@@ -38,0 +38,1 @@\n+#include <type_traits>\n@@ -608,10 +609,11 @@\n-typedef union {\n- jfloat f;\n- jint i;\n-} FloatIntConv;\n-\n-typedef union {\n- jdouble d;\n- jlong l;\n- julong ul;\n-} DoubleLongConv;\n+template<typename T, typename F>\n+inline T bit_cast(const F& from) noexcept { \/\/ replace with the real thing when we can use c++20\n+ static_assert(sizeof(T) == sizeof(F), \"must be of the same size\");\n+ static_assert(std::is_trivially_copyable<T>(), \"output type must be trivially copyable\");\n+ static_assert(std::is_trivially_copyable<F>(), \"input type must be trivially copyable\");\n+ static_assert(std::is_default_constructible<T>() &&\n+ std::is_trivially_copy_assignable<T>(), \"implementation limits\");\n+ T to;\n+ memcpy(&to, &from, sizeof(T));\n+ return to;\n+}\n@@ -619,2 +621,2 @@\n-inline jint jint_cast (jfloat x) { return ((FloatIntConv*)&x)->i; }\n-inline jfloat jfloat_cast (jint x) { return ((FloatIntConv*)&x)->f; }\n+inline jint jint_cast (jfloat x) { return bit_cast<jint> (x); }\n+inline jfloat jfloat_cast (jint x) { return bit_cast<jfloat> (x); }\n@@ -622,3 +624,3 @@\n-inline jlong jlong_cast (jdouble x) { return ((DoubleLongConv*)&x)->l; }\n-inline julong julong_cast (jdouble x) { return ((DoubleLongConv*)&x)->ul; }\n-inline jdouble jdouble_cast (jlong x) { return ((DoubleLongConv*)&x)->d; }\n+inline jlong jlong_cast (jdouble x) { return bit_cast<jlong> (x); }\n+inline julong julong_cast (jdouble x) { return bit_cast<julong> (x); }\n+inline jdouble jdouble_cast (jlong x) { return bit_cast<jdouble>(x); }\n@@ -644,3 +646,13 @@\n-union jlong_accessor {\n- jint words[2];\n- jlong long_value;\n+#ifndef _LP64\n+\n+struct jlong_accessor {\n+ jint words[2];\n+\n+ jlong_accessor() = default;\n+ jlong_accessor(jlong j) {\n+ static_assert(sizeof(this->words) == sizeof(jlong), \"\");\n+ memcpy(&(words), &j, sizeof(jlong));\n+ }\n+ jlong long_value() const {\n+ bit_cast<jlong>(words);\n+ }\n@@ -649,0 +661,2 @@\n+#endif \/\/ !_LP64\n+\n","filename":"src\/hotspot\/share\/utilities\/globalDefinitions.hpp","additions":32,"deletions":18,"binary":false,"changes":50,"status":"modified"}]}

jdk/6930/00/metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"head":{"repo":{"full_name":"merykitty\/jdk","html_url":"https:\/\/github.com\/merykitty\/jdk"},"sha":"3960982eb4a52c03a8142a8b788c60c7b4eca364"},"created_at":"2021-12-23T16:05:26.589168047Z","base":{"repo":{"full_name":"openjdk\/jdk","html_url":"https:\/\/git.openjdk.java.net\/jdk"},"sha":"cc44e137973808436311aaaa50916d051759f705"}}

0 commit comments

Comments
 (0)