< prev index next >

src/hotspot/share/opto/memnode.cpp

Print this page
@@ -848,16 +848,28 @@
  
  #ifdef ASSERT
  //----------------------------is_immutable_value-------------------------------
  // Helper function to allow a raw load without control edge for some cases
  bool LoadNode::is_immutable_value(Node* adr) {
-   return (adr->is_AddP() && adr->in(AddPNode::Base)->is_top() &&
-           adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal &&
-           (adr->in(AddPNode::Offset)->find_intptr_t_con(-1) ==
-            in_bytes(JavaThread::osthread_offset()) ||
-            adr->in(AddPNode::Offset)->find_intptr_t_con(-1) ==
-            in_bytes(JavaThread::threadObj_offset())));
+   if (adr->is_AddP() && adr->in(AddPNode::Base)->is_top() &&
+       adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal) {
+ 
+     jlong offset = adr->in(AddPNode::Offset)->find_intptr_t_con(-1);
+     int offsets[] = {
+       in_bytes(JavaThread::osthread_offset()),
+       in_bytes(JavaThread::threadObj_offset()),
+       in_bytes(JavaThread::vthread_offset()),
+       in_bytes(JavaThread::scopeLocalCache_offset()),
+     };
+ 
+     for (size_t i = 0; i < sizeof offsets / sizeof offsets[0]; i++) {
+       if (offset == offsets[i])
+         return true;
+     }
+   }
+ 
+   return false;
  }
  #endif
  
  //----------------------------LoadNode::make-----------------------------------
  // Polymorphic factory method:
< prev index next >