Custom RTA analyzer

Introduced properties

private var _cnlc: CNLC

nitc :: MetricsRapidTypeAnalysis :: _cnlc

Class Live Casts
private var _cnli: CNLI

nitc :: MetricsRapidTypeAnalysis :: _cnli

Class Live Instances
private var _tnlc: TNLC

nitc :: MetricsRapidTypeAnalysis :: _tnlc

Rtpe Live Casts
private var _tnli: TNLI

nitc :: MetricsRapidTypeAnalysis :: _tnli

Type Live Instances
fun cnlc: CNLC

nitc :: MetricsRapidTypeAnalysis :: cnlc

Class Live Casts
protected fun cnlc=(cnlc: CNLC)

nitc :: MetricsRapidTypeAnalysis :: cnlc=

Class Live Casts
fun cnli: CNLI

nitc :: MetricsRapidTypeAnalysis :: cnli

Class Live Instances
protected fun cnli=(cnli: CNLI)

nitc :: MetricsRapidTypeAnalysis :: cnli=

Class Live Instances
init defaultinit(modelbuilder: ModelBuilder, mainmodule: MModule)

nitc :: MetricsRapidTypeAnalysis :: defaultinit

fun tnlc: TNLC

nitc :: MetricsRapidTypeAnalysis :: tnlc

Rtpe Live Casts
protected fun tnlc=(tnlc: TNLC)

nitc :: MetricsRapidTypeAnalysis :: tnlc=

Rtpe Live Casts
fun tnli: TNLI

nitc :: MetricsRapidTypeAnalysis :: tnli

Type Live Instances
protected fun tnli=(tnli: TNLI)

nitc :: MetricsRapidTypeAnalysis :: tnli=

Type Live Instances

Redefined properties

redef type SELF: MetricsRapidTypeAnalysis

nitc $ MetricsRapidTypeAnalysis :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _cnlc: CNLC

nitc :: MetricsRapidTypeAnalysis :: _cnlc

Class Live Casts
private var _cnli: CNLI

nitc :: MetricsRapidTypeAnalysis :: _cnli

Class Live Instances
private var _live_callsites: HashSet[CallSite]

nitc :: RapidTypeAnalysis :: _live_callsites

Live callsites.
private var _live_cast_types: HashSet[MType]

nitc :: RapidTypeAnalysis :: _live_cast_types

The pool of types used to perform type checks (isa and as).
private var _live_classes: HashSet[MClass]

nitc :: RapidTypeAnalysis :: _live_classes

Live (instantiated) classes.
private var _live_methoddefs: HashSet[MMethodDef]

nitc :: RapidTypeAnalysis :: _live_methoddefs

Live method definitions.
private var _live_methods: HashSet[MMethod]

nitc :: RapidTypeAnalysis :: _live_methods

Live methods.
private var _live_mmodules: HashSet[MModule]

nitc :: RapidTypeAnalysis :: _live_mmodules

Live mmodules.
private var _live_open_cast_types: HashSet[MType]

nitc :: RapidTypeAnalysis :: _live_open_cast_types

The pool of undesolved types used to perform type checks (isa and as).
private var _live_open_types: HashSet[MClassType]

nitc :: RapidTypeAnalysis :: _live_open_types

The pool of unresolved live types
private var _live_super_sends: HashSet[MMethodDef]

nitc :: RapidTypeAnalysis :: _live_super_sends

Live call-to-super.
private var _live_types: HashSet[MClassType]

nitc :: RapidTypeAnalysis :: _live_types

The pool to live types.
private var _mainmodule: MModule

nitc :: RapidTypeAnalysis :: _mainmodule

The main module of the analysis.
private var _modelbuilder: ModelBuilder

nitc :: RapidTypeAnalysis :: _modelbuilder

The modelbuilder used to get the AST.
private var _tnlc: TNLC

nitc :: MetricsRapidTypeAnalysis :: _tnlc

Rtpe Live Casts
private var _tnli: TNLI

nitc :: MetricsRapidTypeAnalysis :: _tnli

Type Live Instances
private var _todo: List[MMethodDef]

nitc :: RapidTypeAnalysis :: _todo

The method definitions that remain to visit
private var _totry_methods: HashSet[MMethod]

