src/share/vm/c1/c1_Instruction.hpp

changeset 2486
403dc4c1d7f5
parent 2344
ac637b7220d1
child 2508
b92c45f2bc75
     1.1 --- a/src/share/vm/c1/c1_Instruction.hpp	Thu Dec 30 23:44:45 2010 -0800
     1.2 +++ b/src/share/vm/c1/c1_Instruction.hpp	Fri Jan 21 13:01:02 2011 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -106,6 +106,7 @@
    1.11  class         UnsafePrefetchWrite;
    1.12  class   ProfileCall;
    1.13  class   ProfileInvoke;
    1.14 +class   RuntimeCall;
    1.15  
    1.16  // A Value is a reference to the instruction creating the value
    1.17  typedef Instruction* Value;
    1.18 @@ -202,6 +203,7 @@
    1.19    virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0;
    1.20    virtual void do_ProfileCall    (ProfileCall*     x) = 0;
    1.21    virtual void do_ProfileInvoke  (ProfileInvoke*   x) = 0;
    1.22 +  virtual void do_RuntimeCall    (RuntimeCall*     x) = 0;
    1.23  };
    1.24  
    1.25  
    1.26 @@ -2267,6 +2269,38 @@
    1.27    virtual void input_values_do(ValueVisitor* f)   { if (_recv != NULL) f->visit(&_recv); }
    1.28  };
    1.29  
    1.30 +
    1.31 +// Call some C runtime function that doesn't safepoint,
    1.32 +// optionally passing the current thread as the first argument.
    1.33 +LEAF(RuntimeCall, Instruction)
    1.34 + private:
    1.35 +  const char* _entry_name;
    1.36 +  address     _entry;
    1.37 +  Values*     _args;
    1.38 +  bool        _pass_thread;  // Pass the JavaThread* as an implicit first argument
    1.39 +
    1.40 + public:
    1.41 +  RuntimeCall(ValueType* type, const char* entry_name, address entry, Values* args, bool pass_thread = true)
    1.42 +    : Instruction(type)
    1.43 +    , _entry(entry)
    1.44 +    , _args(args)
    1.45 +    , _entry_name(entry_name)
    1.46 +    , _pass_thread(pass_thread) {
    1.47 +    ASSERT_VALUES
    1.48 +    pin();
    1.49 +  }
    1.50 +
    1.51 +  const char* entry_name() const  { return _entry_name; }
    1.52 +  address entry() const           { return _entry; }
    1.53 +  int number_of_arguments() const { return _args->length(); }
    1.54 +  Value argument_at(int i) const  { return _args->at(i); }
    1.55 +  bool pass_thread() const        { return _pass_thread; }
    1.56 +
    1.57 +  virtual void input_values_do(ValueVisitor* f)   {
    1.58 +    for (int i = 0; i < _args->length(); i++) f->visit(_args->adr_at(i));
    1.59 +  }
    1.60 +};
    1.61 +
    1.62  // Use to trip invocation counter of an inlined method
    1.63  
    1.64  LEAF(ProfileInvoke, Instruction)

mercurial