diff src/share/vm/oops/typeArrayOop.hpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents d8ce2825b193
children bdd155477289
line wrap: on
line diff
--- a/src/share/vm/oops/typeArrayOop.hpp	Mon Nov 12 18:11:17 2012 +0100
+++ b/src/share/vm/oops/typeArrayOop.hpp	Mon Nov 12 23:14:12 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -73,7 +73,7 @@
   jfloat*   float_base()  const { return (jfloat*)  base(T_FLOAT); }
   jdouble*  double_base() const { return (jdouble*) base(T_DOUBLE); }
 
-  friend class typeArrayKlass;
+  friend class TypeArrayKlass;
 
  public:
   jbyte* byte_at_addr(int which) const {
@@ -151,6 +151,23 @@
   jbyte byte_at_acquire(int which) const              { return OrderAccess::load_acquire(byte_at_addr(which)); }
   void release_byte_at_put(int which, jbyte contents) { OrderAccess::release_store(byte_at_addr(which), contents); }
 
+  // Java thinks metadata arrays are just arrays of either long or int, since
+  // there doesn't seem to be T_ADDRESS, so this is a bit of unfortunate
+  // casting
+#ifdef _LP64
+  Metadata* metadata_at(int which) const {
+    return (Metadata*)*long_at_addr(which); }
+  void metadata_at_put(int which, Metadata* contents) {
+    *long_at_addr(which) = (long)contents;
+  }
+#else
+  Metadata* metadata_at(int which) const {
+    return (Metadata*)*int_at_addr(which); }
+  void metadata_at_put(int which, Metadata* contents) {
+    *int_at_addr(which) = (int)contents;
+  }
+#endif // _LP64
+
   // Sizing
 
   // Returns the number of words necessary to hold an array of "len"
@@ -173,7 +190,7 @@
 
  public:
   int object_size() {
-    typeArrayKlass* tk = typeArrayKlass::cast(klass());
+    TypeArrayKlass* tk = TypeArrayKlass::cast(klass());
     return object_size(tk->layout_helper(), length());
   }
 };