< prev index next >

src/hotspot/share/c1/c1_Runtime1.cpp

Print this page

  42 #include "compiler/disassembler.hpp"
  43 #include "compiler/oopMap.hpp"
  44 #include "gc/shared/barrierSet.hpp"
  45 #include "gc/shared/c1/barrierSetC1.hpp"
  46 #include "gc/shared/collectedHeap.hpp"
  47 #include "interpreter/bytecode.hpp"
  48 #include "interpreter/interpreter.hpp"
  49 #include "jfr/support/jfrIntrinsics.hpp"
  50 #include "logging/log.hpp"
  51 #include "memory/allocation.inline.hpp"
  52 #include "memory/oopFactory.hpp"
  53 #include "memory/resourceArea.hpp"
  54 #include "memory/universe.hpp"
  55 #include "oops/access.inline.hpp"
  56 #include "oops/klass.inline.hpp"
  57 #include "oops/objArrayOop.inline.hpp"
  58 #include "oops/objArrayKlass.hpp"
  59 #include "oops/oop.inline.hpp"
  60 #include "prims/jvmtiExport.hpp"
  61 #include "runtime/atomic.hpp"

  62 #include "runtime/fieldDescriptor.inline.hpp"
  63 #include "runtime/frame.inline.hpp"
  64 #include "runtime/handles.inline.hpp"
  65 #include "runtime/interfaceSupport.inline.hpp"
  66 #include "runtime/javaCalls.hpp"
  67 #include "runtime/sharedRuntime.hpp"
  68 #include "runtime/stackWatermarkSet.hpp"
  69 #include "runtime/stubRoutines.hpp"
  70 #include "runtime/threadCritical.hpp"
  71 #include "runtime/vframe.inline.hpp"
  72 #include "runtime/vframeArray.hpp"
  73 #include "runtime/vm_version.hpp"
  74 #include "utilities/copy.hpp"
  75 #include "utilities/events.hpp"
  76 
  77 
  78 // Implementation of StubAssembler
  79 
  80 StubAssembler::StubAssembler(CodeBuffer* code, const char * name, int stub_id) : C1_MacroAssembler(code) {
  81   _name = name;

 310   FUNCTION_CASE(entry, SharedRuntime::dlog10);
 311   FUNCTION_CASE(entry, SharedRuntime::dpow);
 312   FUNCTION_CASE(entry, SharedRuntime::drem);
 313   FUNCTION_CASE(entry, SharedRuntime::dsin);
 314   FUNCTION_CASE(entry, SharedRuntime::dtan);
 315   FUNCTION_CASE(entry, SharedRuntime::f2i);
 316   FUNCTION_CASE(entry, SharedRuntime::f2l);
 317   FUNCTION_CASE(entry, SharedRuntime::frem);
 318   FUNCTION_CASE(entry, SharedRuntime::l2d);
 319   FUNCTION_CASE(entry, SharedRuntime::l2f);
 320   FUNCTION_CASE(entry, SharedRuntime::ldiv);
 321   FUNCTION_CASE(entry, SharedRuntime::lmul);
 322   FUNCTION_CASE(entry, SharedRuntime::lrem);
 323   FUNCTION_CASE(entry, SharedRuntime::lrem);
 324   FUNCTION_CASE(entry, SharedRuntime::dtrace_method_entry);
 325   FUNCTION_CASE(entry, SharedRuntime::dtrace_method_exit);
 326   FUNCTION_CASE(entry, is_instance_of);
 327   FUNCTION_CASE(entry, trace_block_entry);
 328 #ifdef JFR_HAVE_INTRINSICS
 329   FUNCTION_CASE(entry, JFR_TIME_FUNCTION);

 330 #endif
 331   FUNCTION_CASE(entry, StubRoutines::updateBytesCRC32());
 332   FUNCTION_CASE(entry, StubRoutines::updateBytesCRC32C());
 333   FUNCTION_CASE(entry, StubRoutines::vectorizedMismatch());
 334   FUNCTION_CASE(entry, StubRoutines::dexp());
 335   FUNCTION_CASE(entry, StubRoutines::dlog());
 336   FUNCTION_CASE(entry, StubRoutines::dlog10());
 337   FUNCTION_CASE(entry, StubRoutines::dpow());
 338   FUNCTION_CASE(entry, StubRoutines::dsin());
 339   FUNCTION_CASE(entry, StubRoutines::dcos());
 340   FUNCTION_CASE(entry, StubRoutines::dtan());

 341 
 342 #undef FUNCTION_CASE
 343 
 344   // Soft float adds more runtime names.
 345   return pd_name_for_address(entry);
 346 }
 347 
 348 
 349 JRT_ENTRY(void, Runtime1::new_instance(JavaThread* current, Klass* klass))
 350 #ifndef PRODUCT
 351   if (PrintC1Statistics) {
 352     _new_instance_slowcase_cnt++;
 353   }
 354 #endif
 355   assert(klass->is_klass(), "not a class");
 356   Handle holder(current, klass->klass_holder()); // keep the klass alive
 357   InstanceKlass* h = InstanceKlass::cast(klass);
 358   h->check_valid_for_instantiation(true, CHECK);
 359   // make sure klass is initialized
 360   h->initialize(CHECK);

 727   if (PrintC1Statistics) {
 728     _throw_incompatible_class_change_error_count++;
 729   }
 730 #endif
 731   ResourceMark rm(current);
 732   SharedRuntime::throw_and_post_jvmti_exception(current, vmSymbols::java_lang_IncompatibleClassChangeError());
 733 JRT_END
 734 
 735 
 736 JRT_BLOCK_ENTRY(void, Runtime1::monitorenter(JavaThread* current, oopDesc* obj, BasicObjectLock* lock))
 737 #ifndef PRODUCT
 738   if (PrintC1Statistics) {
 739     _monitorenter_slowcase_cnt++;
 740   }
 741 #endif
 742   if (!UseFastLocking) {
 743     lock->set_obj(obj);
 744   }
 745   assert(obj == lock->obj(), "must match");
 746   SharedRuntime::monitor_enter_helper(obj, lock->lock(), current);

 747 JRT_END
 748 
 749 
 750 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* current, BasicObjectLock* lock))
 751 #ifndef PRODUCT
 752   if (PrintC1Statistics) {
 753     _monitorexit_slowcase_cnt++;
 754   }
 755 #endif
 756   assert(current->last_Java_sp(), "last_Java_sp must be set");
 757   oop obj = lock->obj();
 758   assert(oopDesc::is_oop(obj), "must be NULL or an object");
 759   SharedRuntime::monitor_exit_helper(obj, lock->lock(), current);
 760 JRT_END
 761 
 762 // Cf. OptoRuntime::deoptimize_caller_frame
 763 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* current, jint trap_request))
 764   // Called from within the owner thread, so no need for safepoint
 765   RegisterMap reg_map(current, false);
 766   frame stub_frame = current->last_frame();

  42 #include "compiler/disassembler.hpp"
  43 #include "compiler/oopMap.hpp"
  44 #include "gc/shared/barrierSet.hpp"
  45 #include "gc/shared/c1/barrierSetC1.hpp"
  46 #include "gc/shared/collectedHeap.hpp"
  47 #include "interpreter/bytecode.hpp"
  48 #include "interpreter/interpreter.hpp"
  49 #include "jfr/support/jfrIntrinsics.hpp"
  50 #include "logging/log.hpp"
  51 #include "memory/allocation.inline.hpp"
  52 #include "memory/oopFactory.hpp"
  53 #include "memory/resourceArea.hpp"
  54 #include "memory/universe.hpp"
  55 #include "oops/access.inline.hpp"
  56 #include "oops/klass.inline.hpp"
  57 #include "oops/objArrayOop.inline.hpp"
  58 #include "oops/objArrayKlass.hpp"
  59 #include "oops/oop.inline.hpp"
  60 #include "prims/jvmtiExport.hpp"
  61 #include "runtime/atomic.hpp"
  62 #include "runtime/continuation.hpp"
  63 #include "runtime/fieldDescriptor.inline.hpp"
  64 #include "runtime/frame.inline.hpp"
  65 #include "runtime/handles.inline.hpp"
  66 #include "runtime/interfaceSupport.inline.hpp"
  67 #include "runtime/javaCalls.hpp"
  68 #include "runtime/sharedRuntime.hpp"
  69 #include "runtime/stackWatermarkSet.hpp"
  70 #include "runtime/stubRoutines.hpp"
  71 #include "runtime/threadCritical.hpp"
  72 #include "runtime/vframe.inline.hpp"
  73 #include "runtime/vframeArray.hpp"
  74 #include "runtime/vm_version.hpp"
  75 #include "utilities/copy.hpp"
  76 #include "utilities/events.hpp"
  77 
  78 
  79 // Implementation of StubAssembler
  80 
  81 StubAssembler::StubAssembler(CodeBuffer* code, const char * name, int stub_id) : C1_MacroAssembler(code) {
  82   _name = name;

 311   FUNCTION_CASE(entry, SharedRuntime::dlog10);
 312   FUNCTION_CASE(entry, SharedRuntime::dpow);
 313   FUNCTION_CASE(entry, SharedRuntime::drem);
 314   FUNCTION_CASE(entry, SharedRuntime::dsin);
 315   FUNCTION_CASE(entry, SharedRuntime::dtan);
 316   FUNCTION_CASE(entry, SharedRuntime::f2i);
 317   FUNCTION_CASE(entry, SharedRuntime::f2l);
 318   FUNCTION_CASE(entry, SharedRuntime::frem);
 319   FUNCTION_CASE(entry, SharedRuntime::l2d);
 320   FUNCTION_CASE(entry, SharedRuntime::l2f);
 321   FUNCTION_CASE(entry, SharedRuntime::ldiv);
 322   FUNCTION_CASE(entry, SharedRuntime::lmul);
 323   FUNCTION_CASE(entry, SharedRuntime::lrem);
 324   FUNCTION_CASE(entry, SharedRuntime::lrem);
 325   FUNCTION_CASE(entry, SharedRuntime::dtrace_method_entry);
 326   FUNCTION_CASE(entry, SharedRuntime::dtrace_method_exit);
 327   FUNCTION_CASE(entry, is_instance_of);
 328   FUNCTION_CASE(entry, trace_block_entry);
 329 #ifdef JFR_HAVE_INTRINSICS
 330   FUNCTION_CASE(entry, JFR_TIME_FUNCTION);
 331   FUNCTION_CASE(entry, StubRoutines::jfr_get_event_writer());
 332 #endif
 333   FUNCTION_CASE(entry, StubRoutines::updateBytesCRC32());
 334   FUNCTION_CASE(entry, StubRoutines::updateBytesCRC32C());
 335   FUNCTION_CASE(entry, StubRoutines::vectorizedMismatch());
 336   FUNCTION_CASE(entry, StubRoutines::dexp());
 337   FUNCTION_CASE(entry, StubRoutines::dlog());
 338   FUNCTION_CASE(entry, StubRoutines::dlog10());
 339   FUNCTION_CASE(entry, StubRoutines::dpow());
 340   FUNCTION_CASE(entry, StubRoutines::dsin());
 341   FUNCTION_CASE(entry, StubRoutines::dcos());
 342   FUNCTION_CASE(entry, StubRoutines::dtan());
 343   FUNCTION_CASE(entry, StubRoutines::cont_doYield());
 344 
 345 #undef FUNCTION_CASE
 346 
 347   // Soft float adds more runtime names.
 348   return pd_name_for_address(entry);
 349 }
 350 
 351 
 352 JRT_ENTRY(void, Runtime1::new_instance(JavaThread* current, Klass* klass))
 353 #ifndef PRODUCT
 354   if (PrintC1Statistics) {
 355     _new_instance_slowcase_cnt++;
 356   }
 357 #endif
 358   assert(klass->is_klass(), "not a class");
 359   Handle holder(current, klass->klass_holder()); // keep the klass alive
 360   InstanceKlass* h = InstanceKlass::cast(klass);
 361   h->check_valid_for_instantiation(true, CHECK);
 362   // make sure klass is initialized
 363   h->initialize(CHECK);

 730   if (PrintC1Statistics) {
 731     _throw_incompatible_class_change_error_count++;
 732   }
 733 #endif
 734   ResourceMark rm(current);
 735   SharedRuntime::throw_and_post_jvmti_exception(current, vmSymbols::java_lang_IncompatibleClassChangeError());
 736 JRT_END
 737 
 738 
 739 JRT_BLOCK_ENTRY(void, Runtime1::monitorenter(JavaThread* current, oopDesc* obj, BasicObjectLock* lock))
 740 #ifndef PRODUCT
 741   if (PrintC1Statistics) {
 742     _monitorenter_slowcase_cnt++;
 743   }
 744 #endif
 745   if (!UseFastLocking) {
 746     lock->set_obj(obj);
 747   }
 748   assert(obj == lock->obj(), "must match");
 749   SharedRuntime::monitor_enter_helper(obj, lock->lock(), current);
 750   current->inc_held_monitor_count();
 751 JRT_END
 752 
 753 
 754 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* current, BasicObjectLock* lock))
 755 #ifndef PRODUCT
 756   if (PrintC1Statistics) {
 757     _monitorexit_slowcase_cnt++;
 758   }
 759 #endif
 760   assert(current->last_Java_sp(), "last_Java_sp must be set");
 761   oop obj = lock->obj();
 762   assert(oopDesc::is_oop(obj), "must be NULL or an object");
 763   SharedRuntime::monitor_exit_helper(obj, lock->lock(), current);
 764 JRT_END
 765 
 766 // Cf. OptoRuntime::deoptimize_caller_frame
 767 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* current, jint trap_request))
 768   // Called from within the owner thread, so no need for safepoint
 769   RegisterMap reg_map(current, false);
 770   frame stub_frame = current->last_frame();
< prev index next >