Mercurial > hg > truffle
comparison src/share/vm/code/dependencies.hpp @ 21559:be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 28 May 2015 15:36:48 +0200 |
parents | 6ee9b878902b |
children | 12dcf5ba8b34 |
comparison
equal
deleted
inserted
replaced
21558:d563baeca9df | 21559:be896a1983c0 |
---|---|
198 static int dep_context_arg(DepType dept) { return has_explicit_context_arg(dept) ? 0 : -1; } | 198 static int dep_context_arg(DepType dept) { return has_explicit_context_arg(dept) ? 0 : -1; } |
199 static int dep_implicit_context_arg(DepType dept) { return has_implicit_context_arg(dept) ? 0 : -1; } | 199 static int dep_implicit_context_arg(DepType dept) { return has_implicit_context_arg(dept) ? 0 : -1; } |
200 | 200 |
201 static void check_valid_dependency_type(DepType dept); | 201 static void check_valid_dependency_type(DepType dept); |
202 | 202 |
203 #ifdef GRAAL | 203 #ifdef JVMCI |
204 // A Metadata* or object value recorded in an OopRecorder | 204 // A Metadata* or object value recorded in an OopRecorder |
205 class DepValue VALUE_OBJ_CLASS_SPEC { | 205 class DepValue VALUE_OBJ_CLASS_SPEC { |
206 private: | 206 private: |
207 // Unique identifier of the value within the associated OopRecorder that | 207 // Unique identifier of the value within the associated OopRecorder that |
208 // encodes both the category of the value (0: invalid, positive: metadata, negative: object) | 208 // encodes both the category of the value (0: invalid, positive: metadata, negative: object) |
247 | 247 |
248 private: | 248 private: |
249 // State for writing a new set of dependencies: | 249 // State for writing a new set of dependencies: |
250 GrowableArray<int>* _dep_seen; // (seen[h->ident] & (1<<dept)) | 250 GrowableArray<int>* _dep_seen; // (seen[h->ident] & (1<<dept)) |
251 GrowableArray<ciBaseObject*>* _deps[TYPE_LIMIT]; | 251 GrowableArray<ciBaseObject*>* _deps[TYPE_LIMIT]; |
252 #ifdef GRAAL | 252 #ifdef JVMCI |
253 bool _using_dep_values; | 253 bool _using_dep_values; |
254 GrowableArray<DepValue>* _dep_values[TYPE_LIMIT]; | 254 GrowableArray<DepValue>* _dep_values[TYPE_LIMIT]; |
255 #endif | 255 #endif |
256 | 256 |
257 static const char* _dep_name[TYPE_LIMIT]; | 257 static const char* _dep_name[TYPE_LIMIT]; |
269 _dep_seen->at_put(x_id, seen | (1<<dept)); | 269 _dep_seen->at_put(x_id, seen | (1<<dept)); |
270 // return true if we've already seen dept/x | 270 // return true if we've already seen dept/x |
271 return (seen & (1<<dept)) != 0; | 271 return (seen & (1<<dept)) != 0; |
272 } | 272 } |
273 | 273 |
274 #ifdef GRAAL | 274 #ifdef JVMCI |
275 bool note_dep_seen(int dept, DepValue x) { | 275 bool note_dep_seen(int dept, DepValue x) { |
276 assert(dept < BitsPerInt, "oops"); | 276 assert(dept < BitsPerInt, "oops"); |
277 // place metadata deps at even indexes, object deps at odd indexes | 277 // place metadata deps at even indexes, object deps at odd indexes |
278 int x_id = x.is_metadata() ? x.index() * 2 : (x.index() * 2) + 1; | 278 int x_id = x.is_metadata() ? x.index() * 2 : (x.index() * 2) + 1; |
279 assert(_dep_seen != NULL, "deps must be writable"); | 279 assert(_dep_seen != NULL, "deps must be writable"); |
284 } | 284 } |
285 #endif | 285 #endif |
286 | 286 |
287 bool maybe_merge_ctxk(GrowableArray<ciBaseObject*>* deps, | 287 bool maybe_merge_ctxk(GrowableArray<ciBaseObject*>* deps, |
288 int ctxk_i, ciKlass* ctxk); | 288 int ctxk_i, ciKlass* ctxk); |
289 #ifdef GRAAL | 289 #ifdef JVMCI |
290 bool maybe_merge_ctxk(GrowableArray<DepValue>* deps, | 290 bool maybe_merge_ctxk(GrowableArray<DepValue>* deps, |
291 int ctxk_i, DepValue ctxk); | 291 int ctxk_i, DepValue ctxk); |
292 #endif | 292 #endif |
293 | 293 |
294 void sort_all_deps(); | 294 void sort_all_deps(); |
309 public: | 309 public: |
310 // Make a new empty dependencies set. | 310 // Make a new empty dependencies set. |
311 Dependencies(ciEnv* env) { | 311 Dependencies(ciEnv* env) { |
312 initialize(env); | 312 initialize(env); |
313 } | 313 } |
314 #ifdef GRAAL | 314 #ifdef JVMCI |
315 Dependencies(Arena* arena, OopRecorder* oop_recorder, CompileLog* log); | 315 Dependencies(Arena* arena, OopRecorder* oop_recorder, CompileLog* log); |
316 #endif // GRAAL | 316 #endif // JVMCI |
317 | 317 |
318 private: | 318 private: |
319 // Check for a valid context type. | 319 // Check for a valid context type. |
320 // Enforce the restriction against array types. | 320 // Enforce the restriction against array types. |
321 static void check_ctxk(ciKlass* ctxk) { | 321 static void check_ctxk(ciKlass* ctxk) { |
344 void assert_abstract_with_exclusive_concrete_subtypes(ciKlass* ctxk, ciKlass* k1, ciKlass* k2); | 344 void assert_abstract_with_exclusive_concrete_subtypes(ciKlass* ctxk, ciKlass* k1, ciKlass* k2); |
345 void assert_exclusive_concrete_methods(ciKlass* ctxk, ciMethod* m1, ciMethod* m2); | 345 void assert_exclusive_concrete_methods(ciKlass* ctxk, ciMethod* m1, ciMethod* m2); |
346 void assert_has_no_finalizable_subclasses(ciKlass* ctxk); | 346 void assert_has_no_finalizable_subclasses(ciKlass* ctxk); |
347 void assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle); | 347 void assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle); |
348 | 348 |
349 #ifdef GRAAL | 349 #ifdef JVMCI |
350 private: | 350 private: |
351 static void check_ctxk(Klass* ctxk) { | 351 static void check_ctxk(Klass* ctxk) { |
352 assert(ctxk->oop_is_instance(), "java types only"); | 352 assert(ctxk->oop_is_instance(), "java types only"); |
353 } | 353 } |
354 static void check_ctxk_abstract(Klass* ctxk) { | 354 static void check_ctxk_abstract(Klass* ctxk) { |
363 void assert_has_no_finalizable_subclasses(Klass* ctxk); | 363 void assert_has_no_finalizable_subclasses(Klass* ctxk); |
364 void assert_leaf_type(Klass* ctxk); | 364 void assert_leaf_type(Klass* ctxk); |
365 void assert_unique_concrete_method(Klass* ctxk, Method* uniqm); | 365 void assert_unique_concrete_method(Klass* ctxk, Method* uniqm); |
366 void assert_abstract_with_unique_concrete_subtype(Klass* ctxk, Klass* conck); | 366 void assert_abstract_with_unique_concrete_subtype(Klass* ctxk, Klass* conck); |
367 void assert_call_site_target_value(oop callSite, oop methodHandle); | 367 void assert_call_site_target_value(oop callSite, oop methodHandle); |
368 #endif // GRAAL | 368 #endif // JVMCI |
369 | 369 |
370 // Define whether a given method or type is concrete. | 370 // Define whether a given method or type is concrete. |
371 // These methods define the term "concrete" as used in this module. | 371 // These methods define the term "concrete" as used in this module. |
372 // For this module, an "abstract" class is one which is non-concrete. | 372 // For this module, an "abstract" class is one which is non-concrete. |
373 // | 373 // |