Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 22298:c28cb37b2e1d
Rename JVMCI to INCLUDE_JVMCI.
author | twisti |
---|---|
date | Wed, 22 Jul 2015 08:56:03 -0700 |
parents | 525c4df9428b |
children | c2c971a9776f |
comparison
equal
deleted
inserted
replaced
22297:571202729bbf | 22298:c28cb37b2e1d |
---|---|
38 #include "c1/c1_Runtime1.hpp" | 38 #include "c1/c1_Runtime1.hpp" |
39 #endif | 39 #endif |
40 #ifdef COMPILER2 | 40 #ifdef COMPILER2 |
41 #include "opto/runtime.hpp" | 41 #include "opto/runtime.hpp" |
42 #endif | 42 #endif |
43 #ifdef JVMCI | 43 #if INCLUDE_JVMCI |
44 #include "jvmci/jvmciJavaAccess.hpp" | 44 #include "jvmci/jvmciJavaAccess.hpp" |
45 #endif | 45 #endif |
46 | 46 |
47 #define __ masm-> | 47 #define __ masm-> |
48 | 48 |
139 }; | 139 }; |
140 | 140 |
141 OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors) { | 141 OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors) { |
142 int vect_words = 0; | 142 int vect_words = 0; |
143 int ymmhi_offset = -1; | 143 int ymmhi_offset = -1; |
144 #if defined(COMPILER2) || defined(JVMCI) | 144 #if defined(COMPILER2) || INCLUDE_JVMCI |
145 if (save_vectors) { | 145 if (save_vectors) { |
146 assert(UseAVX > 0, "256bit vectors are supported only with AVX"); | 146 assert(UseAVX > 0, "256bit vectors are supported only with AVX"); |
147 assert(MaxVectorSize == 32, "only 256bit vectors are supported now"); | 147 assert(MaxVectorSize == 32, "only 256bit vectors are supported now"); |
148 // Save upper half of YMM registes | 148 // Save upper half of YMM registes |
149 vect_words = 16 * 16 / wordSize; | 149 vect_words = 16 * 16 / wordSize; |
242 map->set_callee_saved(STACK_OFFSET(xmm13_off), xmm13->as_VMReg()); | 242 map->set_callee_saved(STACK_OFFSET(xmm13_off), xmm13->as_VMReg()); |
243 map->set_callee_saved(STACK_OFFSET(xmm14_off), xmm14->as_VMReg()); | 243 map->set_callee_saved(STACK_OFFSET(xmm14_off), xmm14->as_VMReg()); |
244 map->set_callee_saved(STACK_OFFSET(xmm15_off), xmm15->as_VMReg()); | 244 map->set_callee_saved(STACK_OFFSET(xmm15_off), xmm15->as_VMReg()); |
245 | 245 |
246 | 246 |
247 #if defined(COMPILER2) || defined(JVMCI) | 247 #if defined(COMPILER2) || INCLUDE_JVMCI |
248 if (save_vectors) { | 248 if (save_vectors) { |
249 assert(ymmhi_offset != -1, "save area must exist"); | 249 assert(ymmhi_offset != -1, "save area must exist"); |
250 map->set_callee_saved(YMMHI_STACK_OFFSET( 0), xmm0->as_VMReg()->next()->next()->next()->next()); | 250 map->set_callee_saved(YMMHI_STACK_OFFSET( 0), xmm0->as_VMReg()->next()->next()->next()->next()); |
251 map->set_callee_saved(YMMHI_STACK_OFFSET( 16), xmm1->as_VMReg()->next()->next()->next()->next()); | 251 map->set_callee_saved(YMMHI_STACK_OFFSET( 16), xmm1->as_VMReg()->next()->next()->next()->next()); |
252 map->set_callee_saved(YMMHI_STACK_OFFSET( 32), xmm2->as_VMReg()->next()->next()->next()->next()); | 252 map->set_callee_saved(YMMHI_STACK_OFFSET( 32), xmm2->as_VMReg()->next()->next()->next()->next()); |
307 void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) { | 307 void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) { |
308 if (frame::arg_reg_save_area_bytes != 0) { | 308 if (frame::arg_reg_save_area_bytes != 0) { |
309 // Pop arg register save area | 309 // Pop arg register save area |
310 __ addptr(rsp, frame::arg_reg_save_area_bytes); | 310 __ addptr(rsp, frame::arg_reg_save_area_bytes); |
311 } | 311 } |
312 #if defined(COMPILER2) || defined(JVMCI) | 312 #if defined(COMPILER2) || INCLUDE_JVMCI |
313 if (restore_vectors) { | 313 if (restore_vectors) { |
314 // Restore upper half of YMM registes. | 314 // Restore upper half of YMM registes. |
315 assert(UseAVX > 0, "256bit vectors are supported only with AVX"); | 315 assert(UseAVX > 0, "256bit vectors are supported only with AVX"); |
316 assert(MaxVectorSize == 32, "only 256bit vectors are supported now"); | 316 assert(MaxVectorSize == 32, "only 256bit vectors are supported now"); |
317 __ vinsertf128h(xmm0, Address(rsp, 0)); | 317 __ vinsertf128h(xmm0, Address(rsp, 0)); |
729 __ stop(msg); | 729 __ stop(msg); |
730 __ bind(L_ok); | 730 __ bind(L_ok); |
731 __ block_comment("} verify_i2ce "); | 731 __ block_comment("} verify_i2ce "); |
732 } | 732 } |
733 | 733 |
734 #ifdef JVMCI | 734 #if INCLUDE_JVMCI |
735 if (frame_extension_argument != -1) { | 735 if (frame_extension_argument != -1) { |
736 // The frame_extension_argument is an int that describes the | 736 // The frame_extension_argument is an int that describes the |
737 // expected amount of argument space in the caller frame. If that | 737 // expected amount of argument space in the caller frame. If that |
738 // is greater than total_args_passed then enlarge the caller frame | 738 // is greater than total_args_passed then enlarge the caller frame |
739 // by that amount to ensure deopt works correctly. | 739 // by that amount to ensure deopt works correctly. |
800 | 800 |
801 // Will jump to the compiled code just as if compiled code was doing it. | 801 // Will jump to the compiled code just as if compiled code was doing it. |
802 // Pre-load the register-jump target early, to schedule it better. | 802 // Pre-load the register-jump target early, to schedule it better. |
803 __ movptr(r11, Address(rbx, in_bytes(Method::from_compiled_offset()))); | 803 __ movptr(r11, Address(rbx, in_bytes(Method::from_compiled_offset()))); |
804 | 804 |
805 #ifdef JVMCI | 805 #if INCLUDE_JVMCI |
806 // check if this call should be routed towards a specific entry point | 806 // check if this call should be routed towards a specific entry point |
807 __ cmpptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0); | 807 __ cmpptr(Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset())), 0); |
808 Label no_alternative_target; | 808 Label no_alternative_target; |
809 __ jcc(Assembler::equal, no_alternative_target); | 809 __ jcc(Assembler::equal, no_alternative_target); |
810 __ movptr(r11, Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); | 810 __ movptr(r11, Address(r15_thread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); |
3428 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); | 3428 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); |
3429 | 3429 |
3430 __ movl(r14, Deoptimization::Unpack_reexecute); // callee-saved | 3430 __ movl(r14, Deoptimization::Unpack_reexecute); // callee-saved |
3431 __ jmp(cont); | 3431 __ jmp(cont); |
3432 | 3432 |
3433 #ifdef JVMCI | 3433 #if INCLUDE_JVMCI |
3434 int implicit_exception_uncommon_trap_offset = __ pc() - start; | 3434 int implicit_exception_uncommon_trap_offset = __ pc() - start; |
3435 | 3435 |
3436 __ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); | 3436 __ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); |
3437 | 3437 |
3438 int uncommon_trap_offset = __ pc() - start; | 3438 int uncommon_trap_offset = __ pc() - start; |
3452 | 3452 |
3453 __ reset_last_Java_frame(false, false); | 3453 __ reset_last_Java_frame(false, false); |
3454 | 3454 |
3455 Label after_fetch_unroll_info_call; | 3455 Label after_fetch_unroll_info_call; |
3456 __ jmp(after_fetch_unroll_info_call); | 3456 __ jmp(after_fetch_unroll_info_call); |
3457 #endif // JVMCI | 3457 #endif // INCLUDE_JVMCI |
3458 | 3458 |
3459 int exception_offset = __ pc() - start; | 3459 int exception_offset = __ pc() - start; |
3460 | 3460 |
3461 // Prolog for exception case | 3461 // Prolog for exception case |
3462 | 3462 |
3539 // find any register it might need. | 3539 // find any register it might need. |
3540 oop_maps->add_gc_map(__ pc() - start, map); | 3540 oop_maps->add_gc_map(__ pc() - start, map); |
3541 | 3541 |
3542 __ reset_last_Java_frame(false, false); | 3542 __ reset_last_Java_frame(false, false); |
3543 | 3543 |
3544 #ifdef JVMCI | 3544 #if INCLUDE_JVMCI |
3545 __ bind(after_fetch_unroll_info_call); | 3545 __ bind(after_fetch_unroll_info_call); |
3546 #endif | 3546 #endif |
3547 | 3547 |
3548 // Load UnrollBlock* into rdi | 3548 // Load UnrollBlock* into rdi |
3549 __ mov(rdi, rax); | 3549 __ mov(rdi, rax); |
3717 // Make sure all code is generated | 3717 // Make sure all code is generated |
3718 masm->flush(); | 3718 masm->flush(); |
3719 | 3719 |
3720 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); | 3720 _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); |
3721 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); | 3721 _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); |
3722 #ifdef JVMCI | 3722 #if INCLUDE_JVMCI |
3723 _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); | 3723 _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); |
3724 _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset); | 3724 _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset); |
3725 #endif | 3725 #endif |
3726 } | 3726 } |
3727 | 3727 |