changeset 7935:0799a7efbe7b

Clean up of usage of marks and code installation.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 05 Mar 2013 19:00:23 +0100
parents 6b3c05de9521
children c6c72de0537e
files graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/Marks.java src/share/vm/graal/graalCodeInstaller.cpp src/share/vm/graal/graalCodeInstaller.hpp src/share/vm/graal/graalEnv.cpp src/share/vm/graal/graalEnv.hpp
diffstat 6 files changed, 31 insertions(+), 79 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java	Tue Mar 05 17:22:05 2013 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java	Tue Mar 05 19:00:23 2013 +0100
@@ -59,7 +59,7 @@
 
     @Override
     public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
-        tasm.recordMark(Marks.MARK_INLINE_INVOKEVIRTUAL);
+        tasm.recordMark(Marks.MARK_INLINE_INVOKE);
         Register callReg = asRegister(targetAddress);
         assert callReg != METHOD;
         AMD64Call.indirectCall(tasm, masm, callReg, callTarget, state);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/Marks.java	Tue Mar 05 17:22:05 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/Marks.java	Tue Mar 05 19:00:23 2013 +0100
@@ -29,24 +29,16 @@
  */
 public interface Marks {
 
-    // @formatter:off
-    // These constants need to correspond to those of the same name in graalCodeInstaller.hpp
-    Integer MARK_VERIFIED_ENTRY            = 0x0001;
-    Integer MARK_UNVERIFIED_ENTRY          = 0x0002;
-    Integer MARK_OSR_ENTRY                 = 0x0003;
-    Integer MARK_UNWIND_ENTRY              = 0x0004;
-    Integer MARK_EXCEPTION_HANDLER_ENTRY   = 0x0005;
-    Integer MARK_DEOPT_HANDLER_ENTRY       = 0x0006;
-    Integer MARK_STATIC_CALL_STUB          = 0x1000;
-    Integer MARK_INVOKEINTERFACE           = 0x2001;
-    Integer MARK_INVOKESTATIC              = 0x2002;
-    Integer MARK_INVOKESPECIAL             = 0x2003;
-    Integer MARK_INVOKEVIRTUAL             = 0x2004;
-    Integer MARK_INLINE_INVOKEVIRTUAL      = 0x2005;
-    Integer MARK_IMPLICIT_NULL             = 0x3000;
-    Integer MARK_POLL_NEAR                 = 0x3001;
-    Integer MARK_POLL_RETURN_NEAR          = 0x3002;
-    Integer MARK_POLL_FAR                  = 0x3003;
-    Integer MARK_POLL_RETURN_FAR           = 0x3004;
-
+    int MARK_VERIFIED_ENTRY = 1;
+    int MARK_UNVERIFIED_ENTRY = 2;
+    int MARK_OSR_ENTRY = 3;
+    int MARK_EXCEPTION_HANDLER_ENTRY = 4;
+    int MARK_DEOPT_HANDLER_ENTRY = 5;
+    int MARK_INVOKEINTERFACE = 6;
+    int MARK_INVOKEVIRTUAL = 7;
+    int MARK_INLINE_INVOKE = 8;
+    int MARK_POLL_NEAR = 9;
+    int MARK_POLL_RETURN_NEAR = 10;
+    int MARK_POLL_FAR = 11;
+    int MARK_POLL_RETURN_FAR = 12;
 }
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Tue Mar 05 17:22:05 2013 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Tue Mar 05 19:00:23 2013 +0100
@@ -344,7 +344,7 @@
   GrowableArray<jlong>* leaf_graph_ids = get_leaf_graph_ids(comp_result);
 
   result = GraalEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
-    &_implicit_exception_table, GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, true, false, leaf_graph_ids, installed_code);
+    GraalCompiler::instance(), _debug_recorder, _dependencies, NULL, -1, true, false, leaf_graph_ids, installed_code);
 
   method->clear_queued_for_compilation();
 }
@@ -688,9 +688,8 @@
 
     TRACE_graal_3("method call");
     switch (_next_call_type) {
-      case MARK_INLINE_INVOKEVIRTUAL: {
+      case MARK_INLINE_INVOKE:
         break;
-      }
       case MARK_INVOKEVIRTUAL:
       case MARK_INVOKEINTERFACE: {
         assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface");
@@ -700,23 +699,6 @@
         _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc), Assembler::call32_operand);
         break;
       }
-      case MARK_INVOKESTATIC: {
-        assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic");
-
-        NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
-        call->set_destination(SharedRuntime::get_resolve_static_call_stub());
-        _instructions->relocate(call->instruction_address(), relocInfo::static_call_type, Assembler::call32_operand);
-        break;
-      }
-      case MARK_INVOKESPECIAL: {
-        assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial");
-
-        NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
-        call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub());
-        _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type, Assembler::call32_operand);
-        break;
-      }
-      case MARK_INVOKE_INVALID:
       default:
         fatal("invalid _next_call_type value");
         break;
@@ -816,14 +798,6 @@
       case MARK_DEOPT_HANDLER_ENTRY:
         _offsets.set_value(CodeOffsets::Deopt, pc_offset);
         break;
