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.hpp
          +++ new/src/share/vm/asm/assembler.hpp
   1    1  /*
   2      - * Copyright (c) 1997, 2009, 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 ↓ 250 lines elided ↑ open up ↑
 263  263    // Move to a different section in the same code buffer.
 264  264    void set_code_section(CodeSection* cs);
 265  265  
 266  266    // Inform assembler when generating stub code and relocation info
 267  267    address    start_a_stub(int required_space);
 268  268    void       end_a_stub();
 269  269    // Ditto for constants.
 270  270    address    start_a_const(int required_space, int required_align = sizeof(double));
 271  271    void       end_a_const();
 272  272  
 273      -  // fp constants support
      273 +  // constants support
      274 +  address long_constant(jlong c) {
      275 +    address ptr = start_a_const(sizeof(c), sizeof(c));
      276 +    if (ptr != NULL) {
      277 +      *(jlong*)ptr = c;
      278 +      _code_pos = ptr + sizeof(c);
      279 +      end_a_const();
      280 +    }
      281 +    return ptr;
      282 +  }
 274  283    address double_constant(jdouble c) {
 275  284      address ptr = start_a_const(sizeof(c), sizeof(c));
 276  285      if (ptr != NULL) {
 277  286        *(jdouble*)ptr = c;
 278  287        _code_pos = ptr + sizeof(c);
 279  288        end_a_const();
 280  289      }
 281  290      return ptr;
 282  291    }
 283  292    address float_constant(jfloat c) {
 284  293      address ptr = start_a_const(sizeof(c), sizeof(c));
 285  294      if (ptr != NULL) {
 286  295        *(jfloat*)ptr = c;
 287  296        _code_pos = ptr + sizeof(c);
 288  297        end_a_const();
 289  298      }
 290  299      return ptr;
 291  300    }
      301 +  address address_constant(address c) {
      302 +    address ptr = start_a_const(sizeof(c), sizeof(c));
      303 +    if (ptr != NULL) {
      304 +      *(address*)ptr = c;
      305 +      _code_pos = ptr + sizeof(c);
      306 +      end_a_const();
      307 +    }
      308 +    return ptr;
      309 +  }
 292  310    address address_constant(address c, RelocationHolder const& rspec) {
 293  311      address ptr = start_a_const(sizeof(c), sizeof(c));
 294  312      if (ptr != NULL) {
 295  313        relocate(rspec);
 296  314        *(address*)ptr = c;
 297  315        _code_pos = ptr + sizeof(c);
 298  316        end_a_const();
 299  317      }
 300  318      return ptr;
 301  319    }
 302      -  inline address address_constant(Label& L);
 303      -  inline address address_table_constant(GrowableArray<Label*> label);
 304  320  
 305  321    // Bootstrapping aid to cope with delayed determination of constants.
 306  322    // Returns a static address which will eventually contain the constant.
 307  323    // The value zero (NULL) stands instead of a constant which is still uncomputed.
 308  324    // Thus, the eventual value of the constant must not be zero.
 309  325    // This is fine, since this is designed for embedding object field
 310  326    // offsets in code which must be generated before the object class is loaded.
 311  327    // Field offsets are never zero, since an object's header (mark word)
 312  328    // is located at offset zero.
 313  329    RegisterOrConstant delayed_value(int(*value_fn)(), Register tmp, int offset = 0) {
↓ open down ↓ 38 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX