src/share/vm/c1/c1_Instruction.hpp

changeset 2486
403dc4c1d7f5
parent 2344
ac637b7220d1
child 2508
b92c45f2bc75
equal deleted inserted replaced
2416:7514897db238 2486:403dc4c1d7f5
1 /* 1 /*
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. 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.
104 class UnsafePrefetch; 104 class UnsafePrefetch;
105 class UnsafePrefetchRead; 105 class UnsafePrefetchRead;
106 class UnsafePrefetchWrite; 106 class UnsafePrefetchWrite;
107 class ProfileCall; 107 class ProfileCall;
108 class ProfileInvoke; 108 class ProfileInvoke;
109 class RuntimeCall;
109 110
110 // A Value is a reference to the instruction creating the value 111 // A Value is a reference to the instruction creating the value
111 typedef Instruction* Value; 112 typedef Instruction* Value;
112 define_array(ValueArray, Value) 113 define_array(ValueArray, Value)
113 define_stack(Values, ValueArray) 114 define_stack(Values, ValueArray)
200 virtual void do_UnsafePutObject(UnsafePutObject* x) = 0; 201 virtual void do_UnsafePutObject(UnsafePutObject* x) = 0;
201 virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x) = 0; 202 virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x) = 0;
202 virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0; 203 virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) = 0;
203 virtual void do_ProfileCall (ProfileCall* x) = 0; 204 virtual void do_ProfileCall (ProfileCall* x) = 0;
204 virtual void do_ProfileInvoke (ProfileInvoke* x) = 0; 205 virtual void do_ProfileInvoke (ProfileInvoke* x) = 0;
206 virtual void do_RuntimeCall (RuntimeCall* x) = 0;
205 }; 207 };
206 208
207 209
208 // Hashing support 210 // Hashing support
209 // 211 //
2265 ciKlass* known_holder() { return _known_holder; } 2267 ciKlass* known_holder() { return _known_holder; }
2266 2268
2267 virtual void input_values_do(ValueVisitor* f) { if (_recv != NULL) f->visit(&_recv); } 2269 virtual void input_values_do(ValueVisitor* f) { if (_recv != NULL) f->visit(&_recv); }
2268 }; 2270 };
2269 2271
2272
2273 // Call some C runtime function that doesn't safepoint,
2274 // optionally passing the current thread as the first argument.
2275 LEAF(RuntimeCall, Instruction)
2276 private:
2277 const char* _entry_name;
2278 address _entry;
2279 Values* _args;
2280 bool _pass_thread; // Pass the JavaThread* as an implicit first argument
2281
2282 public:
2283 RuntimeCall(ValueType* type, const char* entry_name, address entry, Values* args, bool pass_thread = true)
2284 : Instruction(type)
2285 , _entry(entry)
2286 , _args(args)
2287 , _entry_name(entry_name)
2288 , _pass_thread(pass_thread) {
2289 ASSERT_VALUES
2290 pin();
2291 }
2292
2293 const char* entry_name() const { return _entry_name; }
2294 address entry() const { return _entry; }
2295 int number_of_arguments() const { return _args->length(); }
2296 Value argument_at(int i) const { return _args->at(i); }
2297 bool pass_thread() const { return _pass_thread; }
2298
2299 virtual void input_values_do(ValueVisitor* f) {
2300 for (int i = 0; i < _args->length(); i++) f->visit(_args->adr_at(i));
2301 }
2302 };
2303
2270 // Use to trip invocation counter of an inlined method 2304 // Use to trip invocation counter of an inlined method
2271 2305
2272 LEAF(ProfileInvoke, Instruction) 2306 LEAF(ProfileInvoke, Instruction)
2273 private: 2307 private:
2274 ciMethod* _inlinee; 2308 ciMethod* _inlinee;

mercurial