16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "asm/macroAssembler.inline.hpp"
27 #include "asm/assembler.hpp"
28 #include "c1/c1_CodeStubs.hpp"
29 #include "c1/c1_Compilation.hpp"
30 #include "c1/c1_LIRAssembler.hpp"
31 #include "c1/c1_MacroAssembler.hpp"
32 #include "c1/c1_Runtime1.hpp"
33 #include "c1/c1_ValueStack.hpp"
34 #include "ci/ciArrayKlass.hpp"
35 #include "ci/ciInstance.hpp"
36 #include "code/compiledIC.hpp"
37 #include "gc/shared/collectedHeap.hpp"
38 #include "gc/shared/gc_globals.hpp"
39 #include "nativeInst_aarch64.hpp"
40 #include "oops/objArrayKlass.hpp"
41 #include "runtime/frame.inline.hpp"
42 #include "runtime/sharedRuntime.hpp"
43 #include "runtime/stubRoutines.hpp"
44 #include "utilities/powerOfTwo.hpp"
45 #include "vmreg_aarch64.inline.hpp"
46
47
48 #ifndef PRODUCT
49 #define COMMENT(x) do { __ block_comment(x); } while (0)
50 #else
51 #define COMMENT(x)
52 #endif
53
54 NEEDS_CLEANUP // remove this definitions ?
55 const Register SYNC_header = r0; // synchronization header
56 const Register SHIFT_count = r0; // where count for shift operations must be
57
58 #define __ _masm->
59
60
61 static void select_different_registers(Register preserve,
62 Register extra,
63 Register &tmp1,
515 void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) {
516 assert(src->is_constant(), "should not call otherwise");
517 assert(dest->is_register(), "should not call otherwise");
518 LIR_Const* c = src->as_constant_ptr();
519
520 switch (c->type()) {
521 case T_INT: {
522 assert(patch_code == lir_patch_none, "no patching handled here");
523 __ movw(dest->as_register(), c->as_jint());
524 break;
525 }
526
527 case T_ADDRESS: {
528 assert(patch_code == lir_patch_none, "no patching handled here");
529 __ mov(dest->as_register(), c->as_jint());
530 break;
531 }
532
533 case T_LONG: {
534 assert(patch_code == lir_patch_none, "no patching handled here");
535 __ mov(dest->as_register_lo(), (intptr_t)c->as_jlong());
536 break;
537 }
538
539 case T_OBJECT: {
540 if (patch_code == lir_patch_none) {
541 jobject2reg(c->as_jobject(), dest->as_register());
542 } else {
543 jobject2reg_with_patching(dest->as_register(), info);
544 }
545 break;
546 }
547
548 case T_METADATA: {
549 if (patch_code != lir_patch_none) {
550 klass2reg_with_patching(dest->as_register(), info);
551 } else {
552 __ mov_metadata(dest->as_register(), c->as_metadata());
553 }
554 break;
|
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "asm/macroAssembler.inline.hpp"
27 #include "asm/assembler.hpp"
28 #include "c1/c1_CodeStubs.hpp"
29 #include "c1/c1_Compilation.hpp"
30 #include "c1/c1_LIRAssembler.hpp"
31 #include "c1/c1_MacroAssembler.hpp"
32 #include "c1/c1_Runtime1.hpp"
33 #include "c1/c1_ValueStack.hpp"
34 #include "ci/ciArrayKlass.hpp"
35 #include "ci/ciInstance.hpp"
36 #include "ci/ciUtilities.hpp"
37 #include "code/aotCodeCache.hpp"
38 #include "code/compiledIC.hpp"
39 #include "gc/shared/collectedHeap.hpp"
40 #include "gc/shared/gc_globals.hpp"
41 #include "nativeInst_aarch64.hpp"
42 #include "oops/objArrayKlass.hpp"
43 #include "runtime/frame.inline.hpp"
44 #include "runtime/sharedRuntime.hpp"
45 #include "runtime/stubRoutines.hpp"
46 #include "runtime/threadIdentifier.hpp"
47 #include "utilities/powerOfTwo.hpp"
48 #include "vmreg_aarch64.inline.hpp"
49
50
51 #ifndef PRODUCT
52 #define COMMENT(x) do { __ block_comment(x); } while (0)
53 #else
54 #define COMMENT(x)
55 #endif
56
57 NEEDS_CLEANUP // remove this definitions ?
58 const Register SYNC_header = r0; // synchronization header
59 const Register SHIFT_count = r0; // where count for shift operations must be
60
61 #define __ _masm->
62
63
64 static void select_different_registers(Register preserve,
65 Register extra,
66 Register &tmp1,
518 void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) {
519 assert(src->is_constant(), "should not call otherwise");
520 assert(dest->is_register(), "should not call otherwise");
521 LIR_Const* c = src->as_constant_ptr();
522
523 switch (c->type()) {
524 case T_INT: {
525 assert(patch_code == lir_patch_none, "no patching handled here");
526 __ movw(dest->as_register(), c->as_jint());
527 break;
528 }
529
530 case T_ADDRESS: {
531 assert(patch_code == lir_patch_none, "no patching handled here");
532 __ mov(dest->as_register(), c->as_jint());
533 break;
534 }
535
536 case T_LONG: {
537 assert(patch_code == lir_patch_none, "no patching handled here");
538 #if INCLUDE_CDS
539 if (AOTCodeCache::is_on_for_dump()) {
540 address b = c->as_pointer();
541 if (b == (address)ThreadIdentifier::unsafe_offset()) {
542 __ lea(dest->as_register_lo(), ExternalAddress(b));
543 break;
544 }
545 if (AOTRuntimeConstants::contains(b)) {
546 __ load_aotrc_address(dest->as_register_lo(), b);
547 break;
548 }
549 }
550 #endif
551 __ mov(dest->as_register_lo(), (intptr_t)c->as_jlong());
552 break;
553 }
554
555 case T_OBJECT: {
556 if (patch_code == lir_patch_none) {
557 jobject2reg(c->as_jobject(), dest->as_register());
558 } else {
559 jobject2reg_with_patching(dest->as_register(), info);
560 }
561 break;
562 }
563
564 case T_METADATA: {
565 if (patch_code != lir_patch_none) {
566 klass2reg_with_patching(dest->as_register(), info);
567 } else {
568 __ mov_metadata(dest->as_register(), c->as_metadata());
569 }
570 break;
|