aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornever <none@none>2011-04-25 16:25:58 -0700
committernever <none@none>2011-04-25 16:25:58 -0700
commitf48b4a8bcc5fd765ed12802288b0f98844645eb7 (patch)
treedfd7a8bd6881b30ebe95c6f0c6e11a15cf5243e3
parentd3f7047d31d568adc169f517dc7a0b685b4b90d7 (diff)
7030715: JSR 292 JRuby test/test_super_call_site_caching.rb asserts with +DoEscapeAnalysis
Reviewed-by: twisti
-rw-r--r--src/share/vm/ci/bcEscapeAnalyzer.cpp9
-rw-r--r--src/share/vm/ci/ciMethod.hpp19
-rw-r--r--src/share/vm/opto/graphKit.cpp6
3 files changed, 20 insertions, 14 deletions
diff --git a/src/share/vm/ci/bcEscapeAnalyzer.cpp b/src/share/vm/ci/bcEscapeAnalyzer.cpp
index 459109190..97b414448 100644
--- a/src/share/vm/ci/bcEscapeAnalyzer.cpp
+++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp
@@ -232,14 +232,7 @@ void BCEscapeAnalyzer::invoke(StateInfo &state, Bytecodes::Code code, ciMethod*
}
// compute size of arguments
- int arg_size = target->arg_size();
- if (code == Bytecodes::_invokedynamic) {
- assert(!target->is_static(), "receiver explicit in method");
- arg_size--; // implicit, not really on stack
- }
- if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
- arg_size--;
- }
+ int arg_size = target->invoke_arg_size(code);
int arg_base = MAX2(state._stack_height - arg_size, 0);
// direct recursive calls are skipped if they can be bound statically without introducing
diff --git a/src/share/vm/ci/ciMethod.hpp b/src/share/vm/ci/ciMethod.hpp
index 840fb5da0..bf9568306 100644
--- a/src/share/vm/ci/ciMethod.hpp
+++ b/src/share/vm/ci/ciMethod.hpp
@@ -127,7 +127,24 @@ class ciMethod : public ciObject {
ciSignature* signature() const { return _signature; }
ciType* return_type() const { return _signature->return_type(); }
int arg_size_no_receiver() const { return _signature->size(); }
- int arg_size() const { return _signature->size() + (_flags.is_static() ? 0 : 1); }
+ // Can only be used on loaded ciMethods
+ int arg_size() const {
+ check_is_loaded();
+ return _signature->size() + (_flags.is_static() ? 0 : 1);
+ }
+ // Report the number of elements on stack when invoking this method.
+ // This is different than the regular arg_size because invokdynamic
+ // has an implicit receiver.
+ int invoke_arg_size(Bytecodes::Code code) const {
+ int arg_size = _signature->size();
+ // Add a receiver argument, maybe:
+ if (code != Bytecodes::_invokestatic &&
+ code != Bytecodes::_invokedynamic) {
+ arg_size++;
+ }
+ return arg_size;
+ }
+
// Method code and related information.
address code() { if (_code == NULL) load_code(); return _code; }
diff --git a/src/share/vm/opto/graphKit.cpp b/src/share/vm/opto/graphKit.cpp
index 590c05fb3..e1612b843 100644
--- a/src/share/vm/opto/graphKit.cpp
+++ b/src/share/vm/opto/graphKit.cpp
@@ -1033,14 +1033,10 @@ bool GraphKit::compute_stack_effects(int& inputs, int& depth) {
iter.reset_to_bci(bci());
iter.next();
ciMethod* method = iter.get_method(ignore);
- inputs = method->arg_size_no_receiver();
- // Add a receiver argument, maybe:
- if (code != Bytecodes::_invokestatic &&
- code != Bytecodes::_invokedynamic)
- inputs += 1;
// (Do not use ciMethod::arg_size(), because
// it might be an unloaded method, which doesn't
// know whether it is static or not.)
+ inputs = method->invoke_arg_size(code);
int size = method->return_type()->size();
depth = size - inputs;
}