src/hotspot/share/runtime/stubCodeGenerator.cpp
changeset 50528 1fd4844371bb
parent 47216 71c04702a3d5
child 54807 33fe50b6d707
equal deleted inserted replaced
50527:83fd54252ee4 50528:1fd4844371bb
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    69   _masm = new MacroAssembler(code );
    69   _masm = new MacroAssembler(code );
    70   _print_code = PrintStubCode || print_code;
    70   _print_code = PrintStubCode || print_code;
    71 }
    71 }
    72 
    72 
    73 StubCodeGenerator::~StubCodeGenerator() {
    73 StubCodeGenerator::~StubCodeGenerator() {
    74   if (_print_code) {
    74   if (PRODUCT_ONLY(_print_code) NOT_PRODUCT(true)) {
    75     CodeBuffer* cbuf = _masm->code();
    75     CodeBuffer* cbuf = _masm->code();
    76     CodeBlob*   blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
    76     CodeBlob*   blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
    77     if (blob != NULL) {
    77     if (blob != NULL) {
    78       blob->set_strings(cbuf->strings());
    78       blob->set_strings(cbuf->strings());
    79     }
    79     }
    84   // default implementation - do nothing
    84   // default implementation - do nothing
    85 }
    85 }
    86 
    86 
    87 void StubCodeGenerator::stub_epilog(StubCodeDesc* cdesc) {
    87 void StubCodeGenerator::stub_epilog(StubCodeDesc* cdesc) {
    88   if (_print_code) {
    88   if (_print_code) {
       
    89     CodeStrings cs;
       
    90     ptrdiff_t offset = 0;
       
    91 #ifndef PRODUCT
       
    92     // Find the code strings in the outer CodeBuffer.
       
    93     CodeBuffer *outer_cbuf = _masm->code_section()->outer();
       
    94     cs = outer_cbuf->strings();
       
    95     // The offset from the start of the outer CodeBuffer to the start
       
    96     // of this stub.
       
    97     offset = cdesc->begin() - outer_cbuf->insts()->start();
       
    98 #endif
    89     cdesc->print();
    99     cdesc->print();
    90     tty->cr();
   100     tty->cr();
    91     Disassembler::decode(cdesc->begin(), cdesc->end());
   101     Disassembler::decode(cdesc->begin(), cdesc->end(), NULL, cs, offset);
    92     tty->cr();
   102     tty->cr();
    93   }
   103   }
    94 }
   104 }
    95 
   105 
    96 
   106