src/hotspot/share/runtime/handles.inline.hpp
changeset 49393 93fe2fc5c093
parent 47216 71c04702a3d5
child 49449 ef5d5d343e2a
--- a/src/hotspot/share/runtime/handles.inline.hpp	Wed Mar 14 07:27:19 2018 -0400
+++ b/src/hotspot/share/runtime/handles.inline.hpp	Wed Mar 14 12:12:00 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -40,6 +40,17 @@
   }
 }
 
+// Inline constructors for Specific Handles for different oop types
+#define DEF_HANDLE_CONSTR(type, is_a)                   \
+inline type##Handle::type##Handle (Thread* thread, type##Oop obj) : Handle(thread, (oop)obj) { \
+  assert(is_null() || ((oop)obj)->is_a(), "illegal type");                \
+}
+
+DEF_HANDLE_CONSTR(instance , is_instance_noinline )
+DEF_HANDLE_CONSTR(array    , is_array_noinline    )
+DEF_HANDLE_CONSTR(objArray , is_objArray_noinline )
+DEF_HANDLE_CONSTR(typeArray, is_typeArray_noinline)
+
 // Constructor for metadata handles
 #define DEF_METADATA_HANDLE_FN(name, type) \
 inline name##Handle::name##Handle(type* obj) : _value(obj), _thread(NULL) {       \