18 * |
18 * |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
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 |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
|
24 |
|
25 /* |
|
26 * This file has been modified by Loongson Technology in 2015. These |
|
27 * modifications are Copyright (c) 2015 Loongson Technology, and are made |
|
28 * available on the same license terms set forth above. |
|
29 */ |
23 */ |
30 |
24 |
31 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
32 #include "classfile/systemDictionary.hpp" |
26 #include "classfile/systemDictionary.hpp" |
33 #include "classfile/vmSymbols.hpp" |
27 #include "classfile/vmSymbols.hpp" |
261 // recycling a non-blocking CompileTask. |
255 // recycling a non-blocking CompileTask. |
262 CompileBroker::free_task(task); |
256 CompileBroker::free_task(task); |
263 } |
257 } |
264 } |
258 } |
265 |
259 |
266 #ifdef MIPS64 |
|
267 void CompileTask::set_weight() { |
|
268 assert(FactorOfSizeScheduling >= 0 && FactorOfSizeScheduling <= 100, "FactorOfSizeScheduling should be in [0, 100]"); |
|
269 _weight = 100 * FactorOfSizeScheduling / (_method_code_size + 1) + 10 * (100 - FactorOfSizeScheduling) * _speed; |
|
270 } |
|
271 #endif |
|
272 |
260 |
273 // ------------------------------------------------------------------ |
261 // ------------------------------------------------------------------ |
274 // CompileTask::initialize |
262 // CompileTask::initialize |
275 void CompileTask::initialize(int compile_id, |
263 void CompileTask::initialize(int compile_id, |
276 methodHandle method, |
264 methodHandle method, |
282 bool is_blocking) { |
270 bool is_blocking) { |
283 assert(!_lock->is_locked(), "bad locking"); |
271 assert(!_lock->is_locked(), "bad locking"); |
284 |
272 |
285 _compile_id = compile_id; |
273 _compile_id = compile_id; |
286 _method = method(); |
274 _method = method(); |
287 #ifdef MIPS64 |
|
288 _prev_time = os::javaTimeMillis(); |
|
289 _prev_ic_count = _method->interpreter_invocation_count(); |
|
290 _prev_bc_count = _method->backedge_count() + _method->get_decay_counter(); |
|
291 _speed = 10.0; |
|
292 _method_code_size = _method->code_size() >> 3; |
|
293 set_weight(); |
|
294 #endif |
|
295 _method_holder = JNIHandles::make_global(method->method_holder()->klass_holder()); |
275 _method_holder = JNIHandles::make_global(method->method_holder()->klass_holder()); |
296 _osr_bci = osr_bci; |
276 _osr_bci = osr_bci; |
297 _is_blocking = is_blocking; |
277 _is_blocking = is_blocking; |
298 _comp_level = comp_level; |
278 _comp_level = comp_level; |
299 _num_inlined_bytecodes = 0; |
279 _num_inlined_bytecodes = 0; |
625 assert(_last->next() == NULL, "not last"); |
605 assert(_last->next() == NULL, "not last"); |
626 _last->set_next(task); |
606 _last->set_next(task); |
627 task->set_prev(_last); |
607 task->set_prev(_last); |
628 _last = task; |
608 _last = task; |
629 } |
609 } |
630 |
|
631 ++_size; |
610 ++_size; |
632 |
|
633 #ifdef MIPS64 |
|
634 _queued_method_size += task->method()->code_size(); |
|
635 #endif |
|
636 |
611 |
637 // Mark the method as being in the compile queue. |
612 // Mark the method as being in the compile queue. |
638 task->method()->set_queued_for_compilation(); |
613 task->method()->set_queued_for_compilation(); |
639 |
614 |
640 if (CIPrintCompileQueue) { |
615 if (CIPrintCompileQueue) { |
738 // max is the last element |
710 // max is the last element |
739 assert(task == _last, "Sanity"); |
711 assert(task == _last, "Sanity"); |
740 _last = task->prev(); |
712 _last = task->prev(); |
741 } |
713 } |
742 --_size; |
714 --_size; |
743 #ifdef MIPS64 |
|
744 _queued_method_size -= task->method()->code_size(); |
|
745 #endif |
|
746 } |
715 } |
747 |
716 |
748 // methods in the compile queue need to be marked as used on the stack |
717 // methods in the compile queue need to be marked as used on the stack |
749 // so that they don't get reclaimed by Redefine Classes |
718 // so that they don't get reclaimed by Redefine Classes |
750 void CompileQueue::mark_on_stack() { |
719 void CompileQueue::mark_on_stack() { |