hotspot/src/share/vm/c1/c1_Instruction.hpp
changeset 5046 27e801a857cb
parent 1 489c9b5090e2
child 5334 b2d040a8d375
equal deleted inserted replaced
5044:7e40acdf2163 5046:27e801a857cb
     1 /*
     1 /*
     2  * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 1999-2010 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1132 };
  1132 };
  1133 
  1133 
  1134 
  1134 
  1135 LEAF(Invoke, StateSplit)
  1135 LEAF(Invoke, StateSplit)
  1136  private:
  1136  private:
  1137   Bytecodes::Code           _code;
  1137   Bytecodes::Code _code;
  1138   Value                     _recv;
  1138   Value           _recv;
  1139   Values*                   _args;
  1139   Values*         _args;
  1140   BasicTypeList*            _signature;
  1140   BasicTypeList*  _signature;
  1141   int                       _vtable_index;
  1141   int             _vtable_index;
  1142   ciMethod*                 _target;
  1142   ciMethod*       _target;
       
  1143   ValueStack*     _state_before;  // Required for deoptimization.
  1143 
  1144 
  1144  public:
  1145  public:
  1145   // creation
  1146   // creation
  1146   Invoke(Bytecodes::Code code, ValueType* result_type, Value recv, Values* args,
  1147   Invoke(Bytecodes::Code code, ValueType* result_type, Value recv, Values* args,
  1147          int vtable_index, ciMethod* target);
  1148          int vtable_index, ciMethod* target, ValueStack* state_before);
  1148 
  1149 
  1149   // accessors
  1150   // accessors
  1150   Bytecodes::Code code() const                   { return _code; }
  1151   Bytecodes::Code code() const                   { return _code; }
  1151   Value receiver() const                         { return _recv; }
  1152   Value receiver() const                         { return _recv; }
  1152   bool has_receiver() const                      { return receiver() != NULL; }
  1153   bool has_receiver() const                      { return receiver() != NULL; }
  1153   int number_of_arguments() const                { return _args->length(); }
  1154   int number_of_arguments() const                { return _args->length(); }
  1154   Value argument_at(int i) const                 { return _args->at(i); }
  1155   Value argument_at(int i) const                 { return _args->at(i); }
  1155   int vtable_index() const                       { return _vtable_index; }
  1156   int vtable_index() const                       { return _vtable_index; }
  1156   BasicTypeList* signature() const               { return _signature; }
  1157   BasicTypeList* signature() const               { return _signature; }
  1157   ciMethod* target() const                       { return _target; }
  1158   ciMethod* target() const                       { return _target; }
       
  1159   ValueStack* state_before() const               { return _state_before; }
  1158 
  1160 
  1159   // Returns false if target is not loaded
  1161   // Returns false if target is not loaded
  1160   bool target_is_final() const                   { return check_flag(TargetIsFinalFlag); }
  1162   bool target_is_final() const                   { return check_flag(TargetIsFinalFlag); }
  1161   bool target_is_loaded() const                  { return check_flag(TargetIsLoadedFlag); }
  1163   bool target_is_loaded() const                  { return check_flag(TargetIsLoadedFlag); }
  1162   // Returns false if target is not loaded
  1164   // Returns false if target is not loaded
  1163   bool target_is_strictfp() const                { return check_flag(TargetIsStrictfpFlag); }
  1165   bool target_is_strictfp() const                { return check_flag(TargetIsStrictfpFlag); }
  1164 
  1166 
       
  1167   // JSR 292 support
       
  1168   bool is_invokedynamic() const                  { return code() == Bytecodes::_invokedynamic; }
       
  1169 
  1165   // generic
  1170   // generic
  1166   virtual bool can_trap() const                  { return true; }
  1171   virtual bool can_trap() const                  { return true; }
  1167   virtual void input_values_do(void f(Value*)) {
  1172   virtual void input_values_do(void f(Value*)) {
  1168     StateSplit::input_values_do(f);
  1173     StateSplit::input_values_do(f);
  1169     if (has_receiver()) f(&_recv);
  1174     if (has_receiver()) f(&_recv);
  1170     for (int i = 0; i < _args->length(); i++) f(_args->adr_at(i));
  1175     for (int i = 0; i < _args->length(); i++) f(_args->adr_at(i));
  1171   }
  1176   }
       
  1177   virtual void state_values_do(void f(Value*));
  1172 };
  1178 };
  1173 
  1179 
  1174 
  1180 
  1175 LEAF(NewInstance, StateSplit)
  1181 LEAF(NewInstance, StateSplit)
  1176  private:
  1182  private: