86
87 // There is a race possible once at startup and then we're fine
88
89 // Note that this is being called from a compiler thread not the
90 // main startup thread.
91
92 if (_runtimes != initialized) {
93 initialize_runtimes( initialize_runtime, &_runtimes);
94 }
95
96 // Mark this compiler object as ready to roll
97 mark_initialized();
98 }
99
100 void C2Compiler::compile_method(ciEnv* env,
101 ciMethod* target,
102 int entry_bci) {
103 if (!is_initialized()) {
104 initialize();
105 }
106 bool subsume_loads = true;
107 bool do_escape_analysis = DoEscapeAnalysis &&
108 !env->jvmti_can_access_local_variables();
109 while (!env->failing()) {
110 // Attempt to compile while subsuming loads into machine instructions.
111 Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis);
112
113 // Check result and retry if appropriate.
114 if (C.failure_reason() != NULL) {
115 if (C.failure_reason_is(retry_no_subsuming_loads())) {
116 assert(subsume_loads, "must make progress");
117 subsume_loads = false;
118 continue; // retry
119 }
120 if (C.failure_reason_is(retry_no_escape_analysis())) {
121 assert(do_escape_analysis, "must make progress");
122 do_escape_analysis = false;
123 continue; // retry
124 }
125 // Pass any other failure reason up to the ciEnv.
126 // Note that serious, irreversible failures are already logged
127 // on the ciEnv via env->record_method_not_compilable().
128 env->record_failure(C.failure_reason());
129 }
130
131 // No retry; just break the loop.
132 break;
133 }
134 }
135
136
137 void C2Compiler::print_timers() {
138 // do nothing
139 }
|
86
87 // There is a race possible once at startup and then we're fine
88
89 // Note that this is being called from a compiler thread not the
90 // main startup thread.
91
92 if (_runtimes != initialized) {
93 initialize_runtimes( initialize_runtime, &_runtimes);
94 }
95
96 // Mark this compiler object as ready to roll
97 mark_initialized();
98 }
99
100 void C2Compiler::compile_method(ciEnv* env,
101 ciMethod* target,
102 int entry_bci) {
103 if (!is_initialized()) {
104 initialize();
105 }
106 bool subsume_loads = SubsumeLoads;
107 bool do_escape_analysis = DoEscapeAnalysis &&
108 !env->jvmti_can_access_local_variables();
109 while (!env->failing()) {
110 // Attempt to compile while subsuming loads into machine instructions.
111 Compile C(env, this, target, entry_bci, subsume_loads, do_escape_analysis);
112
113
114 // Check result and retry if appropriate.
115 if (C.failure_reason() != NULL) {
116 if (C.failure_reason_is(retry_no_subsuming_loads())) {
117 assert(subsume_loads, "must make progress");
118 subsume_loads = false;
119 continue; // retry
120 }
121 if (C.failure_reason_is(retry_no_escape_analysis())) {
122 assert(do_escape_analysis, "must make progress");
123 do_escape_analysis = false;
124 continue; // retry
125 }
126 // Pass any other failure reason up to the ciEnv.
127 // Note that serious, irreversible failures are already logged
128 // on the ciEnv via env->record_method_not_compilable().
129 env->record_failure(C.failure_reason());
130 }
131 if (CompileTheWorld) {
132 if (subsume_loads) {
133 subsume_loads = false;
134 continue; // retry
135 }
136 if (do_escape_analysis) {
137 do_escape_analysis = false;
138 continue; // retry
139 }
140 }
141
142 // No retry; just break the loop.
143 break;
144 }
145 }
146
147
148 void C2Compiler::print_timers() {
149 // do nothing
150 }
|