Mercurial > hg > truffle
comparison src/cpu/x86/vm/c1_Runtime1_x86.cpp @ 4656:c1160de36474
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 20 Feb 2012 18:01:22 +0100 |
parents | 723df37192d6 |
children | e29339f342de |
comparison
equal
deleted
inserted
replaced
4655:0c392b1bd7cc | 4656:c1160de36474 |
---|---|
591 // target: the entry point of the method that creates and posts the exception oop | 591 // target: the entry point of the method that creates and posts the exception oop |
592 // has_argument: true if the exception needs an argument (passed on stack because registers must be preserved) | 592 // has_argument: true if the exception needs an argument (passed on stack because registers must be preserved) |
593 | 593 |
594 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { | 594 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { |
595 OopMapSet* oop_maps = new OopMapSet(); | 595 OopMapSet* oop_maps = new OopMapSet(); |
596 if (UseGraal) { | 596 #ifdef GRAAL |
597 // graal passes the argument in r10 | 597 // graal passes the argument in r10 |
598 OopMap* oop_map = save_live_registers(sasm, 1); | 598 OopMap* oop_map = save_live_registers(sasm, 1); |
599 | 599 |
600 // now all registers are saved and can be used freely | 600 // now all registers are saved and can be used freely |
601 // verify that no old value is used accidentally | 601 // verify that no old value is used accidentally |
609 __ movptr(c_rarg1, r10); | 609 __ movptr(c_rarg1, r10); |
610 } | 610 } |
611 int call_offset = __ call_RT(noreg, noreg, target, has_argument ? 1 : 0); | 611 int call_offset = __ call_RT(noreg, noreg, target, has_argument ? 1 : 0); |
612 | 612 |
613 oop_maps->add_gc_map(call_offset, oop_map); | 613 oop_maps->add_gc_map(call_offset, oop_map); |
614 } else { | 614 #else |
615 // preserve all registers | 615 // preserve all registers |
616 int num_rt_args = has_argument ? 2 : 1; | 616 int num_rt_args = has_argument ? 2 : 1; |
617 OopMap* oop_map = save_live_registers(sasm, num_rt_args); | 617 OopMap* oop_map = save_live_registers(sasm, num_rt_args); |
618 | 618 |
619 // now all registers are saved and can be used freely | 619 // now all registers are saved and can be used freely |
633 #endif // _LP64 | 633 #endif // _LP64 |
634 } | 634 } |
635 int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1); | 635 int call_offset = __ call_RT(noreg, noreg, target, num_rt_args - 1); |
636 | 636 |
637 oop_maps->add_gc_map(call_offset, oop_map); | 637 oop_maps->add_gc_map(call_offset, oop_map); |
638 } | 638 #endif |
639 | 639 |
640 __ stop("should not reach here"); | 640 __ stop("should not reach here"); |
641 | 641 |
642 return oop_maps; | 642 return oop_maps; |
643 } | 643 } |
1370 | 1370 |
1371 // This is called via call_runtime so the arguments | 1371 // This is called via call_runtime so the arguments |
1372 // will be place in C abi locations | 1372 // will be place in C abi locations |
1373 | 1373 |
1374 #ifdef _LP64 | 1374 #ifdef _LP64 |
1375 __ verify_oop((UseGraal) ? j_rarg0 : c_rarg0); | 1375 #ifdef GRAAL |
1376 __ mov(rax, (UseGraal) ? j_rarg0 : c_rarg0); | 1376 __ verify_oop(j_rarg0); |
1377 __ mov(rax, j_rarg0); | |
1378 #else | |
1379 __ verify_oop(c_rarg0); | |
1380 __ mov(rax, c_rarg0); | |
1381 #endif | |
1377 #else | 1382 #else |
1378 // The object is passed on the stack and we haven't pushed a | 1383 // The object is passed on the stack and we haven't pushed a |
1379 // frame yet so it's one work away from top of stack. | 1384 // frame yet so it's one work away from top of stack. |
1380 __ movptr(rax, Address(rsp, 1 * BytesPerWord)); | 1385 __ movptr(rax, Address(rsp, 1 * BytesPerWord)); |
1381 __ verify_oop(rax); | 1386 __ verify_oop(rax); |
1504 __ movptr(rsi, Address(rsp, (klass_off) * VMRegImpl::stack_slot_size)); // subclass | 1509 __ movptr(rsi, Address(rsp, (klass_off) * VMRegImpl::stack_slot_size)); // subclass |
1505 __ movptr(rax, Address(rsp, (sup_k_off) * VMRegImpl::stack_slot_size)); // superclass | 1510 __ movptr(rax, Address(rsp, (sup_k_off) * VMRegImpl::stack_slot_size)); // superclass |
1506 | 1511 |
1507 Label success; | 1512 Label success; |
1508 Label miss; | 1513 Label miss; |
1509 if (UseGraal) { | 1514 #ifdef GRAAL |
1510 // TODO this should really be within the XirSnippets | 1515 // TODO this should really be within the XirSnippets |
1511 __ check_klass_subtype_fast_path(rsi, rax, rcx, &success, &miss, NULL); | 1516 __ check_klass_subtype_fast_path(rsi, rax, rcx, &success, &miss, NULL); |
1512 }; | 1517 #endif |
1513 | 1518 |
1514 __ check_klass_subtype_slow_path(rsi, rax, rcx, rdi, NULL, &miss); | 1519 __ check_klass_subtype_slow_path(rsi, rax, rcx, rdi, NULL, &miss); |
1515 | 1520 |
1516 // fallthrough on success: | 1521 // fallthrough on success: |
1517 __ bind(success); | 1522 __ bind(success); |