changeset 13098:d61687130412

move GRAAL_ONLY stuff from vmStructs.cpp to separate vmStructs_graal.hpp file
author twisti
date Wed, 20 Nov 2013 16:55:54 -0800
parents 14db5ffd5ed9
children eae26735df5a
files src/share/vm/graal/vmStructs_graal.hpp src/share/vm/runtime/vmStructs.cpp
diffstat 2 files changed, 81 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/graal/vmStructs_graal.hpp	Wed Nov 20 16:55:54 2013 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013, 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GRAAL_VMSTRUCTS_GRAAL_HPP
+#define SHARE_VM_GRAAL_VMSTRUCTS_GRAAL_HPP
+
+#include "compiler/abstractCompiler.hpp"
+
+#define VM_STRUCTS_GRAAL(nonstatic_field, static_field)                       \
+                                                                              \
+  static_field(java_lang_Class, _graal_mirror_offset, int)                    \
+                                                                              \
+  nonstatic_field(CompilerStatistics, _standard,           CompilerStatistics::Data) \
+  nonstatic_field(CompilerStatistics, _osr,                CompilerStatistics::Data) \
+  nonstatic_field(CompilerStatistics, _nmethods_size,      int)                      \
+  nonstatic_field(CompilerStatistics, _nmethods_code_size, int)                      \
+  nonstatic_field(CompilerStatistics::Data, _bytes,        int)                      \
+  nonstatic_field(CompilerStatistics::Data, _count,        int)                      \
+  nonstatic_field(CompilerStatistics::Data, _time,         elapsedTimer)             \
+
+
+#define VM_TYPES_GRAAL(declare_type, declare_toplevel_type)                   \
+                                                                              \
+  declare_toplevel_type(CompilerStatistics)                                   \
+  declare_toplevel_type(CompilerStatistics::Data)                             \
+
+
+#endif // SHARE_VM_GRAAL_VMSTRUCTS_GRAAL_HPP
--- a/src/share/vm/runtime/vmStructs.cpp	Wed Nov 20 16:54:38 2013 -0800
+++ b/src/share/vm/runtime/vmStructs.cpp	Wed Nov 20 16:55:54 2013 -0800
@@ -103,6 +103,9 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/hashtable.hpp"
 #include "utilities/macros.hpp"
+#ifdef GRAAL
+# include "graal/vmStructs_graal.hpp"
+#endif
 #ifdef TARGET_ARCH_x86
 # include "vmStructs_x86.hpp"
 #endif
@@ -876,7 +879,18 @@
   nonstatic_field(nmethod,             _exception_cache,                              ExceptionCache*)                       \
   nonstatic_field(nmethod,             _marked_for_deoptimization,                    bool)                                  \
                                                                                                                              \
-  unchecked_c2_static_field(Deoptimization,         _trap_reason_name,                   void*)                              \
+  unchecked_c2_static_field(Deoptimization, _trap_reason_name,                        void*)                                 \
+                                                                                                                             \
+  nonstatic_field(Deoptimization::UnrollBlock, _size_of_deoptimized_frame,            int)                                   \
+  nonstatic_field(Deoptimization::UnrollBlock, _caller_adjustment,                    int)                                   \
+  nonstatic_field(Deoptimization::UnrollBlock, _number_of_frames,                     int)                                   \
+  nonstatic_field(Deoptimization::UnrollBlock, _total_frame_sizes,                    int)                                   \
+  nonstatic_field(Deoptimization::UnrollBlock, _frame_sizes,                          intptr_t*)                             \
+  nonstatic_field(Deoptimization::UnrollBlock, _frame_pcs,                            address*)                              \
+  nonstatic_field(Deoptimization::UnrollBlock, _register_block,                       intptr_t*)                             \
+  nonstatic_field(Deoptimization::UnrollBlock, _return_type,                          BasicType)                             \
+  nonstatic_field(Deoptimization::UnrollBlock, _initial_info,                         intptr_t)                              \
+  nonstatic_field(Deoptimization::UnrollBlock, _caller_actual_parameters,             int)                                   \
                                                                                                                                      \
   /********************************/                                                                                                 \
   /* JavaCalls (NOTE: incomplete) */                                                                                                 \
