Mercurial > hg > truffle
comparison src/share/vm/c1/c1_LinearScan.cpp @ 4137:04b9a2566eec
Merge with hsx23/hotspot.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 17 Dec 2011 21:40:27 +0100 |
parents | eba73e0c7780 |
children | c7401dcad8bf |
comparison
equal
deleted
inserted
replaced
3737:9dc19b7d89a3 | 4137:04b9a2566eec |
---|---|
2402 | 2402 |
2403 // caller-save registers must not be included into oop-maps at calls | 2403 // caller-save registers must not be included into oop-maps at calls |
2404 assert(!is_call_site || assigned_reg >= nof_regs || !is_caller_save(assigned_reg), "interval is in a caller-save register at a call -> register will be overwritten"); | 2404 assert(!is_call_site || assigned_reg >= nof_regs || !is_caller_save(assigned_reg), "interval is in a caller-save register at a call -> register will be overwritten"); |
2405 | 2405 |
2406 VMReg name = vm_reg_for_interval(interval); | 2406 VMReg name = vm_reg_for_interval(interval); |
2407 map->set_oop(name); | 2407 set_oop(map, name); |
2408 | 2408 |
2409 // Spill optimization: when the stack value is guaranteed to be always correct, | 2409 // Spill optimization: when the stack value is guaranteed to be always correct, |
2410 // then it must be added to the oop map even if the interval is currently in a register | 2410 // then it must be added to the oop map even if the interval is currently in a register |
2411 if (interval->always_in_memory() && | 2411 if (interval->always_in_memory() && |
2412 op->id() > interval->spill_definition_pos() && | 2412 op->id() > interval->spill_definition_pos() && |
2413 interval->assigned_reg() != interval->canonical_spill_slot()) { | 2413 interval->assigned_reg() != interval->canonical_spill_slot()) { |
2414 assert(interval->spill_definition_pos() > 0, "position not set correctly"); | 2414 assert(interval->spill_definition_pos() > 0, "position not set correctly"); |
2415 assert(interval->canonical_spill_slot() >= LinearScan::nof_regs, "no spill slot assigned"); | 2415 assert(interval->canonical_spill_slot() >= LinearScan::nof_regs, "no spill slot assigned"); |
2416 assert(interval->assigned_reg() < LinearScan::nof_regs, "interval is on stack, so stack slot is registered twice"); | 2416 assert(interval->assigned_reg() < LinearScan::nof_regs, "interval is on stack, so stack slot is registered twice"); |
2417 | 2417 |
2418 map->set_oop(frame_map()->slot_regname(interval->canonical_spill_slot() - LinearScan::nof_regs)); | 2418 set_oop(map, frame_map()->slot_regname(interval->canonical_spill_slot() - LinearScan::nof_regs)); |
2419 } | 2419 } |
2420 } | 2420 } |
2421 } | 2421 } |
2422 | 2422 |
2423 // add oops from lock stack | 2423 // add oops from lock stack |
2424 assert(info->stack() != NULL, "CodeEmitInfo must always have a stack"); | 2424 assert(info->stack() != NULL, "CodeEmitInfo must always have a stack"); |
2425 int locks_count = info->stack()->total_locks_size(); | 2425 int locks_count = info->stack()->total_locks_size(); |
2426 for (int i = 0; i < locks_count; i++) { | 2426 for (int i = 0; i < locks_count; i++) { |
2427 map->set_oop(frame_map()->monitor_object_regname(i)); | 2427 set_oop(map, frame_map()->monitor_object_regname(i)); |
2428 } | 2428 } |
2429 | 2429 |
2430 return map; | 2430 return map; |
2431 } | 2431 } |
2432 | 2432 |
2617 opr = _fpu_stack_allocator->to_fpu_stack(opr); | 2617 opr = _fpu_stack_allocator->to_fpu_stack(opr); |
2618 #endif | 2618 #endif |
2619 | 2619 |
2620 Location::Type loc_type = float_saved_as_double ? Location::float_in_dbl : Location::normal; | 2620 Location::Type loc_type = float_saved_as_double ? Location::float_in_dbl : Location::normal; |
2621 VMReg rname = frame_map()->fpu_regname(opr->fpu_regnr()); | 2621 VMReg rname = frame_map()->fpu_regname(opr->fpu_regnr()); |
2622 #ifndef __SOFTFP__ | |
2623 #ifndef VM_LITTLE_ENDIAN | |
2624 if (! float_saved_as_double) { | |
2625 // On big endian system, we may have an issue if float registers use only | |
2626 // the low half of the (same) double registers. | |
2627 // Both the float and the double could have the same regnr but would correspond | |
2628 // to two different addresses once saved. | |
2629 | |
2630 // get next safely (no assertion checks) | |
2631 VMReg next = VMRegImpl::as_VMReg(1+rname->value()); | |
2632 if (next->is_reg() && | |
2633 (next->as_FloatRegister() == rname->as_FloatRegister())) { | |
2634 // the back-end does use the same numbering for the double and the float | |
2635 rname = next; // VMReg for the low bits, e.g. the real VMReg for the float | |
2636 } | |
2637 } | |
2638 #endif | |
2639 #endif | |
2622 LocationValue* sv = new LocationValue(Location::new_reg_loc(loc_type, rname)); | 2640 LocationValue* sv = new LocationValue(Location::new_reg_loc(loc_type, rname)); |
2623 | 2641 |
2624 scope_values->append(sv); | 2642 scope_values->append(sv); |
2625 return 1; | 2643 return 1; |
2626 | 2644 |