Mercurial > hg > truffle
comparison src/share/vm/runtime/sharedRuntime.hpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 89152779163c cf9f24de0b93 |
children | be896a1983c0 |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
139 | 139 |
140 #if defined(__SOFTFP__) || defined(E500V2) | 140 #if defined(__SOFTFP__) || defined(E500V2) |
141 static double dabs(double f); | 141 static double dabs(double f); |
142 #endif | 142 #endif |
143 | 143 |
144 #if defined(__SOFTFP__) || defined(PPC) | 144 #if defined(__SOFTFP__) || defined(PPC32) |
145 static double dsqrt(double f); | 145 static double dsqrt(double f); |
146 #endif | 146 #endif |
147 | 147 |
148 #ifdef __SOFTFP__ | 148 #ifdef __SOFTFP__ |
149 // C++ compiler generates soft float instructions as well as passing | 149 // C++ compiler generates soft float instructions as well as passing |
262 static oop retrieve_receiver( Symbol* sig, frame caller ); | 262 static oop retrieve_receiver( Symbol* sig, frame caller ); |
263 | 263 |
264 static void register_finalizer(JavaThread* thread, oopDesc* obj); | 264 static void register_finalizer(JavaThread* thread, oopDesc* obj); |
265 | 265 |
266 // dtrace notifications | 266 // dtrace notifications |
267 static int dtrace_object_alloc(oopDesc* o); | 267 static int dtrace_object_alloc(oopDesc* o, int size); |
268 static int dtrace_object_alloc_base(Thread* thread, oopDesc* o); | 268 static int dtrace_object_alloc_base(Thread* thread, oopDesc* o, int size); |
269 static int dtrace_method_entry(JavaThread* thread, Method* m); | 269 static int dtrace_method_entry(JavaThread* thread, Method* m); |
270 static int dtrace_method_exit(JavaThread* thread, Method* m); | 270 static int dtrace_method_exit(JavaThread* thread, Method* m); |
271 | 271 |
272 // Utility method for retrieving the Java thread id, returns 0 if the | 272 // Utility method for retrieving the Java thread id, returns 0 if the |
273 // thread is not a well formed Java thread. | 273 // thread is not a well formed Java thread. |
363 static void check_member_name_argument_is_last_argument(methodHandle method, | 363 static void check_member_name_argument_is_last_argument(methodHandle method, |
364 const BasicType* sig_bt, | 364 const BasicType* sig_bt, |
365 const VMRegPair* regs) NOT_DEBUG_RETURN; | 365 const VMRegPair* regs) NOT_DEBUG_RETURN; |
366 | 366 |
367 // Ditto except for calling C | 367 // Ditto except for calling C |
368 static int c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, int total_args_passed); | 368 // |
369 // C argument in register AND stack slot. | |
370 // Some architectures require that an argument must be passed in a register | |
371 // AND in a stack slot. These architectures provide a second VMRegPair array | |
372 // to be filled by the c_calling_convention method. On other architectures, | |
373 // NULL is being passed as the second VMRegPair array, so arguments are either | |
374 // passed in a register OR in a stack slot. | |
375 static int c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, VMRegPair *regs2, | |
376 int total_args_passed); | |
377 | |
378 // Compute the new number of arguments in the signature if 32 bit ints | |
379 // must be converted to longs. Needed if CCallingConventionRequiresIntsAsLongs | |
380 // is true. | |
381 static int convert_ints_to_longints_argcnt(int in_args_count, BasicType* in_sig_bt); | |
382 // Adapt a method's signature if it contains 32 bit integers that must | |
383 // be converted to longs. Needed if CCallingConventionRequiresIntsAsLongs | |
384 // is true. | |
385 static void convert_ints_to_longints(int i2l_argcnt, int& in_args_count, | |
386 BasicType*& in_sig_bt, VMRegPair*& in_regs); | |
369 | 387 |
370 // Generate I2C and C2I adapters. These adapters are simple argument marshalling | 388 // Generate I2C and C2I adapters. These adapters are simple argument marshalling |
371 // blobs. Unlike adapters in the tiger and earlier releases the code in these | 389 // blobs. Unlike adapters in the tiger and earlier releases the code in these |
372 // blobs does not create a new frame and are therefore virtually invisible | 390 // blobs does not create a new frame and are therefore virtually invisible |
373 // to the stack walking code. In general these blobs extend the callers stack | 391 // to the stack walking code. In general these blobs extend the callers stack |
377 // by the time we reach the blob there is compiled code available. This allows | 395 // by the time we reach the blob there is compiled code available. This allows |
378 // the blob to pass the incoming stack pointer (the sender sp) in a known | 396 // the blob to pass the incoming stack pointer (the sender sp) in a known |
379 // location for the interpreter to record. This is used by the frame code | 397 // location for the interpreter to record. This is used by the frame code |
380 // to correct the sender code to match up with the stack pointer when the | 398 // to correct the sender code to match up with the stack pointer when the |
381 // thread left the compiled code. In addition it allows the interpreter | 399 // thread left the compiled code. In addition it allows the interpreter |
382 // to remove the space the c2i adapter allocated to do it argument conversion. | 400 // to remove the space the c2i adapter allocated to do its argument conversion. |
383 | 401 |
384 // Although a c2i blob will always run interpreted even if compiled code is | 402 // Although a c2i blob will always run interpreted even if compiled code is |
385 // present if we see that compiled code is present the compiled call site | 403 // present if we see that compiled code is present the compiled call site |
386 // will be patched/re-resolved so that later calls will run compiled. | 404 // will be patched/re-resolved so that later calls will run compiled. |
387 | 405 |
620 | 638 |
621 #ifdef ASSERT | 639 #ifdef ASSERT |
622 // Captures code and signature used to generate this adapter when | 640 // Captures code and signature used to generate this adapter when |
623 // verifing adapter equivalence. | 641 // verifing adapter equivalence. |
624 unsigned char* _saved_code; | 642 unsigned char* _saved_code; |
625 int _code_length; | 643 int _saved_code_length; |
626 BasicType* _saved_sig; | |
627 int _total_args_passed; | |
628 #endif | 644 #endif |
629 | 645 |
630 void init(AdapterFingerPrint* fingerprint, address i2c_entry, address c2i_entry, address c2i_unverified_entry) { | 646 void init(AdapterFingerPrint* fingerprint, address i2c_entry, address c2i_entry, address c2i_unverified_entry) { |
631 _fingerprint = fingerprint; | 647 _fingerprint = fingerprint; |
632 _i2c_entry = i2c_entry; | 648 _i2c_entry = i2c_entry; |
633 _c2i_entry = c2i_entry; | 649 _c2i_entry = c2i_entry; |
634 _c2i_unverified_entry = c2i_unverified_entry; | 650 _c2i_unverified_entry = c2i_unverified_entry; |
635 #ifdef ASSERT | 651 #ifdef ASSERT |
636 _saved_code = NULL; | 652 _saved_code = NULL; |
637 _code_length = 0; | 653 _saved_code_length = 0; |
638 _saved_sig = NULL; | |
639 _total_args_passed = 0; | |
640 #endif | 654 #endif |
641 } | 655 } |
642 | 656 |
643 void deallocate(); | 657 void deallocate(); |
644 | 658 |
647 | 661 |
648 public: | 662 public: |
649 address get_i2c_entry() const { return _i2c_entry; } | 663 address get_i2c_entry() const { return _i2c_entry; } |
650 address get_c2i_entry() const { return _c2i_entry; } | 664 address get_c2i_entry() const { return _c2i_entry; } |
651 address get_c2i_unverified_entry() const { return _c2i_unverified_entry; } | 665 address get_c2i_unverified_entry() const { return _c2i_unverified_entry; } |
652 | |
653 address base_address(); | 666 address base_address(); |
654 void relocate(address new_base); | 667 void relocate(address new_base); |
655 | 668 |
656 AdapterFingerPrint* fingerprint() const { return _fingerprint; } | 669 AdapterFingerPrint* fingerprint() const { return _fingerprint; } |
657 | 670 |
659 return (AdapterHandlerEntry*)BasicHashtableEntry<mtCode>::next(); | 672 return (AdapterHandlerEntry*)BasicHashtableEntry<mtCode>::next(); |
660 } | 673 } |
661 | 674 |
662 #ifdef ASSERT | 675 #ifdef ASSERT |
663 // Used to verify that code generated for shared adapters is equivalent | 676 // Used to verify that code generated for shared adapters is equivalent |
664 void save_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt); | 677 void save_code (unsigned char* code, int length); |
665 bool compare_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt); | 678 bool compare_code(unsigned char* code, int length); |
666 #endif | 679 #endif |
667 | 680 |
668 //virtual void print_on(outputStream* st) const; DO NOT USE | 681 //virtual void print_on(outputStream* st) const; DO NOT USE |
669 void print_adapter_on(outputStream* st) const; | 682 void print_adapter_on(outputStream* st) const; |
670 }; | 683 }; |
679 | 692 |
680 public: | 693 public: |
681 | 694 |
682 static AdapterHandlerEntry* new_entry(AdapterFingerPrint* fingerprint, | 695 static AdapterHandlerEntry* new_entry(AdapterFingerPrint* fingerprint, |
683 address i2c_entry, address c2i_entry, address c2i_unverified_entry); | 696 address i2c_entry, address c2i_entry, address c2i_unverified_entry); |
684 static nmethod* create_native_wrapper(methodHandle method, int compile_id); | 697 static void create_native_wrapper(methodHandle method); |
685 static AdapterHandlerEntry* get_adapter(methodHandle method); | 698 static AdapterHandlerEntry* get_adapter(methodHandle method); |
686 | 699 |
687 #ifdef HAVE_DTRACE_H | 700 #ifdef HAVE_DTRACE_H |
688 static nmethod* create_dtrace_nmethod (methodHandle method); | 701 static nmethod* create_dtrace_nmethod (methodHandle method); |
689 #endif // HAVE_DTRACE_H | 702 #endif // HAVE_DTRACE_H |