src/share/vm/shark/sharkValue.cpp

Print this page
rev 3850 : [mq]: shark.patch


 216   assert(!is_clone(), "shouldn't be");
 217   ((llvm::PHINode *) generic_value())->addIncoming(
 218       value->generic_value(), block);
 219   if (!value->zero_checked())
 220     _all_incomers_zero_checked = false;
 221 }
 222 void SharkAddressValue::addIncoming(SharkValue *value, BasicBlock* block) {
 223   assert(this->equal_to(value), "should be");
 224 }
 225 
 226 // Phi-style stuff for SharkState::merge
 227 
 228 SharkValue* SharkNormalValue::merge(SharkBuilder* builder,
 229                                     SharkValue*   other,
 230                                     BasicBlock*   other_block,
 231                                     BasicBlock*   this_block,
 232                                     const char*   name) {
 233   assert(type() == other->type(), "should be");
 234   assert(zero_checked() == other->zero_checked(), "should be");
 235 
 236   PHINode *phi = builder->CreatePHI(SharkType::to_stackType(type()), name);
 237   phi->addIncoming(this->generic_value(), this_block);
 238   phi->addIncoming(other->generic_value(), other_block);
 239   return SharkValue::create_generic(type(), phi, zero_checked());
 240 }
 241 SharkValue* SharkAddressValue::merge(SharkBuilder* builder,
 242                                      SharkValue*   other,
 243                                      BasicBlock*   other_block,
 244                                      BasicBlock*   this_block,
 245                                      const char*   name) {
 246   assert(this->equal_to(other), "should be");
 247   return this;
 248 }
 249 
 250 // Repeated null and divide-by-zero check removal
 251 
 252 bool SharkValue::zero_checked() const {
 253   ShouldNotCallThis();
 254 }
 255 void SharkValue::set_zero_checked(bool zero_checked) {
 256   ShouldNotCallThis();


 216   assert(!is_clone(), "shouldn't be");
 217   ((llvm::PHINode *) generic_value())->addIncoming(
 218       value->generic_value(), block);
 219   if (!value->zero_checked())
 220     _all_incomers_zero_checked = false;
 221 }
 222 void SharkAddressValue::addIncoming(SharkValue *value, BasicBlock* block) {
 223   assert(this->equal_to(value), "should be");
 224 }
 225 
 226 // Phi-style stuff for SharkState::merge
 227 
 228 SharkValue* SharkNormalValue::merge(SharkBuilder* builder,
 229                                     SharkValue*   other,
 230                                     BasicBlock*   other_block,
 231                                     BasicBlock*   this_block,
 232                                     const char*   name) {
 233   assert(type() == other->type(), "should be");
 234   assert(zero_checked() == other->zero_checked(), "should be");
 235 
 236   PHINode *phi = builder->CreatePHI(SharkType::to_stackType(type()), 0, name);
 237   phi->addIncoming(this->generic_value(), this_block);
 238   phi->addIncoming(other->generic_value(), other_block);
 239   return SharkValue::create_generic(type(), phi, zero_checked());
 240 }
 241 SharkValue* SharkAddressValue::merge(SharkBuilder* builder,
 242                                      SharkValue*   other,
 243                                      BasicBlock*   other_block,
 244                                      BasicBlock*   this_block,
 245                                      const char*   name) {
 246   assert(this->equal_to(other), "should be");
 247   return this;
 248 }
 249 
 250 // Repeated null and divide-by-zero check removal
 251 
 252 bool SharkValue::zero_checked() const {
 253   ShouldNotCallThis();
 254 }
 255 void SharkValue::set_zero_checked(bool zero_checked) {
 256   ShouldNotCallThis();