Permalink
Commits on Jan 2, 2012
  1. Add checkedcast instruction

    committed Jan 2, 2012
Commits on Jan 1, 2012
  1. instanceof and new now check for non-reified type parameters

    - We need runtime values for type parameters for the object type in
      new and the isa type in instanceof. These currently cannot be
      supplied at all by Tungsten.
    - This will be improved when we reified function type parameters and
      give access to class type parameters.
    committed Jan 1, 2012
  2. LLVM runtime: updated instanceof.c to use alloca instead of variable …

    …size arrays
    
    - Variable size arrays are only valid within the block they are
      declared in. We need arrays valid until the function returns.
    - alloca arrays don't seem to mix well with variable size arrays.
      Clang seems to let alloca'd memory expire when variable size arrays
      expire. So an alloca'd array can get overwritten on a later function
      call.
    committed Jan 1, 2012
  3. LLVM: tungsten.BitCastInstruction can now translate to inttoptr or pt…

    …rtoint
    
    - LLVM doesn't support bitcasts where either the source or destination
      type is a pointer and the other is not. The inttoptr and ptrtoint
      instructions need to be used instead. Tungsten just uses bitcast for
      all these cases.
    committed Jan 1, 2012
  4. Change lexing for binary and hexadecimal numbers

    - These numbers are now always treated as unsigned. They can no longer
      be negative.
    - This means that we can handle larger numbers. For example, with
      int8, we can lex 0xFF as -1 instead of writing -0x1.
    committed Jan 1, 2012
  5. Lowering support for instanceof and improved class/interface metadata

    - Objects can now be allocated with NothingType as a type argument
    - Added Type.alignment and implemented for each type
    - AggregateDefinition.size now counts padding bytes needed to align
      each field
    - Class.size now includes space for vtable pointer
    committed Jan 1, 2012
Commits on Dec 31, 2011
Commits on Dec 26, 2011
  1. Lowering support for instanceof instruction

    - Extracted countTypeArgumentWords and storeTypeArgumentWords from
      convertNewInstruction for use in convertInstanceOfInstruction.
    - Added tungsten.instanceof runtime function to lower-defns-{32,64}.w
    committed Dec 26, 2011
Commits on Dec 24, 2011
  1. Add runtime type information and instructions to tungsten.class_info

    - Added class_info.flags and interface_info.flags fields, which
      indicates whether a record is for a class or an interface. This will
      hold other attributes in the future.
    - Added class_info.superclass, which points to the superclass's
      class_info (if there is one).
    - Added supertype_count and supertypes an array of pointers to
      class_info and interface_info for all supertypes.
    - Added supertype_instructions, which shows how to construct supertype
      reified parameters from type arguments.
    - Refactored LowerPass methods for building class_info and
      interface_info and added support for the above fields.
    committed Dec 24, 2011
  2. Improving types for module I/O

    - Added NothingType to parser. This was previously forgotten.
    - Type argument lists are now List[ObjectType] instead of List[Type].
      Module I/O is updated to handle this.
    - Fixed a bug in Class and Interface scope validation
    - Variance no longer has a code property
    committed Dec 24, 2011
  3. Add recursive definition compare TestUtilities.assertDefnEquals

    - This method accepts a definition and two values of any type and
      compares them for equality using reflection. This is useful for
      pinpointing differences in large structures during unit testing.
    committed Dec 24, 2011
Commits on Dec 5, 2011
  1. Add ObjectDefinitionType.supertypes

    - This method enumerates types inherited by a supertype.
    - This will be used to create type construction instructions in
      class/interface meta-data.
    committed Dec 5, 2011
Commits on Nov 25, 2011
  1. Add InstanceOfInstruction

    - Does not yet support lowering
    committed Nov 25, 2011
Commits on Nov 24, 2011
  1. LowerPass.convertNewInstruction now stores type parameter values in o…

    …bject
    
    - In order for the future instanceof instruction to work correctly,
      information about an object's type arguments must be stored in the
      object itself.
    - Type information is stored in fields after each object. One word is
      required for each type argument (including arguments within
      arguments). Each word points to a @tungsten.class_info or
      @tungsten.interface_info record.
    - Added AggregateDefinition trait to calculate size of an object.
      Alignment is not taken into account yet.
    committed Nov 24, 2011
