Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/ChangeLog  view on Meta::CPAN


2004-06-14  Rhys Weatherley  <rweather@southern-storm.com.au>

	* dpas/dpas-internal.h, dpas/dpas-parser.y, dpas/dpas-scanner.l,
	jit/jit-rules-x86.c, jit/jit-rules-x86.sel, tests/Makefile.am,
	tests/param.pas, tools/gen-apply.c: add some test cases for
	parameter passing; fix fastcall/stdcall conventions for x86.

	* jit/jit-rules-arm.h, jit/jit-rules-arm.sel, jit/jit-rules-x86.h,
	jit/jit-rules-x86.sel, tools/gen-sel-parser.y: enable register
	allocation for 64-bit values under x86 and ARM; expand some
	64-bit opcodes in the instruction selectors.

2004-06-12  Rhys Weatherley  <rweather@southern-storm.com.au>

	* jit/jit-insn.c, jit/jit-rules-x86.c, jit/jit-rules-x86.sel:
	implement or stub missing x86 instruction selection rules.

	* include/jit/jit-insn.h, include/jit/jit-opcode.h,
	include/jit/jit-plus.h, jit/jit-function.c, jit/jit-insn.c,
	jit/jit-interp.c, jit/jit-opcode.c, jit/jit-rules-interp.c,

libjit/ChangeLog  view on Meta::CPAN

	it should return NaN instead.

	* jit/jit-value.c: fix a warning.

	* configure.in, jit/jit-insn.c: use "sigsetjmp" instead of
	"setjmp", because "setjmp" may be a macro on some systems.

	* jit-gen-arm.h: add floating-point instruction macros.

	* jit/jit-gen-arm.h, jit/jit-rules-arm.c, jit/jit-rules-arm.h,
	jit/jit-rules-arm.sel: expand floating-point instructions for ARM.

	* jit/jit-rules-x86.c: fix misnaming of jit_type_get_abi,
	jit_abi_stdcall, and jit_abi_fastcall.

	* tools/gen-apply-macosx.h, tools/gen-apply.c: bypass the
	auto-detection logic in gen-apply under MacOSX because
	it doesn't work with Apple's version of gcc.

	* tools/gen-apply.c: gen-apply fix for ia64.

libjit/dpas/dpas-builtin.c  view on Meta::CPAN

	for(index = 0; index < num_builtins; ++index)
	{
		if(!jit_stricmp(name, builtins[index].name))
		{
			return builtins[index].identifier;
		}
	}
	return 0;
}

