< prev index next >

src/hotspot/share/opto/library_call.hpp

Print this page
@@ -26,10 +26,11 @@
  #include "classfile/javaClasses.hpp"
  #include "opto/callGenerator.hpp"
  #include "opto/graphKit.hpp"
  #include "opto/castnode.hpp"
  #include "opto/convertnode.hpp"
+ #include "opto/inlinetypenode.hpp"
  #include "opto/intrinsicnode.hpp"
  #include "opto/movenode.hpp"
  
  class LibraryIntrinsic : public InlineCallGenerator {
    // Extend the set of intrinsics known to the runtime:

@@ -103,13 +104,21 @@
    bool  try_to_inline(int predicate);
    Node* try_to_predicate(int predicate);
  
    void push_result() {
      // Push the result onto the stack.
-     if (!stopped() && result() != NULL) {
-       BasicType bt = result()->bottom_type()->basic_type();
-       push_node(bt, result());
+     Node* res = result();
+     if (!stopped() && res != NULL) {
+       BasicType bt = res->bottom_type()->basic_type();
+       if (C->inlining_incrementally() && res->is_InlineType()) {
+         // The caller expects an oop when incrementally inlining an intrinsic that returns an
+         // inline type. Make sure the call is re-executed if the allocation triggers a deoptimization.
+         PreserveReexecuteState preexecs(this);
+         jvms()->set_should_reexecute(true);
+         res = res->as_InlineType()->buffer(this);
+       }
+       push_node(bt, res);
      }
    }
  
   private:
    void fatal_unexpected_iid(vmIntrinsics::ID iid) {

@@ -133,11 +142,10 @@
                               Node* array_length,
                               RegionNode* region);
    void  generate_string_range_check(Node* array, Node* offset,
                                      Node* length, bool char_count);
    Node* generate_current_thread(Node* &tls_output);
-   Node* load_mirror_from_klass(Node* klass);
    Node* load_klass_from_mirror_common(Node* mirror, bool never_see_null,
                                        RegionNode* region, int null_path,
                                        int offset);
    Node* load_klass_from_mirror(Node* mirror, bool never_see_null,
                                 RegionNode* region, int null_path) {

@@ -155,25 +163,47 @@
    }
    Node* generate_access_flags_guard(Node* kls,
                                      int modifier_mask, int modifier_bits,
                                      RegionNode* region);
    Node* generate_interface_guard(Node* kls, RegionNode* region);
+ 
+   enum ArrayKind {
+     AnyArray,
+     NonArray,
+     ObjectArray,
+     NonObjectArray,
+     TypeArray,
+     FlatArray,
+     NonFlatArray
+   };
+ 
    Node* generate_hidden_class_guard(Node* kls, RegionNode* region);
+ 
    Node* generate_array_guard(Node* kls, RegionNode* region) {
-     return generate_array_guard_common(kls, region, false, false);
+     return generate_array_guard_common(kls, region, AnyArray);
    }
    Node* generate_non_array_guard(Node* kls, RegionNode* region) {
-     return generate_array_guard_common(kls, region, false, true);
+     return generate_array_guard_common(kls, region, NonArray);
    }
    Node* generate_objArray_guard(Node* kls, RegionNode* region) {
-     return generate_array_guard_common(kls, region, true, false);
+     return generate_array_guard_common(kls, region, ObjectArray);
    }
    Node* generate_non_objArray_guard(Node* kls, RegionNode* region) {
-     return generate_array_guard_common(kls, region, true, true);
+     return generate_array_guard_common(kls, region, NonObjectArray);
+   }
+   Node* generate_typeArray_guard(Node* kls, RegionNode* region) {
+     return generate_array_guard_common(kls, region, TypeArray);
+   }
+   Node* generate_flatArray_guard(Node* kls, RegionNode* region) {
+     assert(UseFlatArray, "can never be flattened");
+     return generate_array_guard_common(kls, region, FlatArray);
+   }
+   Node* generate_non_flatArray_guard(Node* kls, RegionNode* region) {
+     assert(UseFlatArray, "can never be flattened");
+     return generate_array_guard_common(kls, region, NonFlatArray);
    }
-   Node* generate_array_guard_common(Node* kls, RegionNode* region,
-                                     bool obj_array, bool not_array);
+   Node* generate_array_guard_common(Node* kls, RegionNode* region, ArrayKind kind);
    Node* generate_virtual_guard(Node* obj_klass, RegionNode* slow_region);
    CallJavaNode* generate_method_call(vmIntrinsics::ID method_id,
                                       bool is_virtual = false, bool is_static = false);
    CallJavaNode* generate_method_call_static(vmIntrinsics::ID method_id) {
      return generate_method_call(method_id, false, true);

@@ -228,18 +258,21 @@
    bool inline_unsafe_allocate();
    bool inline_unsafe_newArray(bool uninitialized);
    bool inline_unsafe_writeback0();
    bool inline_unsafe_writebackSync0(bool is_pre);
    bool inline_unsafe_copyMemory();
+   bool inline_unsafe_make_private_buffer();
+   bool inline_unsafe_finish_private_buffer();
    bool inline_native_currentThread();
  
    bool inline_native_time_funcs(address method, const char* funcName);
  #ifdef JFR_HAVE_INTRINSICS
    bool inline_native_classID();
    bool inline_native_getEventWriter();
  #endif
    bool inline_native_Class_query(vmIntrinsics::ID id);
+   bool inline_primitive_Class_conversion(vmIntrinsics::ID id);
    bool inline_native_subtype_check();
    bool inline_native_getLength();
    bool inline_array_copyOf(bool is_copyOfRange);
    bool inline_array_equals(StrIntrinsicNode::ArgEnc ae);
    bool inline_preconditions_checkIndex(BasicType bt);
< prev index next >