<commit_before>##
# This is the beginning of loading Ruby code. At this point, the VM
# is bootstrapped and the fundamental data structures and primitive
# functions are available.
#
# The classes, modules, and methods defined here provide basic
# functionality for loading the bootstrap directory. By the end of
# this file, the following methods are functioal:
#
#   attr_reader :sym
#   attr_writer :sym
#   attr_accessor :sym
#   private :sym
#   protected :sym
#   module_function :sym
#
# These forms should be used in the rest of the kernel. In delta,
# more complete forms of these methods are provided

def opened_class(created)
end

class Rubinius::VM
  def self.write_error(str)
    Ruby.primitive :vm_write_error
    raise PrimitiveFailure, "Rubinius::VM.write_error primitive failed"
  end

  def self.show_backtrace
    Ruby.primitive :vm_show_backtrace
    raise PrimitiveFailure, "Rubinius::VM.show_backtrace primitive failed"
  end

  def self.reset_method_cache(sym)
    Ruby.primitive :vm_reset_method_cache
    raise PrimitiveFailure, "Rubinius::VM.reset_method_cache primitive failed"
  end
end

class Object
  def __show__
    Ruby.primitive :object_show
  end
end

class Class
  def allocate
    Ruby.primitive :class_allocate
    raise RuntimeError, "Class#allocate primitive failed on #{self.inspect}"
  end

  def new(*args)
    obj = allocate()

    Rubinius.asm(args, obj) do |args, obj|
      run obj
      run args
      push_block
      send_with_splat :initialize, 0, true
      # no pop here, as .asm blocks imply a pop as they're not
      # allowed to leak a stack value
    end

    return obj
  end
end

module Kernel
  def __send__(*args)
    Ruby.primitive :object_send
    raise RuntimeError, "Kernel#__send__ primitive failed"
  end

  def class
    Ruby.primitive :object_class
    raise PrimitiveFailure, "Kernel#class primitive failed."
  end

  def to_s
    "#<#{self.class.name}>"
  end

  def raise(cls, str, junk=nil)
    Rubinius::VM.write_error "Fatal error loading runtime kernel:\n  "
    Rubinius::VM.write_error str
    Rubinius::VM.write_error "\n"
    Rubinius::VM.show_backtrace nil
    Process.exit 1
  end<commit_msg>Fix args to show_backtrace<commit_after>##
# This is the beginning of loading Ruby code. At this point, the VM
# is bootstrapped and the fundamental data structures and primitive
# functions are available.
#
# The classes, modules, and methods defined here provide basic
# functionality for loading the bootstrap directory. By the end of
# this file, the following methods are functioal:
#
#   attr_reader :sym
#   attr_writer :sym
#   attr_accessor :sym
#   private :sym
#   protected :sym
#   module_function :sym
#
# These forms should be used in the rest of the kernel. In delta,
# more complete forms of these methods are provided

def opened_class(created)
end

class Rubinius::VM
  def self.write_error(str)
    Ruby.primitive :vm_write_error
    raise PrimitiveFailure, "Rubinius::VM.write_error primitive failed"
  end

  def self.show_backtrace
    Ruby.primitive :vm_show_backtrace
    raise PrimitiveFailure, "Rubinius::VM.show_backtrace primitive failed"
  end

  def self.reset_method_cache(sym)
    Ruby.primitive :vm_reset_method_cache
    raise PrimitiveFailure, "Rubinius::VM.reset_method_cache primitive failed"
  end
end

class Object
  def __show__
    Ruby.primitive :object_show
  end
end

class Class
  def allocate
    Ruby.primitive :class_allocate
    raise RuntimeError, "Class#allocate primitive failed on #{self.inspect}"
  end

  def new(*args)
    obj = allocate()

    Rubinius.asm(args, obj) do |args, obj|
      run obj
      run args
      push_block
      send_with_splat :initialize, 0, true
      # no pop here, as .asm blocks imply a pop as they're not
      # allowed to leak a stack value
    end

    return obj
  end
end

module Kernel
  def __send__(*args)
    Ruby.primitive :object_send
    raise RuntimeError, "Kernel#__send__ primitive failed"
  end

  def class
    Ruby.primitive :object_class
    raise PrimitiveFailure, "Kernel#class primitive failed."
  end

  def to_s
    "#<#{self.class.name}>"
  end

  def raise(cls, str, junk=nil)
    Rubinius::VM.write_error "Fatal error loading runtime kernel:\n  "
    Rubinius::VM.write_error str
    Rubinius::VM.write_error "\n"
    Rubinius::VM.show_backtrace
    Process.exit 1
  end
{'fraction_non_alphanumeric': 0.07200183444164182, 'fraction_numerical': 0.0009172208209126347, 'mean_word_length': 3.596417281348788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6461771', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1341, 'n_words': 459}