dpas_semvalue dpas_expand_builtin
	(int identifier, dpas_semvalue *args, int num_args)
{
	int index;
	dpas_semvalue value;
	for(index = 0; index < num_builtins; ++index)
	{
		if(builtins[index].identifier == identifier)
		{
			if(builtins[index].num_args != -1 &&
			   builtins[index].num_args != num_args)

libjit/dpas/dpas-internal.h  view on Meta::CPAN


/*
 * Determine if a name corresponds to a builtin function,
 * and get its builtin identifier.  Returns zero if not a builtin.
 */
int dpas_is_builtin(const char *name);

/*
 * Expand a builtin function reference.
 */
dpas_semvalue dpas_expand_builtin
	(int identifier, dpas_semvalue *args, int num_args);

/*
 * Add the current function to the execution list.  Used for
 * "main" functions within each compiled module.
 */
void dpas_add_main_function(jit_function_t func);

/*
 * Run the "main" functions in the order in which they were compiled.

libjit/dpas/dpas-parser.y  view on Meta::CPAN

	| InnerStatement
	;

InnerStatement
	: AssignmentStatement			{ /* Nothing to do here */ }
	| Variable ActualParameters		{
				/* Call a procedure or an ignored-result function */
				if(dpas_sem_is_builtin($1))
				{
					/* Expand a call to a builtin procedure */
					dpas_expand_builtin
						(dpas_sem_get_builtin($1), $2.exprs, $2.len);
				}
				else if(dpas_sem_is_procedure($1))
				{
					/* Invoke a user-defined procedure */
					dpas_scope_item_t item = dpas_sem_get_procedure($1);
					invoke_procedure
						((jit_function_t)dpas_scope_item_info(item),
						 dpas_scope_item_name(item),
						 dpas_scope_item_type(item), 0, $2.exprs, $2.len);

libjit/dpas/dpas-parser.y  view on Meta::CPAN

					}
					dpas_sem_set_error($$);
				}
			}
	| '(' Expression ')'			{ $$ = $2; }
	| Variable '(' ExpressionList ')'		{
				/* Call a function, with no ignored result */
				if(dpas_sem_is_builtin($1))
				{
					/* Expand a call to a builtin procedure */
					$$ = dpas_expand_builtin
						(dpas_sem_get_builtin($1), $3.exprs, $3.len);
				}
				else if(dpas_sem_is_procedure($1))
				{
					/* Invoke a user-defined function */
					dpas_scope_item_t item = dpas_sem_get_procedure($1);
					$$ = invoke_procedure
						((jit_function_t)dpas_scope_item_info(item),
						 dpas_scope_item_name(item),
						 dpas_scope_item_type(item), 0, $3.exprs, $3.len);

libjit/jit/jit-opcodes.ops  view on Meta::CPAN

	op_def("trunc_uint") { op_values(int, int),
			       op_intrinsic(conv) }
	op_def("check_sbyte") { op_values(int, int) }
	op_def("check_ubyte") { op_values(int, int) }
	op_def("check_short") { op_values(int, int) }
	op_def("check_ushort") { op_values(int, int) }
	op_def("check_int") { op_values(int, int) }
	op_def("check_uint") { op_values(int, int) }
	op_def("low_word") { op_values(int, long),
			     op_intrinsic(conv) }
	op_def("expand_int") { op_values(long, int),
			       op_intrinsic(conv) }
	op_def("expand_uint") { op_values(long, int),
				op_intrinsic(conv) }
	op_def("check_low_word") { op_values(int, long) }
	op_def("check_signed_low_word") { op_values(int, long) }
	op_def("check_long") { op_values(long, long) }
	op_def("check_ulong") { op_values(long, long) }
	op_def("float32_to_int") { op_values(int, float32),
				   op_intrinsic(conv) }
	op_def("float32_to_uint") { op_values(int, float32),
				    op_intrinsic(conv) }
	op_def("float32_to_long") { op_values(long, float32),

libjit/jitdynamic/jit-dynlib.c  view on Meta::CPAN

#elif defined(JIT_WIN32_PLATFORM)	/* Native Win32 or Cygwin */

jit_dynlib_handle_t jit_dynlib_open(const char *name)
{
	void *libHandle;
	char *newName = 0;

#if defined(JIT_WIN32_CYGWIN) && defined(HAVE_SYS_CYGWIN_H) && \
    defined(HAVE_CYGWIN_CONV_TO_WIN32_PATH)

	/* Use Cygwin to expand the path */
	{
		char buf[4096];
		if(cygwin_conv_to_win32_path(name, buf) == 0)
		{
			newName = jit_strdup(buf);
			if(!newName)
			{
				return 0;
			}
		}

libjit/jitruby/setup.rb  view on Meta::CPAN


  class PathItem < Item
    def config_type
      'path'
    end

    private

    def check(path)
      setup_rb_error "config: --#{@name} requires argument"  unless path
      path[0,1] == '$' ? path : File.expand_path(path)
    end
  end

  class ProgramItem < Item
    def config_type
      'program'
    end
  end

  class SelectItem < Item

libjit/jitruby/setup.rb  view on Meta::CPAN

    end
  end

end   # class ConfigTable


# This module requires: #verbose?, #no_harm?
module FileOperations

  def mkdir_p(dirname, prefix = nil)
    dirname = prefix + File.expand_path(dirname) if prefix
    $stderr.puts "mkdir -p #{dirname}" if verbose?
    return if no_harm?

    # Does not check '/', it's too abnormal.
    dirs = File.expand_path(dirname).split(%r<(?=/)>)
    if /\A[a-z]:\z/i =~ dirs[0]
      disk = dirs.shift
      dirs[0] = disk + dirs[0]
    end
    dirs.each_index do |idx|
      path = dirs[0..idx].join('')
      Dir.mkdir path unless File.dir?(path)
    end
  end

libjit/jitruby/setup.rb  view on Meta::CPAN


  def remove_file(path)
    File.chmod 0777, path
    File.unlink path
  end

  def install(from, dest, mode, prefix = nil)
    $stderr.puts "install #{from} #{dest}" if verbose?
    return if no_harm?

    realdest = prefix ? prefix + File.expand_path(dest) : dest
    realdest = File.join(realdest, File.basename(from)) if File.dir?(realdest)
    str = File.binread(from)
    if diff?(str, realdest)
      verbose_off {
        rm_f realdest if File.exist?(realdest)
      }
      File.open(realdest, 'wb') {|f|
        f.write str
      }
      File.chmod mode, realdest

libjit/jitruby/setup.rb  view on Meta::CPAN

    klass.new(File.dirname($0), config).invoke
  end

  def ToplevelInstaller.multipackage?
    File.dir?(File.dirname($0) + '/packages')
  end

  def ToplevelInstaller.load_rbconfig
    if arg = ARGV.detect {|arg| /\A--rbconfig=/ =~ arg }
      ARGV.delete(arg)
      load File.expand_path(arg.split(/=/, 2)[1])
      $".push 'rbconfig.rb'
    else
      require 'rbconfig'
    end
    ::Config::CONFIG
  end

  def initialize(ardir_root, config)
    @ardir = File.expand_path(ardir_root)
    @config = config
    # cache
    @valid_task_re = nil
  end

  def config(key)
    @config[key]
  end

  def inspect

libjit/jitruby/setup.rb  view on Meta::CPAN

      init_installers
      __send__ "exec_#{task}"
    end
  end
  
  def run_metaconfigs
    @config.load_script "#{@ardir}/metaconfig"
  end

  def init_installers
    @installer = Installer.new(@config, @ardir, File.expand_path('.'))
  end

  #
  # Hook Script API bases
  #

  def srcdir_root
    @ardir
  end

libjit/jitruby/setup.rb  view on Meta::CPAN


  def parsearg_install
    @config.no_harm = false
    @config.install_prefix = ''
    while a = ARGV.shift
      case a
      when '--no-harm'
        @config.no_harm = true
      when /\A--prefix=/
        path = a.split(/=/, 2)[1]
        path = File.expand_path(path) unless path[0,1] == '/'
        @config.install_prefix = path
      else
        setup_rb_error "install: unknown option #{a}"
      end
    end
  end

  def print_usage(out)
    out.puts 'Typical Installation Procedure:'
    out.puts "  $ ruby #{File.basename $0} config"

libjit/jitruby/setup.rb  view on Meta::CPAN



class ToplevelInstallerMulti < ToplevelInstaller

  include FileOperations

  def initialize(ardir_root, config)
    super
    @packages = directories_of("#{@ardir}/packages")
    raise 'no package exists' if @packages.empty?
    @root_installer = Installer.new(@config, @ardir, File.expand_path('.'))
  end

  def run_metaconfigs
    @config.load_script "#{@ardir}/metaconfig", self
    @packages.each do |name|
      @config.load_script "#{@ardir}/packages/#{name}/metaconfig"
    end
  end

  attr_reader :packages

libjit/jitruby/setup.rb  view on Meta::CPAN


class Installer

  FILETYPES = %w( bin lib ext data conf man )

  include FileOperations
  include HookScriptAPI

  def initialize(config, srcroot, objroot)
    @config = config
    @srcdir = File.expand_path(srcroot)
    @objdir = File.expand_path(objroot)
    @currdir = '.'
  end

  def inspect
    "#<#{self.class} #{File.basename(@srcdir)}>"
  end

  def noop(rel)
  end



( run in 1.328 second using v1.01-cache-2.11-cpan-5b529ec07f3 )