All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.scalanative.codegen.DynamicHashMap.scala Maven / Gradle / Ivy

There is a newer version: 0.5.5
Show newest version
package scala.scalanative
package codegen

import scalanative.nir._
import scalanative.linker.{Class, Method}

class DynamicHashMap(meta: Metadata, cls: Class, proxies: Seq[Defn]) {
  val methods: Seq[Global.Member] = {
    val own = proxies.collect {
      case p if p.name.top == cls.name =>
        p.name.asInstanceOf[Global.Member]
    }
    val sigs = own.map(_.sig).toSet
    cls.parent
      .fold(Seq.empty[Global.Member])(meta.dynmap(_).methods)
      .filterNot(m => sigs.contains(m.sig)) ++ own
  }
  val ty: Type =
    Type.Ptr
  val value: Val =
    DynmethodPerfectHashMap(methods, meta.linked.dynsigs)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy