Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix perf issue on get locations of breakpoint #88

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

testforstephen
Copy link
Contributor

Signed-off-by: Jinbo Wang jinbwan@microsoft.com
fix bug #49.

Nested types are just needed for those already loaded classes. For the referenceType from ClassPrepareEvent, no need to search the locations in the nested types. For newly loaded classes, the debugger has also registered ClassPrepareRequest for their local types, so the debugger will handle the local types in ClassPrepareEvent handler.

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
List<Location> newLocations = collectLocations(refType, lineNumber);
if (!newLocations.isEmpty()) {
locations.addAll(newLocations);
} else if (includeNestedTypes) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the advice?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i mean why here it is else if rather than if?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the breakpoint located in the refType, no need to search the nested type.

@testforstephen testforstephen merged commit ece63b8 into master Oct 25, 2017
@testforstephen testforstephen deleted the jinbo_breakpointperf branch October 25, 2017 02:48
@Goom11
Copy link

Goom11 commented Aug 21, 2018

Hello, @testforstephen, how do you know that ReferenceType.nestedTypes invokes VirtualMachine.allClasses?

@testforstephen
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants