< prev index next >

src/cpu/sparc/vm/compiledIC_sparc.cpp

Print this page




  36 
  37 // Release the CompiledICHolder* associated with this call site is there is one.
  38 void CompiledIC::cleanup_call_site(virtual_call_Relocation* call_site) {
  39   // This call site might have become stale so inspect it carefully.
  40   NativeCall* call = nativeCall_at(call_site->addr());
  41   if (is_icholder_entry(call->destination())) {
  42     NativeMovConstReg* value = nativeMovConstReg_at(call_site->cached_value());
  43     InlineCacheBuffer::queue_for_release((CompiledICHolder*)value->data());
  44   }
  45 }
  46 
  47 bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
  48   // This call site might have become stale so inspect it carefully.
  49   NativeCall* call = nativeCall_at(call_site->addr());
  50   return is_icholder_entry(call->destination());
  51 }
  52 
  53 // ----------------------------------------------------------------------------
  54 
  55 #define __ _masm.
  56 void CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
  57 #ifdef COMPILER2
  58   // Stub is fixed up when the corresponding call is converted from calling
  59   // compiled code to calling interpreted code.
  60   // set (empty), G5
  61   // jmp -1
  62 
  63   address mark = cbuf.insts_mark();  // Get mark within main instrs section.
  64 
  65   MacroAssembler _masm(&cbuf);
  66 
  67   address base =
  68   __ start_a_stub(to_interp_stub_size()*2);
  69   if (base == NULL) return;  // CodeBuffer::expand failed.

  70 
  71   // Static stub relocation stores the instruction address of the call.
  72   __ relocate(static_stub_Relocation::spec(mark));
  73 
  74   __ set_metadata(NULL, as_Register(Matcher::inline_cache_reg_encode()));
  75 
  76   __ set_inst_mark();
  77   AddressLiteral addrlit(-1);
  78   __ JUMP(addrlit, G3, 0);
  79 
  80   __ delayed()->nop();
  81 
  82   // Update current stubs pointer and restore code_end.
  83   __ end_a_stub();

  84 #else
  85   ShouldNotReachHere();
  86 #endif
  87 }
  88 #undef __
  89 
  90 int CompiledStaticCall::to_interp_stub_size() {
  91   // This doesn't need to be accurate but it must be larger or equal to
  92   // the real size of the stub.
  93   return (NativeMovConstReg::instruction_size +  // sethi/setlo;
  94           NativeJump::instruction_size + // sethi; jmp; nop
  95           (TraceJumps ? 20 * BytesPerInstWord : 0) );
  96 }
  97 
  98 // Relocation entries for call stub, compiled java to interpreter.
  99 int CompiledStaticCall::reloc_to_interp_stub() {
 100   return 10;  // 4 in emit_java_to_interp + 1 in Java_Static_Call
 101 }
 102 
 103 void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) {




  36 
  37 // Release the CompiledICHolder* associated with this call site is there is one.
  38 void CompiledIC::cleanup_call_site(virtual_call_Relocation* call_site) {
  39   // This call site might have become stale so inspect it carefully.
  40   NativeCall* call = nativeCall_at(call_site->addr());
  41   if (is_icholder_entry(call->destination())) {
  42     NativeMovConstReg* value = nativeMovConstReg_at(call_site->cached_value());
  43     InlineCacheBuffer::queue_for_release((CompiledICHolder*)value->data());
  44   }
  45 }
  46 
  47 bool CompiledIC::is_icholder_call_site(virtual_call_Relocation* call_site) {
  48   // This call site might have become stale so inspect it carefully.
  49   NativeCall* call = nativeCall_at(call_site->addr());
  50   return is_icholder_entry(call->destination());
  51 }
  52 
  53 // ----------------------------------------------------------------------------
  54 
  55 #define __ _masm.
  56 address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf) {
  57 #ifdef COMPILER2
  58   // Stub is fixed up when the corresponding call is converted from calling
  59   // compiled code to calling interpreted code.
  60   // set (empty), G5
  61   // jmp -1
  62 
  63   address mark = cbuf.insts_mark();  // Get mark within main instrs section.
  64 
  65   MacroAssembler _masm(&cbuf);
  66 
  67   address base = __ start_a_stub(to_interp_stub_size());
  68   if (base == NULL) {
  69     return NULL;  // CodeBuffer::expand failed.
  70   }
  71 
  72   // Static stub relocation stores the instruction address of the call.
  73   __ relocate(static_stub_Relocation::spec(mark));
  74 
  75   __ set_metadata(NULL, as_Register(Matcher::inline_cache_reg_encode()));
  76 
  77   __ set_inst_mark();
  78   AddressLiteral addrlit(-1);
  79   __ JUMP(addrlit, G3, 0);
  80 
  81   __ delayed()->nop();
  82 
  83   // Update current stubs pointer and restore code_end.
  84   __ end_a_stub();
  85   return base;
  86 #else
  87   ShouldNotReachHere();
  88 #endif
  89 }
  90 #undef __
  91 
  92 int CompiledStaticCall::to_interp_stub_size() {
  93   // This doesn't need to be accurate but it must be larger or equal to
  94   // the real size of the stub.
  95   return (NativeMovConstReg::instruction_size +  // sethi/setlo;
  96           NativeJump::instruction_size + // sethi; jmp; nop
  97           (TraceJumps ? 20 * BytesPerInstWord : 0) );
  98 }
  99 
 100 // Relocation entries for call stub, compiled java to interpreter.
 101 int CompiledStaticCall::reloc_to_interp_stub() {
 102   return 10;  // 4 in emit_java_to_interp + 1 in Java_Static_Call
 103 }
 104 
 105 void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) {


< prev index next >