hotspot/src/share/vm/opto/library_call.cpp
changeset 14627 e377574462e9
parent 14621 fd9265ab0f67
child 14829 03af9abeb93b
child 14828 bb9dffedf46c
child 14817 f187517aaeea
--- a/hotspot/src/share/vm/opto/library_call.cpp	Fri Nov 30 15:23:16 2012 -0800
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Mon Dec 03 15:48:49 2012 -0800
@@ -79,14 +79,19 @@
       _intrinsic(intrinsic),
       _result(NULL)
   {
-    // Find out how many arguments the interpreter needs when deoptimizing
-    // and save the stack pointer value so it can used by uncommon_trap.
-    // We find the argument count by looking at the declared signature.
-    bool ignored_will_link;
-    ciSignature* declared_signature = NULL;
-    ciMethod* ignored_callee = caller()->get_method_at_bci(bci(), ignored_will_link, &declared_signature);
-    const int nargs = declared_signature->arg_size_for_bc(caller()->java_code_at_bci(bci()));
-    _reexecute_sp = sp() + nargs;  // "push" arguments back on stack
+    // Check if this is a root compile.  In that case we don't have a caller.
+    if (!jvms->has_method()) {
+      _reexecute_sp = sp();
+    } else {
+      // Find out how many arguments the interpreter needs when deoptimizing
+      // and save the stack pointer value so it can used by uncommon_trap.
+      // We find the argument count by looking at the declared signature.
+      bool ignored_will_link;
+      ciSignature* declared_signature = NULL;
+      ciMethod* ignored_callee = caller()->get_method_at_bci(bci(), ignored_will_link, &declared_signature);
+      const int nargs = declared_signature->arg_size_for_bc(caller()->java_code_at_bci(bci()));
+      _reexecute_sp = sp() + nargs;  // "push" arguments back on stack
+    }
   }
 
   virtual LibraryCallKit* is_LibraryCallKit() const { return (LibraryCallKit*)this; }