changeset 1459:a8f9f091c219

Don't mess with VMToNative transitions..
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Sat, 13 Nov 2010 18:28:48 +0100
parents 7cf1952ec5fb
children 1ffaf7819f91
files src/share/vm/c1x/c1x_Compiler.cpp src/share/vm/ci/ciField.cpp src/share/vm/ci/ciField.hpp
diffstat 3 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/c1x/c1x_Compiler.cpp	Fri Nov 12 20:57:08 2010 +0100
+++ b/src/share/vm/c1x/c1x_Compiler.cpp	Sat Nov 13 18:28:48 2010 +0100
@@ -106,11 +106,7 @@
   Handle field_name = VmIds::toString<Handle>(field->name()->get_symbolOop(), CHECK_0);
 
   ciInstanceKlass* accessor_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(accessor());
-  bool will_link;
-  {
-    ThreadToNativeFromVM trans((JavaThread*)THREAD);
-    will_link = field->will_link(accessor_klass, byteCode);
-  }
+  bool will_link = field->will_link_from_vm(accessor_klass, byteCode);
 
   int offset = (field->holder()->is_loaded() && will_link) ? field->offset() : -1;
 
--- a/src/share/vm/ci/ciField.cpp	Fri Nov 12 20:57:08 2010 +0100
+++ b/src/share/vm/ci/ciField.cpp	Sat Nov 13 18:28:48 2010 +0100
@@ -294,15 +294,19 @@
   return type;
 }
 
+bool ciField::will_link(ciInstanceKlass* accessing_klass,
+                        Bytecodes::Code bc) {
+  VM_ENTRY_MARK;
+  will_link_from_vm(accessing_klass, bc);
+}
 
 // ------------------------------------------------------------------
 // ciField::will_link
 //
 // Can a specific access to this field be made without causing
 // link errors?
-bool ciField::will_link(ciInstanceKlass* accessing_klass,
+bool ciField::will_link_from_vm(ciInstanceKlass* accessing_klass,
                         Bytecodes::Code bc) {
-  VM_ENTRY_MARK;
   if (_offset == -1) {
     // at creation we couldn't link to our holder so we need to
     // maintain that stance, otherwise there's no safe way to use this
--- a/src/share/vm/ci/ciField.hpp	Fri Nov 12 20:57:08 2010 +0100
+++ b/src/share/vm/ci/ciField.hpp	Sat Nov 13 18:28:48 2010 +0100
@@ -160,6 +160,8 @@
   // at each point of access.
   bool will_link(ciInstanceKlass* accessing_klass,
                  Bytecodes::Code bc);
+  bool will_link_from_vm(ciInstanceKlass* accessing_klass,
+                 Bytecodes::Code bc);
 
   // Java access flags
   bool is_public      () { return flags().is_public(); }