summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
74f4009)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
end
# Abstract BMizing for MProperties
end
# Abstract BMizing for MProperties
-class MPropertyBMizer[E: MProperty]
+abstract class MPropertyBMizer[E: MProperty]
super PropertyLayoutBuilder[E]
type MPROP: MProperty
super PropertyLayoutBuilder[E]
type MPROP: MProperty
redef fun build_layout(elements) do
var result = new Layout[E]
var ids = new HashMap[E, Int]
redef fun build_layout(elements) do
var result = new Layout[E]
var ids = new HashMap[E, Int]
- for mclass in elements do
+ var lin = linearize_mclasses(elements)
+ for mclass in lin do
for mproperty in properties(mclass) do
if ids.has_key(mproperty) then continue
ids[mproperty] = ids.length
for mproperty in properties(mclass) do
if ids.has_key(mproperty) then continue
ids[mproperty] = ids.length
end
return properties
end
end
return properties
end
+
+ private fun linearize_mclasses(mclasses: Set[MClass]): Array[MClass] is abstract
end
# BMizing for MMethods
end
# BMizing for MMethods
redef type MPROP: MMethod
init(mmodule: MModule) do super(mmodule)
redef type MPROP: MMethod
init(mmodule: MModule) do super(mmodule)
+ # Less holes in tables with reverse linearization for method tables
+ redef fun linearize_mclasses(mclasses) do return self.mmodule.reverse_linearize_mclasses(mclasses)
end
# BMizing for MMAttributes
end
# BMizing for MMAttributes
redef type MPROP: MAttribute
init(mmodule: MModule) do super(mmodule)
redef type MPROP: MAttribute
init(mmodule: MModule) do super(mmodule)
+ # Less holes in tables with linearization for attribute tables
+ redef fun linearize_mclasses(mclasses) do return self.mmodule.linearize_mclasses(mclasses)
end
# BMizing for MVirtualTypeProps
end
# BMizing for MVirtualTypeProps
redef type MPROP: MVirtualTypeProp
init(mmodule: MModule) do super(mmodule)
redef type MPROP: MVirtualTypeProp
init(mmodule: MModule) do super(mmodule)
+ # Less holes in tables with reverse linearization for method tables
+ redef fun linearize_mclasses(mclasses) do return self.mmodule.reverse_linearize_mclasses(mclasses)