nitc :: RapidTypeAnalysis :: _totry_methods

Methods that are still candidate to the try_send
private var _totry_methods_to_remove: Array[MMethod]

nitc :: RapidTypeAnalysis :: _totry_methods_to_remove

Methods that are are no more candidate to the try_send
private var _try_methods: HashSet[MMethod]

nitc :: RapidTypeAnalysis :: _try_methods

Methods that are or were candidate to the try_send
fun add_send(recv: MType, mproperty: MMethod)

nitc :: RapidTypeAnalysis :: add_send

protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun cnlc: CNLC

nitc :: MetricsRapidTypeAnalysis :: cnlc

Class Live Casts
protected fun cnlc=(cnlc: CNLC)

nitc :: MetricsRapidTypeAnalysis :: cnlc=

Class Live Casts
fun cnli: CNLI

nitc :: MetricsRapidTypeAnalysis :: cnli

Class Live Instances
protected fun cnli=(cnli: CNLI)

nitc :: MetricsRapidTypeAnalysis :: cnli=

Class Live Instances
init defaultinit(modelbuilder: ModelBuilder, mainmodule: MModule)

nitc :: RapidTypeAnalysis :: defaultinit

init defaultinit(modelbuilder: ModelBuilder, mainmodule: MModule)

nitc :: MetricsRapidTypeAnalysis :: defaultinit

private fun force_alive(classname: String)

nitc :: RapidTypeAnalysis :: force_alive

fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
protected fun live_callsites=(live_callsites: HashSet[CallSite])

nitc :: RapidTypeAnalysis :: live_callsites=

Live callsites.
fun live_cast_types: HashSet[MType]

nitc :: RapidTypeAnalysis :: live_cast_types

The pool of types used to perform type checks (isa and as).
protected fun live_cast_types=(live_cast_types: HashSet[MType])

nitc :: RapidTypeAnalysis :: live_cast_types=

The pool of types used to perform type checks (isa and as).
fun live_classes: HashSet[MClass]

nitc :: RapidTypeAnalysis :: live_classes

Live (instantiated) classes.
protected fun live_classes=(live_classes: HashSet[MClass])

nitc :: RapidTypeAnalysis :: live_classes=

Live (instantiated) classes.
protected fun live_methoddefs=(live_methoddefs: HashSet[MMethodDef])

nitc :: RapidTypeAnalysis :: live_methoddefs=

Live method definitions.
protected fun live_methods=(live_methods: HashSet[MMethod])

nitc :: RapidTypeAnalysis :: live_methods=

Live methods.
fun live_methods_to_tree: OrderedTree[Object]

nitc :: RapidTypeAnalysis :: live_methods_to_tree

Return a ready-to-save OrderedTree object that agregates infomration about live methods.
protected fun live_mmodules=(live_mmodules: HashSet[MModule])

nitc :: RapidTypeAnalysis :: live_mmodules=

Live mmodules.
fun live_open_cast_types: HashSet[MType]

nitc :: RapidTypeAnalysis :: live_open_cast_types

The pool of undesolved types used to perform type checks (isa and as).
protected fun live_open_cast_types=(live_open_cast_types: HashSet[MType])

nitc :: RapidTypeAnalysis :: live_open_cast_types=

The pool of undesolved types used to perform type checks (isa and as).
fun live_open_types: HashSet[MClassType]

nitc :: RapidTypeAnalysis :: live_open_types

The pool of unresolved live types
protected fun live_open_types=(live_open_types: HashSet[MClassType])

nitc :: RapidTypeAnalysis :: live_open_types=

The pool of unresolved live types
protected fun live_super_sends=(live_super_sends: HashSet[MMethodDef])

nitc :: RapidTypeAnalysis :: live_super_sends=

Live call-to-super.
fun live_targets(callsite: CallSite): Set[MMethodDef]

nitc :: RapidTypeAnalysis :: live_targets

The live targets of a specific callsite.
fun live_types: HashSet[MClassType]

nitc :: RapidTypeAnalysis :: live_types

The pool to live types.
protected fun live_types=(live_types: HashSet[MClassType])

nitc :: RapidTypeAnalysis :: live_types=

The pool to live types.
fun live_types_to_csv: CsvDocument

