Mercurial > hg > truffle
comparison src/cpu/x86/vm/stubGenerator_x86_32.cpp @ 10324:3f281b313240
8010927: Kitchensink crashed with SIGSEGV, Problematic frame: v ~StubRoutines::checkcast_arraycopy
Summary: Changed gen_write_ref_array_post_barrier() code on x64 to pass start address and number of copied oop elements. In generate_checkcast_copy() skip post barrier code if no elements are copied.
Reviewed-by: roland
author | kvn |
---|---|
date | Wed, 22 May 2013 18:25:43 -0700 |
parents | e961c11b85fe |
children | 836a62f43af9 ef57c43512d6 |
comparison
equal
deleted
inserted
replaced
10323:71a2d06b9c2b | 10324:3f281b313240 |
---|---|
1496 // element stored and make a quick oop equality check on it.) | 1496 // element stored and make a quick oop equality check on it.) |
1497 | 1497 |
1498 __ movptr(elem_klass, elem_klass_addr); // query the object klass | 1498 __ movptr(elem_klass, elem_klass_addr); // query the object klass |
1499 generate_type_check(elem_klass, ckoff_arg, ckval_arg, temp, | 1499 generate_type_check(elem_klass, ckoff_arg, ckval_arg, temp, |
1500 &L_store_element, NULL); | 1500 &L_store_element, NULL); |
1501 // (On fall-through, we have failed the element type check.) | 1501 // (On fall-through, we have failed the element type check.) |
1502 // ======== end loop ======== | 1502 // ======== end loop ======== |
1503 | 1503 |
1504 // It was a real error; we must depend on the caller to finish the job. | 1504 // It was a real error; we must depend on the caller to finish the job. |
1505 // Register "count" = -1 * number of *remaining* oops, length_arg = *total* oops. | 1505 // Register "count" = -1 * number of *remaining* oops, length_arg = *total* oops. |
1506 // Emit GC store barriers for the oops we have copied (length_arg + count), | 1506 // Emit GC store barriers for the oops we have copied (length_arg + count), |
1507 // and report their number to the caller. | 1507 // and report their number to the caller. |
1508 assert_different_registers(to, count, rax); | |
1509 Label L_post_barrier; | |
1508 __ addl(count, length_arg); // transfers = (length - remaining) | 1510 __ addl(count, length_arg); // transfers = (length - remaining) |
1509 __ movl2ptr(rax, count); // save the value | 1511 __ movl2ptr(rax, count); // save the value |
1510 __ notptr(rax); // report (-1^K) to caller | 1512 __ notptr(rax); // report (-1^K) to caller (does not affect flags) |
1511 __ movptr(to, to_arg); // reload | 1513 __ jccb(Assembler::notZero, L_post_barrier); |
1512 assert_different_registers(to, count, rax); | 1514 __ jmp(L_done); // K == 0, nothing was copied, skip post barrier |
1513 gen_write_ref_array_post_barrier(to, count); | |
1514 __ jmpb(L_done); | |
1515 | 1515 |
1516 // Come here on success only. | 1516 // Come here on success only. |
1517 __ BIND(L_do_card_marks); | 1517 __ BIND(L_do_card_marks); |
1518 __ xorptr(rax, rax); // return 0 on success | |
1518 __ movl2ptr(count, length_arg); | 1519 __ movl2ptr(count, length_arg); |
1519 __ movptr(to, to_arg); // reload | 1520 |
1521 __ BIND(L_post_barrier); | |
1522 __ movptr(to, to_arg); // reload | |
1520 gen_write_ref_array_post_barrier(to, count); | 1523 gen_write_ref_array_post_barrier(to, count); |
1521 __ xorptr(rax, rax); // return 0 on success | |
1522 | 1524 |
1523 // Common exit point (success or failure). | 1525 // Common exit point (success or failure). |
1524 __ BIND(L_done); | 1526 __ BIND(L_done); |
1525 __ pop(rbx); | 1527 __ pop(rbx); |
1526 __ pop(rdi); | 1528 __ pop(rdi); |