< prev index next >

src/share/vm/c1/c1_ValueStack.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 156   void truncate_stack(int size)                  { _stack.trunc_to(size); }
 157   void raw_push(Value t)                         { _stack.push(t); }
 158   Value raw_pop()                                { return _stack.pop(); }
 159 
 160   // typed manipulation
 161   void ipush(Value t)                            { _stack.push(check(intTag    , t)); }
 162   void fpush(Value t)                            { _stack.push(check(floatTag  , t)); }
 163   void apush(Value t)                            { _stack.push(check(objectTag , t)); }
 164   void rpush(Value t)                            { _stack.push(check(addressTag, t)); }
 165   void lpush(Value t)                            { _stack.push(check(longTag   , t)); _stack.push(NULL); }
 166   void dpush(Value t)                            { _stack.push(check(doubleTag , t)); _stack.push(NULL); }
 167 
 168   void push(ValueType* type, Value t) {
 169     switch (type->tag()) {
 170       case intTag    : ipush(t); return;
 171       case longTag   : lpush(t); return;
 172       case floatTag  : fpush(t); return;
 173       case doubleTag : dpush(t); return;
 174       case objectTag : apush(t); return;
 175       case addressTag: rpush(t); return;

 176     }
 177     ShouldNotReachHere();
 178   }
 179 
 180   Value ipop()                                   { return check(intTag    , _stack.pop()); }
 181   Value fpop()                                   { return check(floatTag  , _stack.pop()); }
 182   Value apop()                                   { return check(objectTag , _stack.pop()); }
 183   Value rpop()                                   { return check(addressTag, _stack.pop()); }
 184   Value lpop()                                   { Value h = _stack.pop(); return check(longTag  , _stack.pop(), h); }
 185   Value dpop()                                   { Value h = _stack.pop(); return check(doubleTag, _stack.pop(), h); }
 186 
 187   Value pop(ValueType* type) {
 188     switch (type->tag()) {
 189       case intTag    : return ipop();
 190       case longTag   : return lpop();
 191       case floatTag  : return fpop();
 192       case doubleTag : return dpop();
 193       case objectTag : return apop();
 194       case addressTag: return rpop();

 195     }
 196     ShouldNotReachHere();
 197     return NULL;
 198   }
 199 
 200   Values* pop_arguments(int argument_size);
 201 
 202   // locks access
 203   int lock  (Value obj);
 204   int unlock();
 205   Value lock_at(int i) const                     { return _locks.at(i); }
 206 
 207   // SSA form IR support
 208   void setup_phi_for_stack(BlockBegin* b, int index);
 209   void setup_phi_for_local(BlockBegin* b, int index);
 210 
 211   // debugging
 212   void print()  PRODUCT_RETURN;
 213   void verify() PRODUCT_RETURN;
 214 };
 215 
 216 
 217 


   1 /*
   2  * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 156   void truncate_stack(int size)                  { _stack.trunc_to(size); }
 157   void raw_push(Value t)                         { _stack.push(t); }
 158   Value raw_pop()                                { return _stack.pop(); }
 159 
 160   // typed manipulation
 161   void ipush(Value t)                            { _stack.push(check(intTag    , t)); }
 162   void fpush(Value t)                            { _stack.push(check(floatTag  , t)); }
 163   void apush(Value t)                            { _stack.push(check(objectTag , t)); }
 164   void rpush(Value t)                            { _stack.push(check(addressTag, t)); }
 165   void lpush(Value t)                            { _stack.push(check(longTag   , t)); _stack.push(NULL); }
 166   void dpush(Value t)                            { _stack.push(check(doubleTag , t)); _stack.push(NULL); }
 167 
 168   void push(ValueType* type, Value t) {
 169     switch (type->tag()) {
 170       case intTag    : ipush(t); return;
 171       case longTag   : lpush(t); return;
 172       case floatTag  : fpush(t); return;
 173       case doubleTag : dpush(t); return;
 174       case objectTag : apush(t); return;
 175       case addressTag: rpush(t); return;
 176       default        : ShouldNotReachHere(); return;
 177     }

 178   }
 179 
 180   Value ipop()                                   { return check(intTag    , _stack.pop()); }
 181   Value fpop()                                   { return check(floatTag  , _stack.pop()); }
 182   Value apop()                                   { return check(objectTag , _stack.pop()); }
 183   Value rpop()                                   { return check(addressTag, _stack.pop()); }
 184   Value lpop()                                   { Value h = _stack.pop(); return check(longTag  , _stack.pop(), h); }
 185   Value dpop()                                   { Value h = _stack.pop(); return check(doubleTag, _stack.pop(), h); }
 186 
 187   Value pop(ValueType* type) {
 188     switch (type->tag()) {
 189       case intTag    : return ipop();
 190       case longTag   : return lpop();
 191       case floatTag  : return fpop();
 192       case doubleTag : return dpop();
 193       case objectTag : return apop();
 194       case addressTag: return rpop();
 195       default        : ShouldNotReachHere(); return NULL;
 196     }


 197   }
 198 
 199   Values* pop_arguments(int argument_size);
 200 
 201   // locks access
 202   int lock  (Value obj);
 203   int unlock();
 204   Value lock_at(int i) const                     { return _locks.at(i); }
 205 
 206   // SSA form IR support
 207   void setup_phi_for_stack(BlockBegin* b, int index);
 208   void setup_phi_for_local(BlockBegin* b, int index);
 209 
 210   // debugging
 211   void print()  PRODUCT_RETURN;
 212   void verify() PRODUCT_RETURN;
 213 };
 214 
 215 
 216 


< prev index next >