hotspot/src/share/vm/classfile/javaClasses.cpp
changeset 31037 01a5c5fa5681
parent 30310 522ea430079f
child 31038 2fd2fdc6a70a
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri May 15 19:21:46 2015 +0300
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Fri May 15 19:23:11 2015 +0300
@@ -2967,47 +2967,42 @@
 
 int java_lang_invoke_CallSite::_target_offset;
 int java_lang_invoke_CallSite::_context_offset;
-int java_lang_invoke_CallSite::_default_context_offset;
 
 void java_lang_invoke_CallSite::compute_offsets() {
   Klass* k = SystemDictionary::CallSite_klass();
   if (k != NULL) {
     compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_lang_invoke_MethodHandle_signature());
-    compute_offset(_context_offset, k, vmSymbols::context_name(), vmSymbols::sun_misc_Cleaner_signature());
-    compute_offset(_default_context_offset, k,
-                   vmSymbols::DEFAULT_CONTEXT_name(), vmSymbols::sun_misc_Cleaner_signature(),
-                   /*is_static=*/true, /*allow_super=*/false);
+    compute_offset(_context_offset, k, vmSymbols::context_name(),
+                   vmSymbols::java_lang_invoke_MethodHandleNatives_CallSiteContext_signature());
   }
 }
 
-oop java_lang_invoke_CallSite::context_volatile(oop call_site) {
-  assert(java_lang_invoke_CallSite::is_instance(call_site), "");
-
-  oop dep_oop = call_site->obj_field_volatile(_context_offset);
-  return dep_oop;
-}
-
-void java_lang_invoke_CallSite::set_context_volatile(oop call_site, oop context) {
+oop java_lang_invoke_CallSite::context(oop call_site) {
   assert(java_lang_invoke_CallSite::is_instance(call_site), "");
-  call_site->obj_field_put_volatile(_context_offset, context);
-}
-
-bool java_lang_invoke_CallSite::set_context_cas(oop call_site, oop context, oop expected) {
-  assert(java_lang_invoke_CallSite::is_instance(call_site), "");
-  HeapWord* context_addr = call_site->obj_field_addr<HeapWord>(_context_offset);
-  oop res = oopDesc::atomic_compare_exchange_oop(context, context_addr, expected, true);
-  bool success = (res == expected);
-  if (success) {
-    update_barrier_set((void*)context_addr, context);
+
+  oop dep_oop = call_site->obj_field(_context_offset);
+  return dep_oop;
+}
+
+// Support for java_lang_invoke_MethodHandleNatives_CallSiteContext
+
+int java_lang_invoke_MethodHandleNatives_CallSiteContext::_vmdependencies_offset;
+
+void java_lang_invoke_MethodHandleNatives_CallSiteContext::compute_offsets() {
+  Klass* k = SystemDictionary::Context_klass();
+  if (k != NULL) {
+    CALLSITECONTEXT_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
   }
-  return success;
-}
-
-oop java_lang_invoke_CallSite::default_context() {
-  InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::CallSite_klass());
-  oop def_context_oop = ik->java_mirror()->obj_field(_default_context_offset);
-  assert(!oopDesc::is_null(def_context_oop), "");
-  return def_context_oop;
+}
+
+nmethodBucket* java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(oop call_site) {
+  assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), "");
+  return (nmethodBucket*) (address) call_site->long_field(_vmdependencies_offset);
+}
+
+void java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(oop call_site, nmethodBucket* context) {
+  assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), "");
+  call_site->long_field_put(_vmdependencies_offset, (jlong) (address) context);
 }
 
 // Support for java_security_AccessControlContext
@@ -3403,6 +3398,7 @@
   java_lang_invoke_LambdaForm::compute_offsets();
   java_lang_invoke_MethodType::compute_offsets();
   java_lang_invoke_CallSite::compute_offsets();
+  java_lang_invoke_MethodHandleNatives_CallSiteContext::compute_offsets();
   java_security_AccessControlContext::compute_offsets();
   // Initialize reflection classes. The layouts of these classes
   // changed with the new reflection implementation in JDK 1.4, and