-      case MARK_STATIC_CALL_STUB: {
-        _instructions->relocate(instruction, metadata_Relocation::spec_for_immediate());
-        assert(references->length() == 1, "static call stub needs one reference");
-        oop ref = ((oop*) references->base(T_OBJECT))[0];
-        address call_pc = _instructions->start() + CompilationResult_Site::pcOffset(ref);
-        _instructions->relocate(instruction, static_stub_Relocation::spec(call_pc));
-        break;
-      }
       case MARK_INVOKEVIRTUAL:
       case MARK_INVOKEINTERFACE: {
         // Convert the initial value of the Klass* slot in an inline cache
@@ -832,16 +806,10 @@
         assert(n_copy->data() == 0, "inline cache Klass* initial value should be 0L");
         n_copy->set_data((intptr_t)Universe::non_oop_word());
       }
-      case MARK_INLINE_INVOKEVIRTUAL:
-      case MARK_INVOKE_INVALID:
-      case MARK_INVOKESPECIAL:
-      case MARK_INVOKESTATIC:
+      case MARK_INLINE_INVOKE:
         _next_call_type = (MarkId) id;
         _invoke_mark_pc = instruction;
         break;
-      case MARK_IMPLICIT_NULL:
-        _implicit_exception_table.append(pc_offset, pc_offset);
-        break;
       case MARK_POLL_NEAR: {
         NativeInstruction* ni = nativeInstruction_at(instruction);
         int32_t* disp = (int32_t*) Assembler::locate_operand(instruction, Assembler::disp32_operand);
--- a/src/share/vm/graal/graalCodeInstaller.hpp	Tue Mar 05 17:22:05 2013 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.hpp	Tue Mar 05 19:00:23 2013 +0100
@@ -31,24 +31,19 @@
 private:
   // these need to correspond to Marks.java
   enum MarkId {
-    MARK_VERIFIED_ENTRY             = 0x0001,
-    MARK_UNVERIFIED_ENTRY           = 0x0002,
-    MARK_OSR_ENTRY                  = 0x0003,
-  //MARK_UNWIND_ENTRY               = 0x0004,
-    MARK_EXCEPTION_HANDLER_ENTRY    = 0x0005,
-    MARK_DEOPT_HANDLER_ENTRY        = 0x0006,
-    MARK_STATIC_CALL_STUB           = 0x1000,
-    MARK_INVOKE_INVALID             = 0x2000,
-    MARK_INVOKEINTERFACE            = 0x2001,
-    MARK_INVOKESTATIC               = 0x2002,
-    MARK_INVOKESPECIAL              = 0x2003,
-    MARK_INVOKEVIRTUAL              = 0x2004,
-    MARK_INLINE_INVOKEVIRTUAL       = 0x2005,
-    MARK_IMPLICIT_NULL              = 0x3000,
-    MARK_POLL_NEAR                  = 0x3001,
-    MARK_POLL_RETURN_NEAR           = 0x3002,
-    MARK_POLL_FAR                   = 0x3003,
-    MARK_POLL_RETURN_FAR            = 0x3004
+    MARK_VERIFIED_ENTRY             = 1,
+    MARK_UNVERIFIED_ENTRY           = 2,
+    MARK_OSR_ENTRY                  = 3,
+    MARK_EXCEPTION_HANDLER_ENTRY    = 4,
+    MARK_DEOPT_HANDLER_ENTRY        = 5,
+    MARK_INVOKEINTERFACE            = 6,
+    MARK_INVOKEVIRTUAL              = 7,
+    MARK_INLINE_INVOKE              = 8,
+    MARK_POLL_NEAR                  = 9,
+    MARK_POLL_RETURN_NEAR           = 10,
+    MARK_POLL_FAR                   = 11,
+    MARK_POLL_RETURN_FAR            = 12,
+    MARK_INVOKE_INVALID             = -1
   };
 
   Arena         _arena;
@@ -77,7 +72,6 @@
   DebugInformationRecorder* _debug_recorder;
   Dependencies*             _dependencies;
   ExceptionHandlerTable     _exception_handler_table;
-  ImplicitExceptionTable    _implicit_exception_table;
 
 public:
 
--- a/src/share/vm/graal/graalEnv.cpp	Tue Mar 05 17:22:05 2013 +0100
+++ b/src/share/vm/graal/graalEnv.cpp	Tue Mar 05 19:00:23 2013 +0100
@@ -410,7 +410,6 @@
                                 int frame_words,
                                 OopMapSet* oop_map_set,
                                 ExceptionHandlerTable* handler_table,
-                                ImplicitExceptionTable* inc_table,
                                 AbstractCompiler* compiler,
                                 DebugInformationRecorder* debug_info,
                                 Dependencies* dependencies,
@@ -455,7 +454,7 @@
       //code_buffer->free_blob();
       return GraalEnv::dependencies_failed;
     }
-
+    ImplicitExceptionTable implicit_tbl;
     nm =  nmethod::new_nmethod(method,
                                compile_id,
                                entry_bci,
@@ -463,7 +462,7 @@
                                orig_pc_offset,
                                debug_info, dependencies, code_buffer,
                                frame_words, oop_map_set,
-                               handler_table, inc_table,
+                               handler_table, &implicit_tbl,
                                compiler, comp_level, leaf_graph_ids, installed_code);
 
     // Free codeBlobs
--- a/src/share/vm/graal/graalEnv.hpp	Tue Mar 05 17:22:05 2013 +0100
+++ b/src/share/vm/graal/graalEnv.hpp	Tue Mar 05 19:00:23 2013 +0100
@@ -138,7 +138,6 @@
                        int                       frame_words,
                        OopMapSet*                oop_map_set,
                        ExceptionHandlerTable*    handler_table,
-                       ImplicitExceptionTable*   inc_table,
                        AbstractCompiler*         compiler,
                        DebugInformationRecorder* debug_info,
                        Dependencies*             dependencies,