Commits on Nov 20, 2011
  1. Add superclass pointer to class_info meta-data

    - This is needed for instanceof to work correctly for superclasses.
    committed Nov 20, 2011
Commits on Nov 19, 2011
  1. Generate type parameter meta-data in LowerPass

    - More meta-data is necessary for runtime type checking, such as what
      we will do with instanceof and checkedcast instructions.
    - For each type parameter, we store a name and flags (which just
      contains variance type for now).
    - For each class or interface, we store a list of type parameters.
    committed Nov 19, 2011
  2. Lower upcast instructions to bitcast

    - upcast and bitcast instructions represent the same operation: an
      unchecked cast. The only difference is that upcasts are guaranteed
      to be safe by the type system.
    - Lowered code can't really be considered type safe anymore because
      high level relations like subclasses are gone: we are just left with
      pointers to apparently unrelated structs. Upcasts between lowered
      types are no longer valid.
    - This change converts all upcasts to bitcasts so lowered code is
      still valid.
    committed Nov 19, 2011
  3. Check DefinedValue types matches their definitions

    - DefinedValues carry the type of the definition they refer to so that
      users of values don't require a Module to look up types.
    - This change adds DefinedValue.validate, which checks that a value's
      type matches its definition.
    - For convenience, the TypedDefinition trait is also added. Function,
      Global, Parameter, and Instruction have this trait.
    - Global.ty returns a pointer type since globals are treated as
      pointers.
    committed Nov 19, 2011
  4. Implement @tungsten.load_ivtable in lower-defns-{32,64}.w

    - This function is used to load an ivtable from a receiver. It does so
      using a linear search. Search is necessary because different classes
      may have ivtable entries at different offsets.
    - LowerPass is modified to call this function correct. The function
      must return int8* and the caller must cast the result to the correct
      type. This is used to lower the vcall and vlookup instructions.
    committed Nov 19, 2011
Commits on Nov 6, 2011
  1. Remove file I/O intrinsics and clean out runtime library

    - There is no reason for the compiler itself to support file I/O. This
      is something that can easily be put in a library.
    - This change removes all intrinsics except for EXIT. All file I/O
      related definitions are also removed from runtime.w.
    - Other runtime library files are updated with comments, and examples
      are updated as well.
    committed Nov 6, 2011
  2. Improve example makefiles

    - Makefiles now use -o options for both Tungsten and LLVM tools,
      rather than using shell output redirection.
    - If any tool encounters an error, its output file is deleted. The
      next time make is run, it will rebuild that file instead of assuming
      it was successfully created earlier.
    committed Nov 6, 2011
  3. Better error handling for Converter

    - Added handleInputErrors and handleOutputErrors, which act as generic
      exception handlers. This replaces several redundtant try-catch
      blocks.
    - Added a -o/--output option for explicitly naming output files.
    committed Nov 6, 2011
  4. LLVM: translate FunctionType to pointer to function type

    - LLVM does not allow plain function types to be used for values or
      fields of structs. Tungsten function types are more similar to LLVM
      pointers to functions.
    - This change adds TungstenToLlvmConverter.convertFunctionType, which
      implements the old behavior. convertType wraps the result in a
      pointer type.
    - StaticCallInstruction is the only thing that needs a raw function
      type.
    committed Nov 6, 2011
Commits on Nov 2, 2011
  1. Improve TextModuleWriter simplification of complex symbols

    - Added Symbol.withoutPrefix. This returns a symbol removing the
      leading components of the receiver's name if they match the given
      prefix symbol's name. For example, if you have the symbol
      a.b.c.d#12, and you call withoutPrefix with a.b#34, you will get
      Some(c.d#12). None is returned if the prefix is not matched or if
      the prefix has the same name as the receiver.
    - TextModuleWriter.localSymbol now uses this to simplify symbols.
    committed Nov 2, 2011
  2. Fix TextModuleWriter simplification of catch block symbols

    - TextModuleWriter incorrectly uses the function name as the parent
      symbol for catch block symbols in Blocks. As a result, w-dis
      produces code which cannot be assembled by w-as.
    - This changes the parent symbol to be the name of the Block.
    committed Nov 2, 2011