Skip to content

Commit

Permalink
JACOBIN-300 Update to explanatory comments re searching for methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
platypusguy committed Aug 31, 2023
1 parent 8298ed2 commit 61d2f9c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/classloader/classes.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,15 @@ type InvokeDynamicEntry struct { // type 18 (invokedynamic data)
// Package = 20
// )

// FetchMethodAndCP gets the method and the CP for the class of the method.
// It searches for the method first by checking the MTable (that is, the method table).
// FetchMethodAndCP gets the method and the CP for the class of the method. It searches
// for the method first by checking the global MTable (that is, the global method table).
// If it doesn't find it there, then it looks for it in the class entry in MethArea.
// If it finds it there, then it loads that class into the MTable and returns that
// entry as the Method it's returning.
//
// Note that if the given method is not found, the hierarchy of superclasses is traversed,
// in search for the method. The one exception is for main() which, if not found in the
// first class, will never be in one of the superclasses.
func FetchMethodAndCP(class, meth string, methType string) (MTentry, error) {
origClassName := class
for {
Expand Down

0 comments on commit 61d2f9c

Please sign in to comment.