# --no-inline-intern
var opt_no_inline_intern = new OptionBool("Do not inline call to intern methods", "--no-inline-intern")
# --no-union-attribute
- var opt_no_union_attribute = new OptionBool("Put primitive attibutes in a box instead of an union", "--no-union-attribute")
+ var opt_no_union_attribute = new OptionBool("Put primitive attributes in a box instead of an union", "--no-union-attribute")
# --no-shortcut-equate
var opt_no_shortcut_equate = new OptionBool("Always call == in a polymorphic way", "--no-shortcut-equal")
# --no-tag-primitives
var opt_no_tag_primitives = new OptionBool("Use only boxes for primitive types", "--no-tag-primitives")
# --colors-are-symbols
- var opt_colors_are_symbols = new OptionBool("Store colors as symbols (link-boost)", "--colors-are-symbols")
+ var opt_colors_are_symbols = new OptionBool("Store colors as symbols instead of static data (link-boost)", "--colors-are-symbols")
# --trampoline-call
var opt_trampoline_call = new OptionBool("Use an indirection when calling", "--trampoline-call")
# --guard-call
var opt_guard_call = new OptionBool("Guard VFT calls with a direct call", "--guard-call")
# --substitute-monomorph
- var opt_substitute_monomorph = new OptionBool("Replace monomorph trampoline with direct call (link-boost)", "--substitute-monomorph")
+ var opt_substitute_monomorph = new OptionBool("Replace monomorphic trampolines with direct calls (link-boost)", "--substitute-monomorph")
# --link-boost
var opt_link_boost = new OptionBool("Enable all link-boost optimizations", "--link-boost")
# --inline-some-methods
var opt_inline_some_methods = new OptionBool("Allow the separate compiler to inline some methods (semi-global)", "--inline-some-methods")
# --direct-call-monomorph
- var opt_direct_call_monomorph = new OptionBool("Allow the separate compiler to direct call monomorph sites (semi-global)", "--direct-call-monomorph")
+ var opt_direct_call_monomorph = new OptionBool("Allow the separate compiler to direct call monomorphic sites (semi-global)", "--direct-call-monomorph")
# --direct-call-monomorph0
- var opt_direct_call_monomorph0 = new OptionBool("Allow the separate compiler to direct call monomorph sites (semi-global)", "--direct-call-monomorph0")
+ var opt_direct_call_monomorph0 = new OptionBool("Allow the separate compiler to direct call monomorphic sites (semi-global)", "--direct-call-monomorph0")
# --skip-dead-methods
var opt_skip_dead_methods = new OptionBool("Do not compile dead methods (semi-global)", "--skip-dead-methods")
# --semi-global
# --tables-metrics
var opt_tables_metrics = new OptionBool("Enable static size measuring of tables used for vft, typing and resolution", "--tables-metrics")
# --type-poset
- var opt_type_poset = new OptionBool("Build a poset of types to create more condensed tables.", "--type-poset")
+ var opt_type_poset = new OptionBool("Build a poset of types to create more condensed tables", "--type-poset")
redef init
do
for cd in mmodule.mclassdefs do
for pd in cd.mpropdefs do
if not pd isa MMethodDef then continue
- if pd.msignature == null then continue # Skip broken method
+ if pd.mproperty.is_broken or pd.is_broken or pd.msignature == null then continue # Skip broken method
var rta = runtime_type_analysis
if modelbuilder.toolcontext.opt_skip_dead_methods.value and rta != null and not rta.live_methoddefs.has(pd) then continue
#print "compile {pd} @ {cd} @ {mmodule}"
# In a true separate compiler (a with dynamic loading) you cannot do this unfortnally
fun compile_class_to_c(mclass: MClass)
do
+ if mclass.is_broken then return
+
var mtype = mclass.intro.bound_mtype
var c_name = mclass.c_name
if rta != null and not rta.live_methoddefs.has(mpropdef) then
v.add_decl("NULL, /* DEAD {mclass.intro_mmodule}:{mclass}:{mpropdef} */")
continue
+ else if mpropdef.is_broken or mpropdef.msignature == null or mpropdef.mproperty.is_broken then
+ v.add_decl("NULL, /* DEAD (BROKEN) {mclass.intro_mmodule}:{mclass}:{mpropdef} */")
+ continue
end
var rf = mpropdef.virtual_runtime_function
v.require_declaration(rf.c_name)
v.add_abort("type null")
v.add("\}")
v.add("if({t}->table_size < 0) \{")
- v.add("PRINT_ERROR(\"Insantiation of a dead type: %s\\n\", {t}->name);")
+ v.add("PRINT_ERROR(\"Instantiation of a dead type: %s\\n\", {t}->name);")
v.add_abort("type dead")
v.add("\}")
end
args.first = self.autobox(args.first, m.mclassdef.mclass.mclass_type)
end
for i in [0..msignature.arity[ do
- var t = msignature.mparameters[i].mtype
- if i == msignature.vararg_rank then
+ var mp = msignature.mparameters[i]
+ var t = mp.mtype
+ if mp.is_vararg then
t = args[i+1].mtype
end
args[i+1] = self.autobox(args[i+1], t)
args.first = self.unbox_extern(args.first, m.mclassdef.mclass.mclass_type)
end
for i in [0..msignature.arity[ do
- var t = msignature.mparameters[i].mtype
- if i == msignature.vararg_rank then
+ var mp = msignature.mparameters[i]
+ var t = mp.mtype
+ if mp.is_vararg then
t = args[i+1].mtype
end
if m.is_extern then args[i+1] = self.unbox_extern(args[i+1], t)
var sig = new FlatBuffer
sig.append("({called_recv.ctype} self")
for i in [0..called_signature.arity[ do
- var mtype = called_signature.mparameters[i].mtype
- if i == called_signature.vararg_rank then
+ var mp = called_signature.mparameters[i]
+ var mtype = mp.mtype
+ if mp.is_vararg then
mtype = mmethoddef.mclassdef.mmodule.array_type(mtype)
end
sig.append(", {mtype.ctype} p{i}")
comment.append("({selfvar}: {selfvar.mtype}")
arguments.add(selfvar)
for i in [0..msignature.arity[ do
- var mtype = msignature.mparameters[i].mtype
- if i == msignature.vararg_rank then
+ var mp = msignature.mparameters[i]
+ var mtype = mp.mtype
+ if mp.is_vararg then
mtype = v.mmodule.array_type(mtype)
end
comment.append(", {mtype}")