comparison src/share/vm/opto/parse1.cpp @ 1278:da9559b49b84

6915557: assert(_gvn.type(l)->higher_equal(type),"must constrain OSR typestate") with debug build Reviewed-by: kvn
author never
date Thu, 25 Feb 2010 11:38:50 -0800
parents 106f41e88c85
children 7d236a9688c5
comparison
equal deleted inserted replaced
1277:855c5171834c 1278:da9559b49b84
1 /* 1 /*
2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
235 if (!live_locals.is_valid()) { 235 if (!live_locals.is_valid()) {
236 // Degenerate or breakpointed method. 236 // Degenerate or breakpointed method.
237 C->record_method_not_compilable("OSR in empty or breakpointed method"); 237 C->record_method_not_compilable("OSR in empty or breakpointed method");
238 return; 238 return;
239 } 239 }
240 MethodLivenessResult raw_live_locals = method()->raw_liveness_at_bci(osr_bci());
241 240
242 // Extract the needed locals from the interpreter frame. 241 // Extract the needed locals from the interpreter frame.
243 Node *locals_addr = basic_plus_adr(osr_buf, osr_buf, (max_locals-1)*wordSize); 242 Node *locals_addr = basic_plus_adr(osr_buf, osr_buf, (max_locals-1)*wordSize);
244 243
245 // find all the locals that the interpreter thinks contain live oops 244 // find all the locals that the interpreter thinks contain live oops
304 // Now that the interpreter state is loaded, make sure it will match 303 // Now that the interpreter state is loaded, make sure it will match
305 // at execution time what the compiler is expecting now: 304 // at execution time what the compiler is expecting now:
306 SafePointNode* bad_type_exit = clone_map(); 305 SafePointNode* bad_type_exit = clone_map();
307 bad_type_exit->set_control(new (C, 1) RegionNode(1)); 306 bad_type_exit->set_control(new (C, 1) RegionNode(1));
308 307
308 assert(osr_block->flow()->jsrs()->size() == 0, "should be no jsrs live at osr point");
309 for (index = 0; index < max_locals; index++) { 309 for (index = 0; index < max_locals; index++) {
310 if (stopped()) break; 310 if (stopped()) break;
311 Node* l = local(index); 311 Node* l = local(index);
312 if (l->is_top()) continue; // nothing here 312 if (l->is_top()) continue; // nothing here
313 const Type *type = osr_block->local_type_at(index); 313 const Type *type = osr_block->local_type_at(index);
315 if (!live_oops.at(index)) { 315 if (!live_oops.at(index)) {
316 // skip type check for dead oops 316 // skip type check for dead oops
317 continue; 317 continue;
318 } 318 }
319 } 319 }
320 if (type->basic_type() == T_ADDRESS && !raw_live_locals.at(index)) { 320 if (type->basic_type() == T_ADDRESS) {
321 // Skip type check for dead address locals 321 // In our current system it's illegal for jsr addresses to be
322 // live into an OSR entry point because the compiler performs
323 // inlining of jsrs. ciTypeFlow has a bailout that detect this
324 // case and aborts the compile if addresses are live into an OSR
325 // entry point. Because of that we can assume that any address
326 // locals at the OSR entry point are dead. Method liveness
327 // isn't precise enought to figure out that they are dead in all
328 // cases so simply skip checking address locals all
329 // together. Any type check is guaranteed to fail since the
330 // interpreter type is the result of a load which might have any
331 // value and the expected type is a constant.
322 continue; 332 continue;
323 } 333 }
324 set_local(index, check_interpreter_type(l, type, bad_type_exit)); 334 set_local(index, check_interpreter_type(l, type, bad_type_exit));
325 } 335 }
326 336