From bed2621fb7d53939bc9777750b71becbfbdac32a Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Sun, 8 May 2016 10:15:45 +0200 Subject: [PATCH] Implement CompUnit::Loader.load-precompilation Needs an NQP bump --- src/core/CompUnit/Loader.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/CompUnit/Loader.pm b/src/core/CompUnit/Loader.pm index e09b755f54e..b599dd2e66b 100644 --- a/src/core/CompUnit/Loader.pm +++ b/src/core/CompUnit/Loader.pm @@ -41,7 +41,11 @@ class CompUnit::Loader is repr('Uninstantiable') { # Load the specified byte buffer as if it was the contents of a # precompiled file method load-precompilation(Buf:D $bytes) returns CompUnit::Handle { - ... # XXX this one needs MoarVM/JVM backends to expose a new API + my $*CTXSAVE := self; + my %*COMPILING := nqp::hash(); + my Mu $*MAIN_CTX; + nqp::loadbytecodebuffer($bytes); + CompUnit::Handle.new($*MAIN_CTX) } method ctxsave() {