< prev index next >

src/share/vm/compiler/compileTask.cpp

Print this page
rev 13105 : imported patch 8181917-refactor-ul-logstream-alt1-callsite-changes


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "compiler/compileTask.hpp"
  27 #include "compiler/compileLog.hpp"
  28 #include "compiler/compileBroker.hpp"
  29 #include "compiler/compilerDirectives.hpp"


  30 #include "memory/resourceArea.hpp"
  31 
  32 CompileTask*  CompileTask::_task_free_list = NULL;
  33 #ifdef ASSERT
  34 int CompileTask::_num_allocated_tasks = 0;
  35 #endif
  36 
  37 /**
  38  * Allocate a CompileTask, from the free list if possible.
  39  */
  40 CompileTask* CompileTask::allocate() {
  41   MutexLocker locker(CompileTaskAlloc_lock);
  42   CompileTask* task = NULL;
  43 
  44   if (_task_free_list != NULL) {
  45     task = _task_free_list;
  46     _task_free_list = task->next();
  47     task->set_next(NULL);
  48   } else {
  49     task = new CompileTask();


 408     st->print("  ");
 409   }
 410   st->print("     ");        // more indent
 411   st->print("    ");         // initial inlining indent
 412 
 413   for (int i = 0; i < inline_level; i++)  st->print("  ");
 414 
 415   st->print("@ %d  ", bci);  // print bci
 416   method->print_short_name(st);
 417   if (method->is_loaded())
 418     st->print(" (%d bytes)", method->code_size());
 419   else
 420     st->print(" (not loaded)");
 421 
 422   if (msg != NULL) {
 423     st->print("   %s", msg);
 424   }
 425   st->cr();
 426 }
 427 



























 428 


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "compiler/compileTask.hpp"
  27 #include "compiler/compileLog.hpp"
  28 #include "compiler/compileBroker.hpp"
  29 #include "compiler/compilerDirectives.hpp"
  30 #include "logging/log.hpp"
  31 #include "logging/logStream.hpp"
  32 #include "memory/resourceArea.hpp"
  33 
  34 CompileTask*  CompileTask::_task_free_list = NULL;
  35 #ifdef ASSERT
  36 int CompileTask::_num_allocated_tasks = 0;
  37 #endif
  38 
  39 /**
  40  * Allocate a CompileTask, from the free list if possible.
  41  */
  42 CompileTask* CompileTask::allocate() {
  43   MutexLocker locker(CompileTaskAlloc_lock);
  44   CompileTask* task = NULL;
  45 
  46   if (_task_free_list != NULL) {
  47     task = _task_free_list;
  48     _task_free_list = task->next();
  49     task->set_next(NULL);
  50   } else {
  51     task = new CompileTask();


 410     st->print("  ");
 411   }
 412   st->print("     ");        // more indent
 413   st->print("    ");         // initial inlining indent
 414 
 415   for (int i = 0; i < inline_level; i++)  st->print("  ");
 416 
 417   st->print("@ %d  ", bci);  // print bci
 418   method->print_short_name(st);
 419   if (method->is_loaded())
 420     st->print(" (%d bytes)", method->code_size());
 421   else
 422     st->print(" (not loaded)");
 423 
 424   if (msg != NULL) {
 425     st->print("   %s", msg);
 426   }
 427   st->cr();
 428 }
 429 
 430 void CompileTask::print_ul(const char* msg){
 431   LogTarget(Debug, jit, compilation) lt;
 432   if (lt.is_enabled()) {
 433     LogStream ls(lt);
 434     print(&ls, msg, /* short form */ true, /* cr */ true);
 435   }
 436 }
 437 
 438 void CompileTask::print_ul(const nmethod* nm, const char* msg) {
 439   LogTarget(Debug, jit, compilation) lt;
 440   if (lt.is_enabled()) {
 441     LogStream ls(lt);
 442     print_impl(&ls, nm->method(), nm->compile_id(),
 443                nm->comp_level(), nm->is_osr_method(),
 444                nm->is_osr_method() ? nm->osr_entry_bci() : -1,
 445                /*is_blocking*/ false,
 446                msg, /* short form */ true, /* cr */ true);
 447   }
 448 }
 449 
 450 void CompileTask::print_inlining_ul(ciMethod* method, int inline_level, int bci, const char* msg) {
 451   LogTarget(Debug, jit, inlining) lt;
 452   if (lt.is_enabled()) {
 453     LogStream ls(lt);
 454     print_inlining_inner(&ls, method, inline_level, bci, msg);
 455   }
 456 }
 457 
< prev index next >