1. # Stub a few things the compiler wants to have really early on.
  2. my class Pair { ... } # must be first for some reason
  3. my class Block { ... }
  4. my class HyperWhatever { ... }
  5. my class List { ... }
  6. my class Map { ... }
  7. my class Match { ... }
  8. my class Failure { ... }
  9. my class Rakudo::Internals { ... }
  10. my class Rakudo::Internals::JSON { ... }
  11. my class Rakudo::Iterator { ... }
  12. my class ThreadPoolScheduler { ... }
  13. my class Whatever { ... }
  14. my class WhateverCode { ... }
  15. my class X::Attribute::Required { ... }
  16. my class X::Numeric::Overflow { ... }
  17. my class X::Numeric::Underflow { ... }
  18. # Stub these or we can't use any sigil other than $.
  19. my role Positional { ... }
  20. my role Associative { ... }
  21. my role Callable { ... }
  22. my role Iterable { ... }
  23. my role PositionalBindFailover { ... }
  24. # Set up Empty, which is a Slip created with an empty IterationBuffer (which
  25. # we also stub here). This is needed in a bunch of simple constructs (like if
  26. # with only one branch).
  27. my class IterationBuffer is repr('VMArray') { ... }
  28. my constant Empty = nqp::p6bindattrinvres(nqp::create(Slip),
  29. List, '$!reified', nqp::create(IterationBuffer));
  30. # We use a sentinel value to mark the end of an iteration.
  31. my constant IterationEnd = nqp::create(Mu);
  32. # To allow passing of nqp::hash without being HLLized, we create a HLL class
  33. # with the same low level REPR as nqp::hash.
  34. my class Rakudo::Internals::IterationSet is repr('VMHash') { }
  35. # The value for \n.
  36. my constant $?NL = "\x0A";
  37. # Make sure we have an environment
  38. PROCESS::<%ENV> := Rakudo::Internals.createENV(0);
  39. # This thread pool scheduler will be the default one.
  40. PROCESS::<$SCHEDULER> = ThreadPoolScheduler.new();