diff src/share/vm/ci/ciSignature.cpp @ 4001:5eb9169b1a14

7092712: JSR 292: unloaded invokedynamic call sites can lead to a crash with signature types not on BCP Reviewed-by: jrose, never
author twisti
date Wed, 12 Oct 2011 21:00:13 -0700
parents ddd894528dbc
children f6b0eb4e44cf
line wrap: on
line diff
--- a/src/share/vm/ci/ciSignature.cpp	Tue Oct 11 02:19:37 2011 -0700
+++ b/src/share/vm/ci/ciSignature.cpp	Wed Oct 12 21:00:13 2011 -0700
@@ -80,7 +80,7 @@
 }
 
 // ------------------------------------------------------------------
-// ciSignature::return_ciType
+// ciSignature::return_type
 //
 // What is the return type of this signature?
 ciType* ciSignature::return_type() const {
@@ -88,7 +88,7 @@
 }
 
 // ------------------------------------------------------------------
-// ciSignature::ciType_at
+// ciSignature::type_at
 //
 // What is the type of the index'th element of this
 // signature?
@@ -99,6 +99,24 @@
 }
 
 // ------------------------------------------------------------------
+// ciSignature::equals
+//
+// Compare this signature to another one.  Signatures with different
+// accessing classes but with signature-types resolved to the same
+// types are defined to be equal.
+bool ciSignature::equals(ciSignature* that) {
+  // Compare signature
+  if (!this->as_symbol()->equals(that->as_symbol()))  return false;
+  // Compare all types of the arguments
+  for (int i = 0; i < _count; i++) {
+    if (this->type_at(i) != that->type_at(i))         return false;
+  }
+  // Compare the return type
+  if (this->return_type() != that->return_type())     return false;
+  return true;
+}
+
+// ------------------------------------------------------------------
 // ciSignature::print_signature
 void ciSignature::print_signature() {
   _symbol->print_symbol();