hotspot/src/share/vm/asm/assembler.cpp
changeset 13391 30245956af37
parent 11434 c50976508b6b
child 13963 e5b53c306fb5
--- a/hotspot/src/share/vm/asm/assembler.cpp	Mon Jul 23 13:04:59 2012 -0700
+++ b/hotspot/src/share/vm/asm/assembler.cpp	Tue Jul 24 10:51:00 2012 -0700
@@ -318,6 +318,16 @@
   }
 }
 
+RegisterOrConstant AbstractAssembler::delayed_value(int(*value_fn)(), Register tmp, int offset) {
+  intptr_t val = (intptr_t) (*value_fn)();
+  if (val != 0)  return val + offset;
+  return delayed_value_impl(delayed_value_addr(value_fn), tmp, offset);
+}
+RegisterOrConstant AbstractAssembler::delayed_value(address(*value_fn)(), Register tmp, int offset) {
+  intptr_t val = (intptr_t) (*value_fn)();
+  if (val != 0)  return val + offset;
+  return delayed_value_impl(delayed_value_addr(value_fn), tmp, offset);
+}
 intptr_t* AbstractAssembler::delayed_value_addr(int(*value_fn)()) {
   DelayedConstant* dcon = DelayedConstant::add(T_INT, (DelayedConstant::value_fn_t) value_fn);
   return &dcon->value;