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

Refactoring #52

Open
10 tasks
RobertObkircher opened this issue Jun 18, 2021 · 5 comments
Open
10 tasks

Refactoring #52

RobertObkircher opened this issue Jun 18, 2021 · 5 comments

Comments

@RobertObkircher
Copy link
Owner

RobertObkircher commented Jun 18, 2021

  • use anonymous namespaces instead of "static"
  • create folders like "class" and "interpeter" and "jvm/jni"
  • "namespace class" won't work, so we need a better name
  • should namespaces be indented or not?
namespace {
int x;
}
namespace {
   int x;
}
  • Move ClassFile into it's own file and add more useful helper functions
  • rename ClassFile to Class? or maybe split it into Class (with members: header, padding, ClassFile)
  • Should we just use the jni types? I would get rid of Reference and replace it by pointers to Object.
  • Make more things private / improve encapsulation
  • Try to teach the debugger how to display constant pool entries (or store the classname directly in the ClassFile to make it easier to see)
  • Remove unnecessary usage of the "inline" keyword
@mischnic
Copy link
Collaborator

I like Reference

  • move the various utility functions in interpreter.cpp into a separate file

@RobertObkircher
Copy link
Owner Author

  • eliminate "this_class" and replace it with a string for the name
  • CONSTANT_Class_info* could just store the ClassFile * instead. For that the parser would have to know the address of the result (which it does, but it would have to be documented, so that the caller doesn't copy the result).

@RobertObkircher
Copy link
Owner Author

  • store sizeof(type) in the (primitive) class to make array operations simpler?

@RobertObkircher
Copy link
Owner Author

RobertObkircher commented Jun 21, 2021

  • create helper functions for pushing/popping frames

@mischnic
Copy link
Collaborator

mischnic commented Jun 23, 2021

  • allocate_array doesn't have to be generic anymore, use clazz->offset_of_array_after_header and clazz->element_size instead.

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

No branches or pull requests

2 participants