diff src/share/vm/opto/machnode.cpp @ 2014:4de5f4101cfd

Merge
author iveresov
date Wed, 08 Dec 2010 17:50:49 -0800
parents 2f644f85485d
children 3d42f82cd811
line wrap: on
line diff
--- a/src/share/vm/opto/machnode.cpp	Wed Dec 08 04:50:35 2010 -0800
+++ b/src/share/vm/opto/machnode.cpp	Wed Dec 08 17:50:49 2010 -0800
@@ -489,6 +489,20 @@
 }
 #endif
 
+
+//=============================================================================
+int MachConstantNode::constant_offset() {
+  int offset = _constant.offset();
+  // Bind the offset lazily.
+  if (offset == -1) {
+    Compile::ConstantTable& constant_table = Compile::current()->constant_table();
+    offset = constant_table.table_base_offset() + constant_table.find_offset(_constant);
+    _constant.set_offset(offset);
+  }
+  return offset;
+}
+
+
 //=============================================================================
 #ifndef PRODUCT
 void MachNullCheckNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {