129 friend class Matcher; // allow access to stub names 130 131 private: 132 // define stubs 133 static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char *name, int is_fancy_jump, bool pass_tls, bool save_arguments, bool return_pc); 134 135 // References to generated stubs 136 static address _new_instance_Java; 137 static address _new_array_Java; 138 static address _new_array_nozero_Java; 139 static address _multianewarray2_Java; 140 static address _multianewarray3_Java; 141 static address _multianewarray4_Java; 142 static address _multianewarray5_Java; 143 static address _multianewarrayN_Java; 144 static address _g1_wb_pre_Java; 145 static address _g1_wb_post_Java; 146 static address _vtable_must_compile_Java; 147 static address _complete_monitor_locking_Java; 148 static address _rethrow_Java; 149 150 static address _slow_arraycopy_Java; 151 static address _register_finalizer_Java; 152 153 # ifdef ENABLE_ZAP_DEAD_LOCALS 154 static address _zap_dead_Java_locals_Java; 155 static address _zap_dead_native_locals_Java; 156 # endif 157 158 159 // 160 // Implementation of runtime methods 161 // ================================= 162 163 // Allocate storage for a Java instance. 164 static void new_instance_C(Klass* instance_klass, JavaThread *thread); 165 166 // Allocate storage for a objArray or typeArray 167 static void new_array_C(Klass* array_klass, int len, JavaThread *thread); 168 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread *thread); 169 170 // Post-slow-path-allocation, pre-initializing-stores step for 171 // implementing ReduceInitialCardMarks 172 static void new_store_pre_barrier(JavaThread* thread); 173 174 // Allocate storage for a multi-dimensional arrays 175 // Note: needs to be fixed for arbitrary number of dimensions 176 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread *thread); 177 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread *thread); 178 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread *thread); 179 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread *thread); 180 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread *thread); 181 static void g1_wb_pre_C(oopDesc* orig, JavaThread* thread); 182 static void g1_wb_post_C(void* card_addr, JavaThread* thread); 183 184 public: 185 // Slow-path Locking and Unlocking 186 static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); 187 static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); 188 189 private: 190 191 // Implicit exception support 192 static void throw_null_exception_C(JavaThread* thread); 193 194 // Exception handling 195 static address handle_exception_C (JavaThread* thread); 196 static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm); 197 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc ); 198 static void deoptimize_caller_frame (JavaThread *thread); 199 static void deoptimize_caller_frame (JavaThread *thread, bool doit); 200 static bool is_deoptimized_caller_frame (JavaThread *thread); 201 202 // CodeBlob support 203 // =================================================================== 204 205 static ExceptionBlob* _exception_blob; 206 static void generate_exception_blob(); 207 208 static void register_finalizer(oopDesc* obj, JavaThread* thread); 228 // when runtime stubs have been generated successfully and 229 // false otherwise. 230 static bool generate(ciEnv* env); 231 232 // Returns the name of a stub 233 static const char* stub_name(address entry); 234 235 // access to runtime stubs entry points for java code 236 static address new_instance_Java() { return _new_instance_Java; } 237 static address new_array_Java() { return _new_array_Java; } 238 static address new_array_nozero_Java() { return _new_array_nozero_Java; } 239 static address multianewarray2_Java() { return _multianewarray2_Java; } 240 static address multianewarray3_Java() { return _multianewarray3_Java; } 241 static address multianewarray4_Java() { return _multianewarray4_Java; } 242 static address multianewarray5_Java() { return _multianewarray5_Java; } 243 static address multianewarrayN_Java() { return _multianewarrayN_Java; } 244 static address g1_wb_pre_Java() { return _g1_wb_pre_Java; } 245 static address g1_wb_post_Java() { return _g1_wb_post_Java; } 246 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; } 247 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; } 248 249 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; } 250 static address register_finalizer_Java() { return _register_finalizer_Java; } 251 252 253 # ifdef ENABLE_ZAP_DEAD_LOCALS 254 static address zap_dead_locals_stub(bool is_native) { return is_native 255 ? _zap_dead_native_locals_Java 256 : _zap_dead_Java_locals_Java; } 257 static MachNode* node_to_call_zap_dead_locals(Node* n, int block_num, bool is_native); 258 # endif 259 260 static ExceptionBlob* exception_blob() { return _exception_blob; } 261 262 // Leaf routines helping with method data update 263 static void profile_receiver_type_C(DataLayout* data, oopDesc* receiver); 264 265 // Implicit exception support 266 static void throw_div0_exception_C (JavaThread* thread); 267 static void throw_stack_overflow_error_C(JavaThread* thread); 268 269 // Exception handling 270 static address rethrow_stub() { return _rethrow_Java; } 271 272 273 // Type functions 274 // ====================================================== 275 276 static const TypeFunc* new_instance_Type(); // object allocation (slow case) 277 static const TypeFunc* new_array_Type (); // [a]newarray (slow case) 278 static const TypeFunc* multianewarray_Type(int ndim); // multianewarray 279 static const TypeFunc* multianewarray2_Type(); // multianewarray 280 static const TypeFunc* multianewarray3_Type(); // multianewarray 281 static const TypeFunc* multianewarray4_Type(); // multianewarray 282 static const TypeFunc* multianewarray5_Type(); // multianewarray 283 static const TypeFunc* multianewarrayN_Type(); // multianewarray 284 static const TypeFunc* g1_wb_pre_Type(); 285 static const TypeFunc* g1_wb_post_Type(); 286 static const TypeFunc* complete_monitor_enter_Type(); 287 static const TypeFunc* complete_monitor_exit_Type(); 288 static const TypeFunc* uncommon_trap_Type(); 289 static const TypeFunc* athrow_Type(); 290 static const TypeFunc* rethrow_Type(); 291 static const TypeFunc* Math_D_D_Type(); // sin,cos & friends 292 static const TypeFunc* Math_DD_D_Type(); // mod,pow & friends 293 static const TypeFunc* modf_Type(); 294 static const TypeFunc* l2f_Type(); 295 static const TypeFunc* void_long_Type(); 296 297 static const TypeFunc* flush_windows_Type(); 298 299 // arraycopy routine types 300 static const TypeFunc* fast_arraycopy_Type(); // bit-blasters 301 static const TypeFunc* checkcast_arraycopy_Type(); 302 static const TypeFunc* generic_arraycopy_Type(); 303 static const TypeFunc* slow_arraycopy_Type(); // the full routine 304 305 static const TypeFunc* array_fill_Type(); 306 307 static const TypeFunc* aescrypt_block_Type(); | 129 friend class Matcher; // allow access to stub names 130 131 private: 132 // define stubs 133 static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char *name, int is_fancy_jump, bool pass_tls, bool save_arguments, bool return_pc); 134 135 // References to generated stubs 136 static address _new_instance_Java; 137 static address _new_array_Java; 138 static address _new_array_nozero_Java; 139 static address _multianewarray2_Java; 140 static address _multianewarray3_Java; 141 static address _multianewarray4_Java; 142 static address _multianewarray5_Java; 143 static address _multianewarrayN_Java; 144 static address _g1_wb_pre_Java; 145 static address _g1_wb_post_Java; 146 static address _vtable_must_compile_Java; 147 static address _complete_monitor_locking_Java; 148 static address _rethrow_Java; 149 static address _monitor_notify_Java; 150 static address _monitor_notifyAll_Java; 151 152 static address _slow_arraycopy_Java; 153 static address _register_finalizer_Java; 154 155 # ifdef ENABLE_ZAP_DEAD_LOCALS 156 static address _zap_dead_Java_locals_Java; 157 static address _zap_dead_native_locals_Java; 158 # endif 159 160 161 // 162 // Implementation of runtime methods 163 // ================================= 164 165 // Allocate storage for a Java instance. 166 static void new_instance_C(Klass* instance_klass, JavaThread *thread); 167 168 // Allocate storage for a objArray or typeArray 169 static void new_array_C(Klass* array_klass, int len, JavaThread *thread); 170 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread *thread); 171 172 // Post-slow-path-allocation, pre-initializing-stores step for 173 // implementing ReduceInitialCardMarks 174 static void new_store_pre_barrier(JavaThread* thread); 175 176 // Allocate storage for a multi-dimensional arrays 177 // Note: needs to be fixed for arbitrary number of dimensions 178 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread *thread); 179 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread *thread); 180 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread *thread); 181 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread *thread); 182 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread *thread); 183 static void g1_wb_pre_C(oopDesc* orig, JavaThread* thread); 184 static void g1_wb_post_C(void* card_addr, JavaThread* thread); 185 186 public: 187 // Slow-path Locking and Unlocking 188 static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); 189 static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread); 190 191 static void monitor_notify_C(oopDesc* obj, JavaThread* thread); 192 static void monitor_notifyAll_C(oopDesc* obj, JavaThread* thread); 193 194 private: 195 196 // Implicit exception support 197 static void throw_null_exception_C(JavaThread* thread); 198 199 // Exception handling 200 static address handle_exception_C (JavaThread* thread); 201 static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm); 202 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc ); 203 static void deoptimize_caller_frame (JavaThread *thread); 204 static void deoptimize_caller_frame (JavaThread *thread, bool doit); 205 static bool is_deoptimized_caller_frame (JavaThread *thread); 206 207 // CodeBlob support 208 // =================================================================== 209 210 static ExceptionBlob* _exception_blob; 211 static void generate_exception_blob(); 212 213 static void register_finalizer(oopDesc* obj, JavaThread* thread); 233 // when runtime stubs have been generated successfully and 234 // false otherwise. 235 static bool generate(ciEnv* env); 236 237 // Returns the name of a stub 238 static const char* stub_name(address entry); 239 240 // access to runtime stubs entry points for java code 241 static address new_instance_Java() { return _new_instance_Java; } 242 static address new_array_Java() { return _new_array_Java; } 243 static address new_array_nozero_Java() { return _new_array_nozero_Java; } 244 static address multianewarray2_Java() { return _multianewarray2_Java; } 245 static address multianewarray3_Java() { return _multianewarray3_Java; } 246 static address multianewarray4_Java() { return _multianewarray4_Java; } 247 static address multianewarray5_Java() { return _multianewarray5_Java; } 248 static address multianewarrayN_Java() { return _multianewarrayN_Java; } 249 static address g1_wb_pre_Java() { return _g1_wb_pre_Java; } 250 static address g1_wb_post_Java() { return _g1_wb_post_Java; } 251 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; } 252 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; } 253 static address monitor_notify_Java() { return _monitor_notify_Java; } 254 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; } 255 256 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; } 257 static address register_finalizer_Java() { return _register_finalizer_Java; } 258 259 260 # ifdef ENABLE_ZAP_DEAD_LOCALS 261 static address zap_dead_locals_stub(bool is_native) { return is_native 262 ? _zap_dead_native_locals_Java 263 : _zap_dead_Java_locals_Java; } 264 static MachNode* node_to_call_zap_dead_locals(Node* n, int block_num, bool is_native); 265 # endif 266 267 static ExceptionBlob* exception_blob() { return _exception_blob; } 268 269 // Leaf routines helping with method data update 270 static void profile_receiver_type_C(DataLayout* data, oopDesc* receiver); 271 272 // Implicit exception support 273 static void throw_div0_exception_C (JavaThread* thread); 274 static void throw_stack_overflow_error_C(JavaThread* thread); 275 276 // Exception handling 277 static address rethrow_stub() { return _rethrow_Java; } 278 279 280 // Type functions 281 // ====================================================== 282 283 static const TypeFunc* new_instance_Type(); // object allocation (slow case) 284 static const TypeFunc* new_array_Type (); // [a]newarray (slow case) 285 static const TypeFunc* multianewarray_Type(int ndim); // multianewarray 286 static const TypeFunc* multianewarray2_Type(); // multianewarray 287 static const TypeFunc* multianewarray3_Type(); // multianewarray 288 static const TypeFunc* multianewarray4_Type(); // multianewarray 289 static const TypeFunc* multianewarray5_Type(); // multianewarray 290 static const TypeFunc* multianewarrayN_Type(); // multianewarray 291 static const TypeFunc* g1_wb_pre_Type(); 292 static const TypeFunc* g1_wb_post_Type(); 293 static const TypeFunc* complete_monitor_enter_Type(); 294 static const TypeFunc* complete_monitor_exit_Type(); 295 static const TypeFunc* monitor_notify_Type(); 296 static const TypeFunc* uncommon_trap_Type(); 297 static const TypeFunc* athrow_Type(); 298 static const TypeFunc* rethrow_Type(); 299 static const TypeFunc* Math_D_D_Type(); // sin,cos & friends 300 static const TypeFunc* Math_DD_D_Type(); // mod,pow & friends 301 static const TypeFunc* modf_Type(); 302 static const TypeFunc* l2f_Type(); 303 static const TypeFunc* void_long_Type(); 304 305 static const TypeFunc* flush_windows_Type(); 306 307 // arraycopy routine types 308 static const TypeFunc* fast_arraycopy_Type(); // bit-blasters 309 static const TypeFunc* checkcast_arraycopy_Type(); 310 static const TypeFunc* generic_arraycopy_Type(); 311 static const TypeFunc* slow_arraycopy_Type(); // the full routine 312 313 static const TypeFunc* array_fill_Type(); 314 315 static const TypeFunc* aescrypt_block_Type(); |