comparison src/share/vm/graal/graalRuntime.hpp @ 9596:aa8f3fc0a9a9

removed infrastructure for Graal assembler stubs (GRAAL-81)
author Doug Simon <doug.simon@oracle.com>
date Tue, 07 May 2013 01:58:11 +0200
parents db2125285960
children 1b60f639ac4b
comparison
equal deleted inserted replaced
9595:db2125285960 9596:aa8f3fc0a9a9
22 */ 22 */
23 23
24 #ifndef SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP 24 #ifndef SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP
25 #define SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP 25 #define SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP
26 26
27 #include "code/stubs.hpp"
28 #include "interpreter/interpreter.hpp" 27 #include "interpreter/interpreter.hpp"
29 #include "memory/allocation.hpp" 28 #include "memory/allocation.hpp"
30 #include "runtime/deoptimization.hpp" 29 #include "runtime/deoptimization.hpp"
31 30
32 // A GraalStubAssembler is a MacroAssembler w/ extra functionality for runtime
33 // stubs. Currently it 'knows' some stub info. Eventually, the information
34 // may be set automatically or can be asserted when using specialised
35 // GraalStubAssembler functions.
36
37 class GraalStubAssembler: public MacroAssembler {
38 private:
39 const char* _name;
40 bool _must_gc_arguments;
41 int _frame_size;
42 int _num_rt_args;
43 int _stub_id;
44
45 public:
46
47 enum {
48 no_frame_size = -1
49 };
50
51 // creation
52 GraalStubAssembler(CodeBuffer* code, const char * name, int stub_id);
53 void set_info(const char* name, bool must_gc_arguments);
54
55 void set_frame_size(int size);
56 void set_num_rt_args(int args);
57
58 // accessors
59 const char* name() const { return _name; }
60 bool must_gc_arguments() const { return _must_gc_arguments; }
61 int frame_size() const { return _frame_size; }
62 int num_rt_args() const { return _num_rt_args; }
63 int stub_id() const { return _stub_id; }
64
65 // runtime calls (return offset of call to be used by GC map)
66 int call_RT(Register oop_result1, Register metadata_result, address entry, int args_size = 0);
67 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1);
68 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2);
69 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3);
70 int call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3, Register arg4);
71 };
72
73 // set frame size and return address offset to these values in blobs
74 // (if the compiled frame uses ebp as link pointer on IA; otherwise,
75 // the frame size must be fixed)
76
77 // Holds all assembly stubs and VM
78 // runtime routines needed by code code generated
79 // by Graal.
80 #define GRAAL_STUBS(stub, last_entry) \
81 last_entry(number_of_ids)
82
83 #define DECLARE_STUB_ID(x) x ## _id ,
84 #define DECLARE_LAST_STUB_ID(x) x
85 #define STUB_NAME(x) #x " GraalRuntime stub",
86 #define LAST_STUB_NAME(x) #x " GraalRuntime stub"
87
88 class GraalRuntime: public AllStatic { 31 class GraalRuntime: public AllStatic {
89 friend class VMStructs;
90
91 public:
92 enum StubID {
93 GRAAL_STUBS(DECLARE_STUB_ID, DECLARE_LAST_STUB_ID)
94 };
95
96 private:
97 static CodeBlob* _blobs[number_of_ids];
98 static const char* _blob_names[];
99
100 // stub generation
101 static void generate_blob_for(BufferBlob* blob, StubID id);
102 static OopMapSet* generate_code_for(StubID id, GraalStubAssembler* sasm);
103 static void generate_unwind_exception(GraalStubAssembler *sasm);
104
105 static OopMapSet* generate_stub_call(GraalStubAssembler* sasm, Register result, address entry,
106 Register arg1 = noreg, Register arg2 = noreg, Register arg3 = noreg);
107
108 // runtime entry points
109 static void unimplemented_entry(JavaThread* thread, StubID id);
110
111 public: 32 public:
112 static void new_instance(JavaThread* thread, Klass* klass); 33 static void new_instance(JavaThread* thread, Klass* klass);
113 static void new_array(JavaThread* thread, Klass* klass, jint length); 34 static void new_array(JavaThread* thread, Klass* klass, jint length);
114 static void new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims); 35 static void new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims);
115 static jboolean thread_is_interrupted(JavaThread* thread, oopDesc* obj, jboolean clear_interrupte); 36 static jboolean thread_is_interrupted(JavaThread* thread, oopDesc* obj, jboolean clear_interrupte);
130 LOG_OBJECT_ADDRESS = 0x04 51 LOG_OBJECT_ADDRESS = 0x04
131 }; 52 };
132 static void log_object(JavaThread* thread, oop msg, jint flags); 53 static void log_object(JavaThread* thread, oop msg, jint flags);
133 static void write_barrier_pre(JavaThread* thread, oopDesc* obj); 54 static void write_barrier_pre(JavaThread* thread, oopDesc* obj);
134 static void write_barrier_post(JavaThread* thread, oopDesc* obj, void* card); 55 static void write_barrier_post(JavaThread* thread, oopDesc* obj, void* card);
135
136 // initialization
137 static void initialize(BufferBlob* blob);
138
139 // stubs
140 static CodeBlob* blob_for (StubID id);
141 static address entry_for(StubID id) { return blob_for(id)->code_begin(); }
142 static const char* name_for (StubID id);
143 static const char* name_for_address(address entry);
144 }; 56 };
145 57
146 #endif // SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP 58 #endif // SHARE_VM_GRAAL_GRAAL_RUNTIME_HPP