diff src/share/vm/opto/node.cpp @ 7434:32164d89fe9c

8004845: Catch incorrect usage of new and delete during compile time for value objects and stack objects Summary: Makes the "new" and "delete" operator of _ValueObj and StackObj private Reviewed-by: dholmes, coleenp Contributed-by: erik.helin@oracle.com
author brutisso
date Mon, 17 Dec 2012 15:25:26 +0100
parents 2aff40cb4703
children a7114d3d712e
line wrap: on
line diff
--- a/src/share/vm/opto/node.cpp	Mon Dec 17 08:49:20 2012 +0100
+++ b/src/share/vm/opto/node.cpp	Mon Dec 17 15:25:26 2012 +0100
@@ -1839,15 +1839,16 @@
   return idx;                   // True for other than index 0 (control)
 }
 
+static RegMask _not_used_at_all;
 // Register classes are defined for specific machines
 const RegMask &Node::out_RegMask() const {
   ShouldNotCallThis();
-  return *(new RegMask());
+  return _not_used_at_all;
 }
 
 const RegMask &Node::in_RegMask(uint) const {
   ShouldNotCallThis();
-  return *(new RegMask());
+  return _not_used_at_all;
 }
 
 //=============================================================================