@@ -163,7 +163,7 @@ class ClassNode(ClassInterNode):
...
@@ -163,7 +163,7 @@ class ClassNode(ClassInterNode):
self.superClass=''# these fields initially stores a string that represent the super
self.superClass=''# these fields initially stores a string that represent the super
#### Code generation relevant fields ####
#### Code generation relevant fields ####
self.label=""# label in assembly
self.label=""# label in assembly
self.methodOffset={}# a dictionary that maps method signatures (method.name, method.paramTypes) to offsets in the CLASS memory layout
self.methodOffset={}# a dictionary that maps method signatures (method.name, method.paramTypes) to (offset, constructorFlag) in the CLASS memory layout
self.fieldOffset={}# a dictionary that maps field names to offsets in OBJECT memory layout
self.fieldOffset={}# a dictionary that maps field names to offsets in OBJECT memory layout
self.staticFieldLabels=[]# a list of static field labels
self.staticFieldLabels=[]# a list of static field labels
...
@@ -320,19 +320,38 @@ class ClassNode(ClassInterNode):
...
@@ -320,19 +320,38 @@ class ClassNode(ClassInterNode):
self.code+=p(instruction="dd",arg1=64)# just declaring a memory segment with a random number
self.code+=p(instruction="dd",arg1=64)# just declaring a memory segment with a random number
# 3. Assigning offsets to methods that aren't in the super class DECLARING memory segment for the methods
# 3. Assigning offsets to methods that aren't in the super class DECLARING memory segment for the methods
# Also simultaneosly creating a dictionary of methods for easier lookup
methodDict={}# a map of methods of the form (method.name, method.paramTypes) -> method node