Print this page
rev 1024 : imported patch indy-cleanup-6893081.patch

Split Close
Expand all
Collapse all
          --- old/src/share/vm/code/nmethod.cpp
          +++ new/src/share/vm/code/nmethod.cpp
↓ open down ↓ 1746 lines elided ↑ open up ↑
1747 1747           "must start with a sentinel");
1748 1748    for (int i = 1; i < count; i++) {
1749 1749      int this_offset = pcs[i].pc_offset();
1750 1750      assert(this_offset > prev_offset, "offsets must be sorted");
1751 1751      prev_offset = this_offset;
1752 1752    }
1753 1753    assert(prev_offset == PcDesc::upper_offset_limit,
1754 1754           "must end with a sentinel");
1755 1755  #endif //ASSERT
1756 1756  
     1757 +  // Search for MethodHandle invokes and tag the nmethod.
     1758 +  for (int i = 0; i < count; i++) {
     1759 +    if (pcs[i].is_method_handle_invoke()) {
     1760 +      set_has_method_handle_invokes(true);
     1761 +      break;
     1762 +    }
     1763 +  }
     1764 +
1757 1765    int size = count * sizeof(PcDesc);
1758 1766    assert(scopes_pcs_size() >= size, "oob");
1759 1767    memcpy(scopes_pcs_begin(), pcs, size);
1760 1768  
1761 1769    // Adjust the final sentinel downward.
1762 1770    PcDesc* last_pc = &scopes_pcs_begin()[count-1];
1763 1771    assert(last_pc->pc_offset() == PcDesc::upper_offset_limit, "sanity");
1764 1772    last_pc->set_pc_offset(instructions_size() + 1);
1765 1773    for (; last_pc + 1 < scopes_pcs_end(); last_pc += 1) {
1766 1774      // Fill any rounding gaps with copies of the last record.
↓ open down ↓ 247 lines elided ↑ open up ↑
2014 2022    guarantee(nm->_lock_count >= 0, "unmatched nmethod lock/unlock");
2015 2023  }
2016 2024  
2017 2025  bool nmethod::is_deopt_pc(address pc) {
2018 2026    bool ret =  pc == deopt_handler_begin();
2019 2027    return ret;
2020 2028  }
2021 2029  
2022 2030  
2023 2031  // -----------------------------------------------------------------------------
     2032 +// MethodHandle
     2033 +
     2034 +bool nmethod::is_method_handle_return(address return_pc) {
     2035 +  if (!has_method_handle_invokes())  return false;
     2036 +  PcDesc* pd = pc_desc_at(return_pc);
     2037 +  if (pd == NULL)
     2038 +    return false;
     2039 +  return pd->is_method_handle_invoke();
     2040 +}
     2041 +
     2042 +
     2043 +// -----------------------------------------------------------------------------
2024 2044  // Verification
2025 2045  
2026 2046  class VerifyOopsClosure: public OopClosure {
2027 2047    nmethod* _nm;
2028 2048    bool     _ok;
2029 2049  public:
2030 2050    VerifyOopsClosure(nmethod* nm) : _nm(nm), _ok(true) { }
2031 2051    bool ok() { return _ok; }
2032 2052    virtual void do_oop(oop* p) {
2033 2053      if ((*p) == NULL || (*p)->is_oop())  return;
↓ open down ↓ 486 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX