Print this page
rev 1838 : 6961690: load oops from constant table on SPARC
Summary: oops should be loaded from the constant table of an nmethod instead of materializing them with a long code sequence.
Reviewed-by:

Split Close
Expand all
Collapse all
          --- old/src/share/vm/asm/assembler.inline.hpp
          +++ new/src/share/vm/asm/assembler.inline.hpp
   1    1  /*
   2      - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
        2 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3    3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4    4   *
   5    5   * This code is free software; you can redistribute it and/or modify it
   6    6   * under the terms of the GNU General Public License version 2 only, as
   7    7   * published by the Free Software Foundation.
   8    8   *
   9    9   * This code is distributed in the hope that it will be useful, but WITHOUT
  10   10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11   11   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12   12   * version 2 for more details (a copy is included in the LICENSE file that
↓ open down ↓ 85 lines elided ↑ open up ↑
  98   98    return CodeBuffer::locator_pos(loc());
  99   99  }
 100  100  
 101  101  inline int Label::loc_sect() const {
 102  102    return CodeBuffer::locator_sect(loc());
 103  103  }
 104  104  
 105  105  inline void Label::bind_loc(int pos, int sect) {
 106  106    bind_loc(CodeBuffer::locator(pos, sect));
 107  107  }
 108      -
 109      -address AbstractAssembler::address_constant(Label& L) {
 110      -  address c = NULL;
 111      -  address ptr = start_a_const(sizeof(c), sizeof(c));
 112      -  if (ptr != NULL) {
 113      -    relocate(Relocation::spec_simple(relocInfo::internal_word_type));
 114      -    *(address*)ptr = c = code_section()->target(L, ptr);
 115      -    _code_pos = ptr + sizeof(c);
 116      -    end_a_const();
 117      -  }
 118      -  return ptr;
 119      -}
 120      -
 121      -address AbstractAssembler::address_table_constant(GrowableArray<Label*> labels) {
 122      -  int addressSize = sizeof(address);
 123      -  int sizeLabel = addressSize * labels.length();
 124      -  address ptr = start_a_const(sizeLabel, addressSize);
 125      -
 126      -  if (ptr != NULL) {
 127      -    address *labelLoc = (address*)ptr;
 128      -    for (int i=0; i < labels.length(); i++) {
 129      -      emit_address(code_section()->target(*labels.at(i), (address)&labelLoc[i]));
 130      -      code_section()->relocate((address)&labelLoc[i], relocInfo::internal_word_type);
 131      -    }
 132      -    end_a_const();
 133      -  }
 134      -  return ptr;
 135      -}
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX