< prev index next >

src/hotspot/share/ci/ciObjectFactory.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -24,10 +24,11 @@
 
 #include "precompiled.hpp"
 #include "ci/ciCallSite.hpp"
 #include "ci/ciInstance.hpp"
 #include "ci/ciInstanceKlass.hpp"
+#include "ci/ciValueKlass.hpp"
 #include "ci/ciMemberName.hpp"
 #include "ci/ciMethod.hpp"
 #include "ci/ciMethodData.hpp"
 #include "ci/ciMethodHandle.hpp"
 #include "ci/ciMethodType.hpp"

@@ -38,10 +39,12 @@
 #include "ci/ciObjectFactory.hpp"
 #include "ci/ciSymbol.hpp"
 #include "ci/ciTypeArray.hpp"
 #include "ci/ciTypeArrayKlass.hpp"
 #include "ci/ciUtilities.inline.hpp"
+#include "ci/ciValueArray.hpp"
+#include "ci/ciValueArrayKlass.hpp"
 #include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"

@@ -146,11 +149,12 @@
 
   _ci_metadata = new (_arena) GrowableArray<ciMetadata*>(_arena, 64, 0, NULL);
 
   for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) {
     BasicType t = (BasicType)i;
-    if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY && t != T_NARROWOOP && t != T_NARROWKLASS) {
+    if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY &&
+        t != T_VALUETYPE && t != T_NARROWOOP && t != T_NARROWKLASS) {
       ciType::_basic_types[t] = new (_arena) ciType(t);
       init_ident_of(ciType::_basic_types[t]);
     }
   }
 

@@ -360,10 +364,13 @@
     objArrayHandle h_oa(THREAD, (objArrayOop)o);
     return new (arena()) ciObjArray(h_oa);
   } else if (o->is_typeArray()) {
     typeArrayHandle h_ta(THREAD, (typeArrayOop)o);
     return new (arena()) ciTypeArray(h_ta);
+  } else if (o->is_valueArray()) {
+    valueArrayHandle h_ta(THREAD, (valueArrayOop)o);
+    return new (arena()) ciValueArray(h_ta);
   }
 
   // The oop is of some type not supported by the compiler interface.
   ShouldNotReachHere();
   return NULL;

@@ -379,12 +386,16 @@
 ciMetadata* ciObjectFactory::create_new_metadata(Metadata* o) {
   EXCEPTION_CONTEXT;
 
   if (o->is_klass()) {
     Klass* k = (Klass*)o;
-    if (k->is_instance_klass()) {
+    if (k->is_value()) {
+      return new (arena()) ciValueKlass(k);
+    } else if (k->is_instance_klass()) {
       return new (arena()) ciInstanceKlass(k);
+    } else if (k->is_valueArray_klass()) {
+      return new (arena()) ciValueArrayKlass(k);
     } else if (k->is_objArray_klass()) {
       return new (arena()) ciObjArrayKlass(k);
     } else if (k->is_typeArray_klass()) {
       return new (arena()) ciTypeArrayKlass(k);
     }

@@ -495,11 +506,11 @@
       return ciEnv::_unloaded_ciobjarrayklass;
     }
     int dimension = fd.dimension();
     assert(element_type != T_ARRAY, "unsuccessful decomposition");
     ciKlass* element_klass = NULL;
-    if (element_type == T_OBJECT) {
+    if (element_type == T_OBJECT || element_type == T_VALUETYPE) {
       ciEnv *env = CURRENT_THREAD_ENV;
       ciSymbol* ci_name = env->get_symbol(fd.object_key());
       element_klass =
         env->get_klass_by_name(accessing_klass, ci_name, false)->as_instance_klass();
     } else {

@@ -626,10 +637,16 @@
   init_ident_of(new_ret_addr);
   _return_addresses->append(new_ret_addr);
   return new_ret_addr;
 }
 
+ciWrapper* ciObjectFactory::make_never_null_wrapper(ciType* type) {
+  ciWrapper* wrapper = new (arena()) ciWrapper(type, /* never_null */ true);
+  init_ident_of(wrapper);
+  return wrapper;
+}
+
 // ------------------------------------------------------------------
 // ciObjectFactory::init_ident_of
 void ciObjectFactory::init_ident_of(ciBaseObject* obj) {
   obj->set_ident(_next_ident++);
 }
< prev index next >