< prev index next >

src/hotspot/share/c1/c1_LIRAssembler.cpp

Print this page

@@ -604,15 +604,19 @@
       Unimplemented();
       break;
   }
 }
 
-void LIR_Assembler::add_std_entry_info(int pc_offset, bool no_receiver) {
-  // FIXME: build different oompaps/stack/locals according to no_receiver.
+void LIR_Assembler::add_scalarized_entry_info(int pc_offset) {
   flush_debug_info(pc_offset);
   DebugInformationRecorder* debug_info = compilation()->debug_info_recorder();
-  OopMap* oop_map = new OopMap(0, 0); // FIXME
+  // The VEP and VVEP(RO) of a C1-compiled method call buffer_value_args_xxx()
+  // before doing any argument shuffling. This call may cause GC. When GC happens,
+  // all the parameters are still as passed by the caller, so we just use
+  // map->set_include_argument_oops() inside frame::sender_for_compiled_frame(RegisterMap* map).
+  // There's no need to build a GC map here.
+  OopMap* oop_map = new OopMap(0, 0);
   debug_info->add_safepoint(pc_offset, oop_map);
   DebugToken* locvals = debug_info->create_scope_values(NULL); // FIXME is this needed (for Java debugging to work properly??)
   DebugToken* expvals = debug_info->create_scope_values(NULL); // FIXME is this needed (for Java debugging to work properly??)
   DebugToken* monvals = debug_info->create_monitor_values(NULL); // FIXME: need testing with synchronized method
   bool reexecute = false;

@@ -621,25 +625,44 @@
   bool is_method_handle_invoke = false;
   debug_info->describe_scope(pc_offset, methodHandle(), method(), 0, reexecute, rethrow_exception, is_method_handle_invoke, return_oop, false, locvals, expvals, monvals);
   debug_info->end_safepoint(pc_offset);
 }
 
+// Emit VEP (and VVEP/VEP_RO if necessary)
 void LIR_Assembler::emit_std_entries() {
   offsets()->set_value(CodeOffsets::OSR_Entry, _masm->offset());
 
   const CompiledEntrySignature* ces = compilation()->compiled_entry_signature();
+
+  _masm->align(CodeEntryAlignment);
+  offsets()->set_value(CodeOffsets::Entry, _masm->offset());
+  if (needs_icache(compilation()->method())) {
+    check_icache();
+  }
+
   if (ces->has_scalarized_args()) {
     assert(ValueTypePassFieldsAsArgs && method()->get_Method()->has_scalarized_args(), "must be");
-    add_std_entry_info(emit_std_entry(CodeOffsets::Verified_Entry, ces), false);
 
     bool has_value_ro_entry = false;
     if (ces->has_value_recv() && ces->num_value_args() > 1) {
-      // We need a separate entry for value_ro
+      // VVEP(RO) = pack all value parameters, except the <this> object.
       has_value_ro_entry = true;
-      add_std_entry_info(emit_std_entry(CodeOffsets::Verified_Value_Entry_RO, ces), true);
+      add_scalarized_entry_info(emit_std_entry(CodeOffsets::Verified_Value_Entry_RO, ces));
+    }
+
+    // VEP = pack all value parameters
+    _masm->align(CodeEntryAlignment);
+    add_scalarized_entry_info(emit_std_entry(CodeOffsets::Verified_Entry, ces));
+
+    _masm->align(CodeEntryAlignment);
+    offsets()->set_value(CodeOffsets::Value_Entry, _masm->offset());
+    if (needs_icache(compilation()->method())) {
+      check_icache();
     }
+    // VVEP = all value parameters are already passed as refs, so no need for packing.
     emit_std_entry(CodeOffsets::Verified_Value_Entry, NULL);
+
     if (!has_value_ro_entry) {
       if (ces->has_value_recv()) {
         assert(ces->num_value_args() == 1, "must be");
         offsets()->set_value(CodeOffsets::Verified_Value_Entry_RO,
                              offsets()->value(CodeOffsets::Verified_Value_Entry));

@@ -656,14 +679,10 @@
     offsets()->set_value(CodeOffsets::Verified_Value_Entry_RO, offset);
   }
 }
 
 int LIR_Assembler::emit_std_entry(CodeOffsets::Entries entry, const CompiledEntrySignature* ces) {
-  _masm->align(CodeEntryAlignment);
-  if (needs_icache(compilation()->method())) {
-    check_icache();
-  }
   offsets()->set_value(entry, _masm->offset());
   switch (entry) {
   case CodeOffsets::Verified_Entry:
     return _masm->verified_entry(ces, initial_frame_size_in_bytes(), bang_size_in_bytes(), _verified_value_entry);
   case CodeOffsets::Verified_Value_Entry_RO:
< prev index next >