193 194 static address _dexp; 195 static address _dlog; 196 static address _dlog10; 197 static address _dpow; 198 static address _dsin; 199 static address _dcos; 200 static address _dlibm_sin_cos_huge; 201 static address _dlibm_reduce_pi04l; 202 static address _dlibm_tan_cot_huge; 203 static address _dtan; 204 205 // Safefetch stubs. 206 static address _safefetch32_entry; 207 static address _safefetch32_fault_pc; 208 static address _safefetch32_continuation_pc; 209 static address _safefetchN_entry; 210 static address _safefetchN_fault_pc; 211 static address _safefetchN_continuation_pc; 212 213 public: 214 // Initialization/Testing 215 static void initialize1(); // must happen before universe::genesis 216 static void initialize2(); // must happen after universe::genesis 217 218 static bool is_stub_code(address addr) { return contains(addr); } 219 220 static bool contains(address addr) { 221 return 222 (_code1 != NULL && _code1->blob_contains(addr)) || 223 (_code2 != NULL && _code2->blob_contains(addr)) ; 224 } 225 226 static RuntimeBlob* code1() { return _code1; } 227 static RuntimeBlob* code2() { return _code2; } 228 229 // Debugging 230 static jint verify_oop_count() { return _verify_oop_count; } 231 static jint* verify_oop_count_addr() { return &_verify_oop_count; } 232 // a subroutine for debugging the GC 396 return NULL; 397 } 398 399 // 400 // Default versions of the above arraycopy functions for platforms which do 401 // not have specialized versions 402 // 403 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count); 404 static void jshort_copy (jshort* src, jshort* dest, size_t count); 405 static void jint_copy (jint* src, jint* dest, size_t count); 406 static void jlong_copy (jlong* src, jlong* dest, size_t count); 407 static void oop_copy (oop* src, oop* dest, size_t count); 408 static void oop_copy_uninit(oop* src, oop* dest, size_t count); 409 410 static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count); 411 static void arrayof_jshort_copy (HeapWord* src, HeapWord* dest, size_t count); 412 static void arrayof_jint_copy (HeapWord* src, HeapWord* dest, size_t count); 413 static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count); 414 static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count); 415 static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count); 416 }; 417 418 // Safefetch allows to load a value from a location that's not known 419 // to be valid. If the load causes a fault, the error value is returned. 420 inline int SafeFetch32(int* adr, int errValue) { 421 assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); 422 return StubRoutines::SafeFetch32_stub()(adr, errValue); 423 } 424 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) { 425 assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated"); 426 return StubRoutines::SafeFetchN_stub()(adr, errValue); 427 } 428 429 430 // returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated) 431 inline bool CanUseSafeFetch32() { 432 return StubRoutines::SafeFetch32_stub() ? true : false; 433 } 434 435 inline bool CanUseSafeFetchN() { | 193 194 static address _dexp; 195 static address _dlog; 196 static address _dlog10; 197 static address _dpow; 198 static address _dsin; 199 static address _dcos; 200 static address _dlibm_sin_cos_huge; 201 static address _dlibm_reduce_pi04l; 202 static address _dlibm_tan_cot_huge; 203 static address _dtan; 204 205 // Safefetch stubs. 206 static address _safefetch32_entry; 207 static address _safefetch32_fault_pc; 208 static address _safefetch32_continuation_pc; 209 static address _safefetchN_entry; 210 static address _safefetchN_fault_pc; 211 static address _safefetchN_continuation_pc; 212 213 static address _load_value_type_fields_in_regs; 214 static address _store_value_type_fields_to_buf; 215 216 public: 217 // Initialization/Testing 218 static void initialize1(); // must happen before universe::genesis 219 static void initialize2(); // must happen after universe::genesis 220 221 static bool is_stub_code(address addr) { return contains(addr); } 222 223 static bool contains(address addr) { 224 return 225 (_code1 != NULL && _code1->blob_contains(addr)) || 226 (_code2 != NULL && _code2->blob_contains(addr)) ; 227 } 228 229 static RuntimeBlob* code1() { return _code1; } 230 static RuntimeBlob* code2() { return _code2; } 231 232 // Debugging 233 static jint verify_oop_count() { return _verify_oop_count; } 234 static jint* verify_oop_count_addr() { return &_verify_oop_count; } 235 // a subroutine for debugging the GC 399 return NULL; 400 } 401 402 // 403 // Default versions of the above arraycopy functions for platforms which do 404 // not have specialized versions 405 // 406 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count); 407 static void jshort_copy (jshort* src, jshort* dest, size_t count); 408 static void jint_copy (jint* src, jint* dest, size_t count); 409 static void jlong_copy (jlong* src, jlong* dest, size_t count); 410 static void oop_copy (oop* src, oop* dest, size_t count); 411 static void oop_copy_uninit(oop* src, oop* dest, size_t count); 412 413 static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count); 414 static void arrayof_jshort_copy (HeapWord* src, HeapWord* dest, size_t count); 415 static void arrayof_jint_copy (HeapWord* src, HeapWord* dest, size_t count); 416 static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count); 417 static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count); 418 static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count); 419 420 static address load_value_type_fields_in_regs() { return _load_value_type_fields_in_regs; } 421 static address store_value_type_fields_to_buf() { return _store_value_type_fields_to_buf; } 422 }; 423 424 // Safefetch allows to load a value from a location that's not known 425 // to be valid. If the load causes a fault, the error value is returned. 426 inline int SafeFetch32(int* adr, int errValue) { 427 assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); 428 return StubRoutines::SafeFetch32_stub()(adr, errValue); 429 } 430 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) { 431 assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated"); 432 return StubRoutines::SafeFetchN_stub()(adr, errValue); 433 } 434 435 436 // returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated) 437 inline bool CanUseSafeFetch32() { 438 return StubRoutines::SafeFetch32_stub() ? true : false; 439 } 440 441 inline bool CanUseSafeFetchN() { |