Class WasmGenerationEnvironment
java.lang.Object
com.google.j2cl.transpiler.backend.wasm.WasmGenerationEnvironment
Allows mapping of middle end constructors to the backend.
-
Method Summary
Modifier and TypeMethodDescriptiongetDataElementNameForLiteral(com.google.j2cl.transpiler.ast.ArrayLiteral arrayLiteral) Returns the data segment index for this literal and null if it does not have one.com.google.j2cl.transpiler.backend.wasm.JsMethodImportgetJsMethodImport(com.google.j2cl.transpiler.ast.MethodDescriptor methodDescriptor) getMethodImplementationName(com.google.j2cl.transpiler.ast.MethodDescriptor methodDescriptor) Returns the name of the global function that implements the method.getTypeSignature(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) getTypeSignature(com.google.j2cl.transpiler.ast.TypeDescriptor typeDescriptor) getVtableFieldName(com.google.j2cl.transpiler.ast.MethodDescriptor methodDescriptor) Returns the name of the field in the vtable that corresponds tomethodDescriptor.getWasmEmptyArrayGlobalName(com.google.j2cl.transpiler.ast.ArrayTypeDescriptor arrayTypeDescriptor) getWasmInterfaceVtableGlobalName(com.google.j2cl.transpiler.ast.TypeDeclaration ifce, com.google.j2cl.transpiler.ast.TypeDeclaration inClass) Returns the name of the global that stores the vtable for a Java type.getWasmItableGlobalName(com.google.j2cl.transpiler.ast.DeclaredTypeDescriptor typeDescriptor) Returns the name of the global that stores the itable for a Java type.getWasmItableGlobalName(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the global that stores the itable for a Java type.getWasmItableInterfaceGetter(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the itable interface getter.getWasmItableInterfaceGetter(String fieldName) Returns the name of the itable interface getter.getWasmItableTypeName(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the wasm type of the itable for a Java type.getWasmVtableGlobalName(com.google.j2cl.transpiler.ast.DeclaredTypeDescriptor typeDescriptor) Returns the name of the global that stores the vtable for a Java type.getWasmVtableGlobalName(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the global that stores the vtable for a Java type.getWasmVtableTypeName(com.google.j2cl.transpiler.ast.DeclaredTypeDescriptor typeDescriptor) Returns the name of the wasm type of the vtable for a Java type.getWasmVtableTypeName(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the wasm type of the vtable for a Java type.booleanisJsImport(com.google.j2cl.transpiler.ast.Method method) booleanregisterDataSegmentLiteral(com.google.j2cl.transpiler.ast.ArrayLiteral arrayLiteral, String typeQualifiedName) Registers the ArrayLiteral as a data segment and returns true if it was not present.
-
Method Details
-
getTypeSignature
-
getTypeSignature
-
getWasmEmptyArrayGlobalName
public String getWasmEmptyArrayGlobalName(com.google.j2cl.transpiler.ast.ArrayTypeDescriptor arrayTypeDescriptor) -
getWasmItableGlobalName
public String getWasmItableGlobalName(com.google.j2cl.transpiler.ast.DeclaredTypeDescriptor typeDescriptor) Returns the name of the global that stores the itable for a Java type. -
getWasmItableGlobalName
public String getWasmItableGlobalName(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the global that stores the itable for a Java type. -
getWasmVtableTypeName
public String getWasmVtableTypeName(com.google.j2cl.transpiler.ast.DeclaredTypeDescriptor typeDescriptor) Returns the name of the wasm type of the vtable for a Java type. -
getWasmVtableTypeName
Returns the name of the wasm type of the vtable for a Java type. -
getWasmItableTypeName
Returns the name of the wasm type of the itable for a Java type. -
getWasmItableInterfaceGetter
public String getWasmItableInterfaceGetter(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the itable interface getter. -
getWasmItableInterfaceGetter
Returns the name of the itable interface getter. -
getWasmInterfaceVtableGlobalName
public String getWasmInterfaceVtableGlobalName(com.google.j2cl.transpiler.ast.TypeDeclaration ifce, com.google.j2cl.transpiler.ast.TypeDeclaration inClass) Returns the name of the global that stores the vtable for a Java type. -
getWasmVtableGlobalName
public String getWasmVtableGlobalName(com.google.j2cl.transpiler.ast.DeclaredTypeDescriptor typeDescriptor) Returns the name of the global that stores the vtable for a Java type. -
getWasmVtableGlobalName
public String getWasmVtableGlobalName(com.google.j2cl.transpiler.ast.TypeDeclaration typeDeclaration) Returns the name of the global that stores the vtable for a Java type. -
getVtableFieldName
Returns the name of the field in the vtable that corresponds tomethodDescriptor. -
getMethodImplementationName
public String getMethodImplementationName(com.google.j2cl.transpiler.ast.MethodDescriptor methodDescriptor) Returns the name of the global function that implements the method.Note that these names need to be globally unique and are different than the names of the slots in the vtable which maps nicely to our concept of mangled names.
-
registerDataSegmentLiteral
public boolean registerDataSegmentLiteral(com.google.j2cl.transpiler.ast.ArrayLiteral arrayLiteral, String typeQualifiedName) Registers the ArrayLiteral as a data segment and returns true if it was not present. -
getDataElementNameForLiteral
public String getDataElementNameForLiteral(com.google.j2cl.transpiler.ast.ArrayLiteral arrayLiteral) Returns the data segment index for this literal and null if it does not have one. -
getJsImports
-
getJsMethodImport
public com.google.j2cl.transpiler.backend.wasm.JsMethodImport getJsMethodImport(com.google.j2cl.transpiler.ast.MethodDescriptor methodDescriptor) -
isJsImport
public boolean isJsImport(com.google.j2cl.transpiler.ast.Method method)
-