nitc :: RapidTypeAnalysis :: live_types_to_csv

Return a ready-to-save CSV document objet that agregates informations about live types.
fun mainmodule: MModule

nitc :: RapidTypeAnalysis :: mainmodule

The main module of the analysis.
protected fun mainmodule=(mainmodule: MModule)

nitc :: RapidTypeAnalysis :: mainmodule=

The main module of the analysis.
fun modelbuilder: ModelBuilder

nitc :: RapidTypeAnalysis :: modelbuilder

The modelbuilder used to get the AST.
protected fun modelbuilder=(modelbuilder: ModelBuilder)

nitc :: RapidTypeAnalysis :: modelbuilder=

The modelbuilder used to get the AST.
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun run_analysis

nitc :: RapidTypeAnalysis :: run_analysis

Run the analysis until all visitable method definitions are visited.
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun tnlc: TNLC

nitc :: MetricsRapidTypeAnalysis :: tnlc

Rtpe Live Casts
protected fun tnlc=(tnlc: TNLC)

nitc :: MetricsRapidTypeAnalysis :: tnlc=

Rtpe Live Casts
fun tnli: TNLI

nitc :: MetricsRapidTypeAnalysis :: tnli

Type Live Instances
protected fun tnli=(tnli: TNLI)

nitc :: MetricsRapidTypeAnalysis :: tnli=

Type Live Instances
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
private fun todo: List[MMethodDef]

nitc :: RapidTypeAnalysis :: todo

The method definitions that remain to visit
private fun todo=(todo: List[MMethodDef])

nitc :: RapidTypeAnalysis :: todo=

The method definitions that remain to visit
private fun totry_methods: HashSet[MMethod]

nitc :: RapidTypeAnalysis :: totry_methods

Methods that are still candidate to the try_send
private fun totry_methods=(totry_methods: HashSet[MMethod])

nitc :: RapidTypeAnalysis :: totry_methods=

Methods that are still candidate to the try_send
private fun totry_methods_to_remove: Array[MMethod]

nitc :: RapidTypeAnalysis :: totry_methods_to_remove

Methods that are are no more candidate to the try_send
private fun totry_methods_to_remove=(totry_methods_to_remove: Array[MMethod])

nitc :: RapidTypeAnalysis :: totry_methods_to_remove=

Methods that are are no more candidate to the try_send
private fun try_methods: HashSet[MMethod]

nitc :: RapidTypeAnalysis :: try_methods

Methods that are or were candidate to the try_send
private fun try_methods=(try_methods: HashSet[MMethod])

nitc :: RapidTypeAnalysis :: try_methods=

Methods that are or were candidate to the try_send
fun try_send(recv: MClassType, mproperty: MMethod)

nitc :: RapidTypeAnalysis :: try_send

package_diagram nitc::MetricsRapidTypeAnalysis MetricsRapidTypeAnalysis nitc::RapidTypeAnalysis RapidTypeAnalysis nitc::MetricsRapidTypeAnalysis->nitc::RapidTypeAnalysis core::Object Object nitc::RapidTypeAnalysis->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

class RapidTypeAnalysis

nitc :: RapidTypeAnalysis

RapidTypeAnalysis looks for alive rapid types in application.

Class definitions

nitc $ MetricsRapidTypeAnalysis
# Custom RTA analyzer
class MetricsRapidTypeAnalysis
	super RapidTypeAnalysis

	# Class Live Instances
	var cnli: CNLI is lazy do return new CNLI(modelbuilder.model, mainmodule)

	# Class Live Casts
	var cnlc: CNLC is lazy do return new CNLC(modelbuilder.model, mainmodule)

	# Type Live Instances
	var tnli = new TNLI

	# Rtpe Live Casts
	var tnlc = new TNLC

	redef fun add_new(recv, mtype) do
		super
		tnli.values.inc(mtype)
		cnli.values.inc(mtype.mclass)
	end

	redef fun add_cast(mtype) do
		super
		tnlc.values.inc(mtype)

		mtype = mtype.undecorate
		if mtype isa MClassType then
			cnlc.values.inc(mtype.mclass)
		end
	end
end
src/metrics/rta_metrics.nit:354,1--385,3