3320 return alloc->as_Allocate();
3321 }
3322 }
3323 return NULL;
3324 }
3325
3326 // Trace Allocate -> Proj[Parm] -> Initialize
3327 InitializeNode* AllocateNode::initialization() {
3328 ProjNode* rawoop = proj_out(AllocateNode::RawAddress);
3329 if (rawoop == NULL) return NULL;
3330 for (DUIterator_Fast imax, i = rawoop->fast_outs(imax); i < imax; i++) {
3331 Node* init = rawoop->fast_out(i);
3332 if (init->is_Initialize()) {
3333 assert(init->as_Initialize()->allocation() == this, "2-way link");
3334 return init->as_Initialize();
3335 }
3336 }
3337 return NULL;
3338 }
3339
3340 //----------------------------- loop predicates ---------------------------
3341
3342 //------------------------------add_predicate_impl----------------------------
3343 void GraphKit::add_predicate_impl(Deoptimization::DeoptReason reason, int nargs) {
3344 // Too many traps seen?
3345 if (too_many_traps(reason)) {
3346 #ifdef ASSERT
3347 if (TraceLoopPredicate) {
3348 int tc = C->trap_count(reason);
3349 tty->print("too many traps=%s tcount=%d in ",
3350 Deoptimization::trap_reason_name(reason), tc);
3351 method()->print(); // which method has too many predicate traps
3352 tty->cr();
3353 }
3354 #endif
3355 // We cannot afford to take more traps here,
3356 // do not generate predicate.
3357 return;
3358 }
3359
|
3320 return alloc->as_Allocate();
3321 }
3322 }
3323 return NULL;
3324 }
3325
3326 // Trace Allocate -> Proj[Parm] -> Initialize
3327 InitializeNode* AllocateNode::initialization() {
3328 ProjNode* rawoop = proj_out(AllocateNode::RawAddress);
3329 if (rawoop == NULL) return NULL;
3330 for (DUIterator_Fast imax, i = rawoop->fast_outs(imax); i < imax; i++) {
3331 Node* init = rawoop->fast_out(i);
3332 if (init->is_Initialize()) {
3333 assert(init->as_Initialize()->allocation() == this, "2-way link");
3334 return init->as_Initialize();
3335 }
3336 }
3337 return NULL;
3338 }
3339
3340 // Trace Allocate -> Proj[Parm] -> MemBarStoreStore
3341 MemBarStoreStoreNode* AllocateNode::storestore() {
3342 ProjNode* rawoop = proj_out(AllocateNode::RawAddress);
3343 if (rawoop == NULL) return NULL;
3344 for (DUIterator_Fast imax, i = rawoop->fast_outs(imax); i < imax; i++) {
3345 Node* storestore = rawoop->fast_out(i);
3346 if (storestore->is_MemBarStoreStore()) {
3347 return storestore->as_MemBarStoreStore();
3348 }
3349 }
3350 return NULL;
3351 }
3352
3353 //----------------------------- loop predicates ---------------------------
3354
3355 //------------------------------add_predicate_impl----------------------------
3356 void GraphKit::add_predicate_impl(Deoptimization::DeoptReason reason, int nargs) {
3357 // Too many traps seen?
3358 if (too_many_traps(reason)) {
3359 #ifdef ASSERT
3360 if (TraceLoopPredicate) {
3361 int tc = C->trap_count(reason);
3362 tty->print("too many traps=%s tcount=%d in ",
3363 Deoptimization::trap_reason_name(reason), tc);
3364 method()->print(); // which method has too many predicate traps
3365 tty->cr();
3366 }
3367 #endif
3368 // We cannot afford to take more traps here,
3369 // do not generate predicate.
3370 return;
3371 }
3372
|