8217467: Access barriers are missing in C2 intrinsic for Base64
authorshade
Tue, 22 Jan 2019 21:18:25 +0100
changeset 53452 274fcce9d147
parent 53451 5f237f2cd5b2
child 53453 b476ba62857c
8217467: Access barriers are missing in C2 intrinsic for Base64 Reviewed-by: thartmann, roland, rkennke, kvn
src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
src/hotspot/share/opto/library_call.cpp
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Tue Jan 22 11:42:13 2019 -0800
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Tue Jan 22 21:18:25 2019 +0100
@@ -1023,6 +1023,9 @@
         "sha512_implCompressMB",
         { { TypeFunc::Parms, ShenandoahLoad },  { TypeFunc::Parms+1, ShenandoahStore },   { -1, ShenandoahNone },
           { -1,  ShenandoahNone},                 { -1,  ShenandoahNone},                 { -1,  ShenandoahNone} },
+        "encodeBlock",
+        { { TypeFunc::Parms, ShenandoahLoad },  { TypeFunc::Parms+3, ShenandoahStore },   { -1, ShenandoahNone },
+          { -1,  ShenandoahNone},                 { -1,  ShenandoahNone},                 { -1,  ShenandoahNone} },
       };
 
       if (call->is_call_to_arraycopystub()) {
--- a/src/hotspot/share/opto/library_call.cpp	Tue Jan 22 11:42:13 2019 -0800
+++ b/src/hotspot/share/opto/library_call.cpp	Tue Jan 22 21:18:25 2019 +0100
@@ -6260,6 +6260,11 @@
   Node* dp = argument(5);
   Node* isURL = argument(6);
 
+  src = must_be_not_null(src, true);
+  src = access_resolve(src, ACCESS_READ);
+  dest = must_be_not_null(dest, true);
+  dest = access_resolve(dest, ACCESS_WRITE);
+
   Node* src_start = array_element_address(src, intcon(0), T_BYTE);
   assert(src_start, "source array is NULL");
   Node* dest_start = array_element_address(dest, intcon(0), T_BYTE);