< prev index next >

src/hotspot/share/c1/c1_GraphBuilder.cpp

Print this page

        

@@ -1465,16 +1465,15 @@
   if (RegisterFinalizersAtInit &&
       method()->intrinsic_id() == vmIntrinsics::_Object_init) {
     call_register_finalizer();
   }
 
-  // The conditions for a memory barrier are described in Parse::do_exits().
   bool need_mem_bar = false;
   if (method()->name() == ciSymbol::object_initializer_name() &&
-       (scope()->wrote_final() ||
-         (AlwaysSafeConstructors && scope()->wrote_fields()) ||
-         (support_IRIW_for_not_multiple_copy_atomic_cpu && scope()->wrote_volatile()))) {
+      (scope()->wrote_final() || (AlwaysSafeConstructors && scope()->wrote_fields())
+                              || (support_IRIW_for_not_multiple_copy_atomic_cpu && scope()->wrote_volatile())
+     )){
     need_mem_bar = true;
   }
 
   BasicType bt = method()->return_type()->basic_type();
   switch (bt) {

@@ -1956,15 +1955,16 @@
       // equal to the number of implementors for target->holder() so
       // if number of implementors of target->holder() == 1 then
       // number of implementors for decl_interface is 0 or 1. If
       // it's 0 then no class implements decl_interface and there's
       // no point in inlining.
+      ciInstanceKlass* singleton = NULL;
       ciInstanceKlass* declared_interface = callee_holder;
-      ciInstanceKlass* singleton = declared_interface->unique_implementor();
-      if (singleton != NULL &&
-          (!target->is_default_method() || target->is_overpass()) /* CHA doesn't support default methods yet. */ ) {
-        assert(singleton != declared_interface, "not a unique implementor");
+      if (declared_interface->nof_implementors() == 1 &&
+          (!target->is_default_method() || target->is_overpass()) /* CHA doesn't support default methods yet. */) {
+        singleton = declared_interface->implementor();
+        assert(singleton != NULL && singleton != declared_interface, "");
         cha_monomorphic_target = target->find_monomorphic_target(calling_klass, declared_interface, singleton);
         if (cha_monomorphic_target != NULL) {
           if (cha_monomorphic_target->holder() != compilation()->env()->Object_klass()) {
             // If CHA is able to bind this invoke then update the class
             // to match that class, otherwise klass will refer to the
< prev index next >