diff src/share/vm/opto/machnode.cpp @ 2008:2f644f85485d

6961690: load oops from constant table on SPARC Summary: oops should be loaded from the constant table of an nmethod instead of materializing them with a long code sequence. Reviewed-by: never, kvn
author twisti
date Fri, 03 Dec 2010 01:34:31 -0800
parents f95d63e2154a
children 3d42f82cd811
line wrap: on
line diff
--- a/src/share/vm/opto/machnode.cpp	Thu Dec 02 17:21:12 2010 -0800
+++ b/src/share/vm/opto/machnode.cpp	Fri Dec 03 01:34:31 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 {