Skip to content

Commit f748de0

Browse files
committed
use nqp::where in SerializationContextBuilder
1 parent 15be997 commit f748de0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/HLL/SerializationContextBuilder.pm

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class HLL::Compiler::SerializationContextBuilder {
4747
# Address => slot mapping, so we can quickly look up existing objects
4848
# in the context.
4949
has %!addr_to_slot;
50-
sub addr($obj) {
51-
pir::get_id__IP($obj)
52-
}
5350

5451
# The event stream that builds or fixes up objects.
5552
has @!event_stream;
@@ -77,7 +74,7 @@ class HLL::Compiler::SerializationContextBuilder {
7774

7875
# Gets the slot for a given object. Dies if it is not in the context.
7976
method slot_for_object($obj) {
80-
my $slot := %!addr_to_slot{addr($obj)};
77+
my $slot := %!addr_to_slot{nqp::where($obj)};
8178
unless pir::defined($slot) {
8279
pir::die('slot_for_object called on object not in context');
8380
}
@@ -126,15 +123,15 @@ class HLL::Compiler::SerializationContextBuilder {
126123
pir::nqp_set_sc_for_object__vPP($obj, $!sc);
127124
my $idx := $!sc.elems();
128125
$!sc[$idx] := $obj;
129-
%!addr_to_slot{addr($obj)} := $idx;
126+
%!addr_to_slot{nqp::where($obj)} := $idx;
130127
$idx
131128
}
132129

133130
# Adds a code ref to the root set, along with a mapping.
134131
method add_code($obj) {
135132
my $idx := $!sc.elems();
136133
$!sc[$idx] := $obj;
137-
%!addr_to_slot{addr($obj)} := $idx;
134+
%!addr_to_slot{nqp::where($obj)} := $idx;
138135
$idx
139136
}
140137

0 commit comments

Comments
 (0)