hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp
author twisti
Fri, 13 Feb 2009 09:09:35 -0800
changeset 2031 24e034f56dcb
parent 1 489c9b5090e2
child 5547 f4b087cbb361
permissions -rw-r--r--
6800154: Add comments to long_by_long_mulhi() for better understandability Summary: This patch adds a comment pointing to the Hacker's Delight version of the algorithm plus a verbatim copy of it. Furthermore it adds inline comments. Reviewed-by: kvn, jrose
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
// machine-dependent implemention for register maps
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
  friend class frame;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
  intptr_t* _window;         // register window save area (for L and I regs)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
  intptr_t* _younger_window; // previous save area (for O regs, if needed)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
  address pd_location(VMReg reg) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  void pd_clear();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  void pd_initialize_from(const RegisterMap* map) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
    _window         = map->_window;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    _younger_window = map->_younger_window;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    _location_valid[0] = 0;  // avoid the shift_individual_registers game
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  void pd_initialize() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    _window = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    _younger_window = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
    _location_valid[0] = 0;  // avoid the shift_individual_registers game
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  void shift_window(intptr_t* sp, intptr_t* younger_sp) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
    _window         = sp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
    _younger_window = younger_sp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    // Throw away locations for %i, %o, and %l registers:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
    // But do not throw away %g register locs.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    if (_location_valid[0] != 0)  shift_individual_registers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  void shift_individual_registers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  // When popping out of compiled frames, we make all IRegs disappear.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  void make_integer_regs_unsaved() { _location_valid[0] = 0; }