hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp
author jiangli
Wed, 06 Jun 2012 14:33:43 -0400
changeset 12937 0032fb2caff6
parent 7397 5b173b4ca846
permissions -rw-r--r--
7172967: Eliminate constMethod's _method backpointer to methodOop. Summary: Eliminate constMethod's _method backpointer to methodOop, and move the _constant field from methodOop to constMethod. Reviewed-by: roland, bdelsart, kamg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6271
diff changeset
     2
 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
6271
271ac8e393e4 6977640: Zero and Shark fixes
twisti
parents: 5547
diff changeset
     3
 * Copyright 2007, 2010 Red Hat, Inc.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     5
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     8
 * published by the Free Software Foundation.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     9
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    14
 * accompanied this code).
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    15
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    19
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4013
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4013
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4013
diff changeset
    22
 * questions.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    23
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    24
 */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    25
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6271
diff changeset
    26
#ifndef CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6271
diff changeset
    27
#define CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6271
diff changeset
    28
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    29
// Inline interpreter functions for zero
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    30
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    31
inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    32
  return op1 + op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    33
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    34
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    35
inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    36
  return op1 - op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    37
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    38
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    39
inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    40
  return op1 * op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    41
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    42
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    43
inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    44
  return op1 / op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    45
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    46
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    47
inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
  return fmod(op1, op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    50
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    51
inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    52
  return -op;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    53
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat  op1,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    56
                                                   jfloat  op2,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
                                                   int32_t direction) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
  return ( op1 < op2 ? -1 :
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
               op1 > op2 ? 1 :
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
                   op1 == op2 ? 0 :
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
                       (direction == -1 || direction == 1) ? direction : 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    62
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
inline void BytecodeInterpreter::VMmemCopy64(uint32_t       to[2],
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    66
                                             const uint32_t from[2]) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    67
  *(uint64_t *) to = *(uint64_t *) from;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    68
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    69
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    70
inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    71
  return op1 + op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    72
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    73
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    74
inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
  return op1 & op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    76
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    77
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    78
inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    79
  /* it's possible we could catch this special case implicitly */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
  if (op1 == (jlong) 0x8000000000000000LL && op2 == -1) return op1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    81
  else return op1 / op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    82
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    83
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    84
inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    85
  return op1 * op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    86
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    87
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    88
inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    89
  return op1 | op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    90
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    91
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    92
inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    93
  return op1 - op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    94
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    95
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    96
inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    97
  return op1 ^ op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    98
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    99
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   100
inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   101
  /* it's possible we could catch this special case implicitly */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   102
  if (op1 == (jlong) 0x8000000000000000LL && op2 == -1) return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
  else return op1 % op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   104
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   105
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   106
inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   107
  return ((unsigned long long) op1) >> (op2 & 0x3F);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   108
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   109
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   110
inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
  return op1 >> (op2 & 0x3F);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
  return op1 << (op2 & 0x3F);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   116
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   117
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   118
inline jlong BytecodeInterpreter::VMlongNeg(jlong op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   119
  return -op;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   120
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   121
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   122
inline jlong BytecodeInterpreter::VMlongNot(jlong op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   123
  return ~op;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   124
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   125
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   126
inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   127
  return (op <= 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   128
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   129
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   130
inline int32_t BytecodeInterpreter::VMlongGez(jlong op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   131
  return (op >= 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   132
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   133
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   134
inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   135
  return (op == 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   136
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   137
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   138
inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   139
  return (op1 == op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   140
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   141
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   142
inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   143
  return (op1 != op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   144
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   145
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   146
inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   147
  return (op1 >= op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   148
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   149
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   150
inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   151
  return (op1 <= op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   152
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   153
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   154
inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   155
  return (op1 < op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   156
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   157
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   158
inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   159
  return (op1 > op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   160
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   161
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   162
inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   163
  return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   164
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   165
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   166
// Long conversions
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   167
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   168
inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   169
  return (jdouble) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   170
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   171
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   172
inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   173
  return (jfloat) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   174
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   175
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   176
inline jint BytecodeInterpreter::VMlong2Int(jlong val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   177
  return (jint) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   178
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   179
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   180
// Double Arithmetic
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   181
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   182
inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   183
  return op1 + op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   184
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   185
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   186
inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   187
  // Divide by zero... QQQ
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   188
  return op1 / op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   189
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   190
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   191
inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   192
  return op1 * op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   193
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   194
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   195
inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   196
  return -op;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   197
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   198
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   199
inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   200
  return fmod(op1, op2);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   201
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   202
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   203
inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   204
  return op1 - op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   205
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   206
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   207
inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   208
                                                    jdouble op2,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   209
                                                    int32_t direction) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   210
  return ( op1 < op2 ? -1 :
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   211
               op1 > op2 ? 1 :
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   212
                   op1 == op2 ? 0 :
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   213
                       (direction == -1 || direction == 1) ? direction : 0);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   214
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   215
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   216
// Double Conversions
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   217
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   218
inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   219
  return (jfloat) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   220
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   221
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   222
// Float Conversions
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   223
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   224
inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   225
  return (jdouble) op;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   226
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   227
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   228
// Integer Arithmetic
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   229
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   230
inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   231
  return op1 + op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   232
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   233
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   234
inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   235
  return op1 & op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   236
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   237
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   238
inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   239
  /* it's possible we could catch this special case implicitly */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   240
  if (op1 == (jint) 0x80000000 && op2 == -1) return op1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   241
  else return op1 / op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   242
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   243
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   244
inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   245
  return op1 * op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   246
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   247
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   248
inline jint BytecodeInterpreter::VMintNeg(jint op) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   249
  return -op;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   250
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   251
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   252
inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   253
  return op1 | op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   254
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   255
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   256
inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   257
  /* it's possible we could catch this special case implicitly */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   258
  if (op1 == (jint) 0x80000000 && op2 == -1) return 0;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   259
  else return op1 % op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   260
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   261
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   262
inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   263
  return op1 << (op2 & 0x1F);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   264
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   265
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   266
inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   267
  return op1 >> (op2 & 0x1F);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   268
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   269
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   270
inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   271
  return op1 - op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   272
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   273
6271
271ac8e393e4 6977640: Zero and Shark fixes
twisti
parents: 5547
diff changeset
   274
inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   275
  return ((juint) op1) >> (op2 & 0x1F);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   276
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   277
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   278
inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   279
  return op1 ^ op2;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   280
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   281
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   282
inline jdouble BytecodeInterpreter::VMint2Double(jint val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   283
  return (jdouble) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   284
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   285
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   286
inline jfloat BytecodeInterpreter::VMint2Float(jint val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   287
  return (jfloat) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   288
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   289
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   290
inline jlong BytecodeInterpreter::VMint2Long(jint val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   291
  return (jlong) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   292
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   293
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   294
inline jchar BytecodeInterpreter::VMint2Char(jint val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   295
  return (jchar) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   296
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   297
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   298
inline jshort BytecodeInterpreter::VMint2Short(jint val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   299
  return (jshort) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   300
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   301
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   302
inline jbyte BytecodeInterpreter::VMint2Byte(jint val) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   303
  return (jbyte) val;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   304
}
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6271
diff changeset
   305
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6271
diff changeset
   306
#endif // CPU_ZERO_VM_BYTECODEINTERPRETER_ZERO_INLINE_HPP