< prev index next >

src/share/vm/code/compiledMethod.cpp

Print this page

        

@@ -28,10 +28,11 @@
 #include "code/codeCache.hpp"
 #include "prims/methodHandles.hpp"
 #include "interpreter/bytecode.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/mutexLocker.hpp"
+#include "runtime/sharedRuntime.hpp"
 
 CompiledMethod::CompiledMethod(Method* method, const char* name, CompilerType type, const CodeBlobLayout& layout, int frame_complete_offset, int frame_size, ImmutableOopMapSet* oop_maps, bool caller_must_gc_arguments)
   : CodeBlob(name, type, layout, frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments),
   _method(method), _mark_for_deoptimization_status(not_marked) {
   init_defaults();

@@ -308,10 +309,31 @@
       has_receiver = !(callee->access_flags().is_static());
       has_appendix = false;
       signature = callee->signature();
     }
 
+    // If value types are passed as fields, use the extended signature
+    // which contains the types of all (oop) fields of the value type.
+    if (ValueTypePassFieldsAsArgs) {
+      // Check if receiver or one of the arguments is a value type
+      bool has_value_receiver = (callee != NULL && callee->method_holder()->is_value());
+      bool has_value_argument = has_value_receiver;
+      const int len = signature->utf8_length();
+      for (int i = 0; i < len && !has_value_argument; ++i) {
+        if (signature->byte_at(i) == 'Q') {
+          has_value_argument = true;
+        }
+      }
+      if (has_value_argument) {
+        // Get the extended signature from the callee's adapter through the attached method
+        assert(callee != NULL, "must have attached method");
+        signature = callee->adapter()->get_sig_extended();
+        assert(signature != NULL, "signature is null");
+        has_receiver = false; // The extended signature contains the receiver type
+      }
+    }
+
     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
   }
 #endif // !SHARK
 }
 
< prev index next >