Skip to content
Permalink
Browse files

Remove unused %opts argument from Perl6::World::load_module_early

When load_module_early was split off load_module, we retained the %opts
argument despite the only caller always passing an empty hash. Remove it
to get rid of some dead code that could cause the reader to believe that
we actually still compile in hash order somewhere.
  • Loading branch information...
niner committed May 1, 2019
1 parent 2d4d2ca commit bc764c2e8be2c9c6ce106fe16a6fde6eebaf0c19
Showing with 4 additions and 16 deletions.
  1. +4 −16 src/Perl6/World.nqp
@@ -682,7 +682,7 @@ class Perl6::World is HLL::World {
# Bootstrap
if $setting_name eq 'NULL' {
my $name := "Perl6::BOOTSTRAP";
my $module := self.load_module_early($/, $name, {}, $*GLOBALish);
my $module := self.load_module_early($/, $name, $*GLOBALish);
my $EXPORT := $module<EXPORT>.WHO;
my @to_import := ['MANDATORY', 'DEFAULT'];
for @to_import -> $tag {
@@ -1341,38 +1341,26 @@ class Perl6::World is HLL::World {

# Loads a module immediately, and also makes sure we load it
# during the deserialization.
method load_module_early($/, $module_name, %opts, $cur_GLOBALish) {
method load_module_early($/, $module_name, $cur_GLOBALish) {
my $RMD := self.RAKUDO_MODULE_DEBUG;
$RMD(" Early loading '$module_name'") if $RMD;

# Immediate loading.
my $line := self.current_line($/);
my $module := nqp::gethllsym('perl6', 'ModuleLoader').load_module($module_name, %opts,
my $module := nqp::gethllsym('perl6', 'ModuleLoader').load_module($module_name, {},
$cur_GLOBALish, :$line);

# During deserialization, ensure that we get this module loaded.
if self.is_precompilation_mode() {
$RMD(" Pre-compiling '$module_name'") if $RMD;
my $opt_hash := QAST::Op.new( :op('hash') );
for %opts {
self.add_object_if_no_sc($_.value);
$opt_hash.push(QAST::SVal.new( :value($_.key) ));
my $Str := self.find_symbol(['Str'], :setting-only);
if nqp::isstr($_.value) || nqp::istype($_.value, $Str) {
$opt_hash.push(QAST::SVal.new( :value($_.value) ));
}
else {
$opt_hash.push(QAST::WVal.new( :value($_.value) ));
}
}
self.add_load_dependency_task(:deserialize_ast(QAST::Stmts.new(
self.perl6_module_loader_code(),
QAST::Op.new(
:op('callmethod'), :name('load_module'),
QAST::Op.new( :op('getcurhllsym'),
QAST::SVal.new( :value('ModuleLoader') ) ),
QAST::SVal.new( :value($module_name) ),
$opt_hash,
QAST::Op.new( :op('hash') ),
QAST::IVal.new(:value($line), :named('line'))
))));
}

0 comments on commit bc764c2

Please sign in to comment.
You can’t perform that action at this time.