@@ -1252,7 +1266,6 @@
   static_field(java_lang_Class,                _array_klass_offset,                           int)                                   \
   static_field(java_lang_Class,                _oop_size_offset,                              int)                                   \
   static_field(java_lang_Class,                _static_oop_field_count_offset,                int)                                   \
-  GRAAL_ONLY(static_field(java_lang_Class,     _graal_mirror_offset,                          int))                                  \
                                                                                                                                      \
   /************************/                                                                                                         \
   /* Miscellaneous fields */                                                                                                         \
@@ -1289,14 +1302,7 @@
   nonstatic_field(FreeList<Metablock>,         _size,                                        size_t)                                 \
   nonstatic_field(FreeList<FreeChunk>,         _count,                                       ssize_t)                                \
   nonstatic_field(FreeList<Metablock>,         _count,                                       ssize_t)                                \
-  nonstatic_field(MetablockTreeDictionary,     _total_size,                                  size_t)                                 \
-  GRAAL_ONLY(nonstatic_field(CompilerStatistics, _standard,                                  CompilerStatistics::Data))              \
-  GRAAL_ONLY(nonstatic_field(CompilerStatistics, _osr,                                       CompilerStatistics::Data))              \
-  GRAAL_ONLY(nonstatic_field(CompilerStatistics, _nmethods_size,                             int))                                   \
-  GRAAL_ONLY(nonstatic_field(CompilerStatistics, _nmethods_code_size,                        int))                                   \
-  GRAAL_ONLY(nonstatic_field(CompilerStatistics::Data, _bytes,                               int))                                   \
-  GRAAL_ONLY(nonstatic_field(CompilerStatistics::Data, _count,                               int))                                   \
-  GRAAL_ONLY(nonstatic_field(CompilerStatistics::Data, _time,                                elapsedTimer))
+  nonstatic_field(MetablockTreeDictionary,     _total_size,                                  size_t)
 
 //--------------------------------------------------------------------------------
 // VM_TYPES
@@ -1670,6 +1676,7 @@
   declare_toplevel_type(Dependencies)                                     \
   declare_toplevel_type(CompileTask)                                      \
   declare_toplevel_type(Deoptimization)                                   \
+  declare_toplevel_type(Deoptimization::UnrollBlock)                      \
                                                                           \
   /************************/                                              \
   /* OopMap and OopMapSet */                                              \
@@ -2163,8 +2170,6 @@
   /* Miscellaneous types */                                               \
   /***************/                                                       \
                                                                           \
-  GRAAL_ONLY(declare_toplevel_type(CompilerStatistics))                   \
-  GRAAL_ONLY(declare_toplevel_type(CompilerStatistics::Data))             \
   declare_toplevel_type(PtrQueue)                                         \
                                                                           \
   /* freelist */                                                          \
@@ -2510,6 +2515,11 @@
   declare_constant(Deoptimization::Action_make_not_compilable)            \
   declare_constant(Deoptimization::Action_LIMIT)                          \
                                                                           \
+  declare_constant(Deoptimization::Unpack_deopt)                          \
+  declare_constant(Deoptimization::Unpack_exception)                      \
+  declare_constant(Deoptimization::Unpack_uncommon_trap)                  \
+  declare_constant(Deoptimization::Unpack_reexecute)                      \
+                                                                          \
   /*********************/                                                 \
   /* Matcher (C2 only) */                                                 \
   /*********************/                                                 \
@@ -2905,6 +2915,11 @@
              GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY,
              GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY)
 
+#ifdef GRAAL
+   VM_STRUCTS_GRAAL(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
+                    GENERATE_STATIC_VM_STRUCT_ENTRY)
+#endif
+
 #if INCLUDE_ALL_GCS
   VM_STRUCTS_PARALLELGC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
                         GENERATE_STATIC_VM_STRUCT_ENTRY)
@@ -2949,6 +2964,11 @@
            GENERATE_C2_VM_TYPE_ENTRY,
            GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY)
 
+#ifdef GRAAL
+  VM_TYPES_GRAAL(GENERATE_VM_TYPE_ENTRY,
+                 GENERATE_TOPLEVEL_VM_TYPE_ENTRY)
+#endif
+
 #if INCLUDE_ALL_GCS
   VM_TYPES_PARALLELGC(GENERATE_VM_TYPE_ENTRY,
                       GENERATE_TOPLEVEL_VM_TYPE_ENTRY)