comparison src/share/vm/graal/graalCompiler.hpp @ 15582:063ec2920d21

made Graal runtime initialization in hosted mode lazy
author Doug Simon <doug.simon@oracle.com>
date Fri, 09 May 2014 18:46:41 +0200
parents a20be10ad437
children 66a9286203a2
comparison
equal deleted inserted replaced
15581:0dc0926cf0d8 15582:063ec2920d21
24 #ifndef SHARE_VM_GRAAL_GRAAL_COMPILER_HPP 24 #ifndef SHARE_VM_GRAAL_GRAAL_COMPILER_HPP
25 #define SHARE_VM_GRAAL_GRAAL_COMPILER_HPP 25 #define SHARE_VM_GRAAL_GRAAL_COMPILER_HPP
26 26
27 #include "compiler/abstractCompiler.hpp" 27 #include "compiler/abstractCompiler.hpp"
28 28
29 #define LEAF_GRAPH_ARRAY_SIZE (8192)
30
31 class GraalCompiler : public AbstractCompiler { 29 class GraalCompiler : public AbstractCompiler {
32 30
33 private: 31 private:
34 32
35 bool _initialized; 33 #ifdef COMPILERGRAAL
34 // Set to true once VMToCompiler.startCompiler() returns
35 bool _started;
36 #endif
36 37
37 static GraalCompiler* _instance; 38 static GraalCompiler* _instance;
38 address _external_deopt_i2c_entry; 39
39 public: 40 public:
40 41
41 GraalCompiler(); 42 GraalCompiler();
42 43
43 static GraalCompiler* instance() { return _instance; } 44 static GraalCompiler* instance() { return _instance; }
44
45 45
46 virtual const char* name() { return "Graal"; } 46 virtual const char* name() { return "Graal"; }
47 47
48 virtual bool supports_native() { return true; } 48 virtual bool supports_native() { return true; }
49 virtual bool supports_osr () { return true; } 49 virtual bool supports_osr () { return true; }
55 bool needs_stubs () { return false; } 55 bool needs_stubs () { return false; }
56 56
57 // Initialization 57 // Initialization
58 virtual void initialize(); 58 virtual void initialize();
59 59
60 #ifdef COMPILERGRAAL
60 // Compilation entry point for methods 61 // Compilation entry point for methods
61 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci); 62 virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
62 63
63 void compile_method(methodHandle target, int entry_bci, CompileTask* task, jboolean blocking); 64 void compile_method(methodHandle target, int entry_bci, CompileTask* task, jboolean blocking);
64 65
65 // Print compilation timers and statistics 66 // Print compilation timers and statistics
66 virtual void print_timers(); 67 virtual void print_timers();
67 68
68 void exit(); 69 void shutdown();
69 70 #endif
70 address get_external_deopt_i2c_entry() {return _external_deopt_i2c_entry;}
71
72 static BasicType kindToBasicType(jchar ch);
73
74 static BufferBlob* initialize_buffer_blob();
75
76 static address create_external_deopt_i2c();
77 }; 71 };
78 72
79 // Tracing macros
80
81 #define IF_TRACE_graal_1 if (!(TraceGraal >= 1)) ; else
82 #define IF_TRACE_graal_2 if (!(TraceGraal >= 2)) ; else
83 #define IF_TRACE_graal_3 if (!(TraceGraal >= 3)) ; else
84 #define IF_TRACE_graal_4 if (!(TraceGraal >= 4)) ; else
85 #define IF_TRACE_graal_5 if (!(TraceGraal >= 5)) ; else
86
87 // using commas and else to keep one-instruction semantics
88
89 #define TRACE_graal_1 if (!(TraceGraal >= 1 && (tty->print("TraceGraal-1: "), true))) ; else tty->print_cr
90 #define TRACE_graal_2 if (!(TraceGraal >= 2 && (tty->print(" TraceGraal-2: "), true))) ; else tty->print_cr
91 #define TRACE_graal_3 if (!(TraceGraal >= 3 && (tty->print(" TraceGraal-3: "), true))) ; else tty->print_cr
92 #define TRACE_graal_4 if (!(TraceGraal >= 4 && (tty->print(" TraceGraal-4: "), true))) ; else tty->print_cr
93 #define TRACE_graal_5 if (!(TraceGraal >= 5 && (tty->print(" TraceGraal-5: "), true))) ; else tty->print_cr
94
95 #endif // SHARE_VM_GRAAL_GRAAL_COMPILER_HPP 73 #endif // SHARE_VM_GRAAL_GRAAL_COMPILER_HPP