|
1 | 1 | package org.perl6.nqp.sixmodel.reprs;
|
2 | 2 |
|
3 | 3 | import org.perl6.nqp.runtime.CallSiteDescriptor;
|
| 4 | +import org.perl6.nqp.runtime.Ops; |
| 5 | +import org.perl6.nqp.runtime.ThreadContext; |
4 | 6 | import org.perl6.nqp.sixmodel.SixModelObject;
|
5 | 7 | import org.perl6.nqp.sixmodel.TypeObject;
|
6 | 8 |
|
@@ -34,7 +36,7 @@ private class ArityCache
|
34 | 36 | public SixModelObject[] results;
|
35 | 37 | }
|
36 | 38 |
|
37 |
| - public void add(CallCaptureInstance capture, SixModelObject result) { |
| 39 | + public void add(CallCaptureInstance capture, SixModelObject result, ThreadContext tc) { |
38 | 40 | /* If there's flattenings, we can't cache. */
|
39 | 41 | if (capture.descriptor.hasFlattening)
|
40 | 42 | return;
|
@@ -71,7 +73,7 @@ public void add(CallCaptureInstance capture, SixModelObject result) {
|
71 | 73 | case CallSiteDescriptor.ARG_OBJ:
|
72 | 74 | if (numArgs >= MD_CACHE_MAX_ARITY)
|
73 | 75 | return;
|
74 |
| - long flag = ((long)((SixModelObject)args[i]).st.hashCode()) << 1; |
| 76 | + long flag = ((long)Ops.decont((SixModelObject)args[i], tc).st.hashCode()) << 1; |
75 | 77 | if (!(args[i] instanceof TypeObject))
|
76 | 78 | flag |= 1;
|
77 | 79 | argTup[numArgs++] = flag;
|
@@ -107,7 +109,7 @@ public void add(CallCaptureInstance capture, SixModelObject result) {
|
107 | 109 | ac.numEntries++;
|
108 | 110 | }
|
109 | 111 |
|
110 |
| - public SixModelObject lookup(CallCaptureInstance capture) { |
| 112 | + public SixModelObject lookup(CallCaptureInstance capture, ThreadContext tc) { |
111 | 113 | /* If there's flattenings, we can't use the cache. */
|
112 | 114 | if (capture.descriptor.hasFlattening)
|
113 | 115 | return null;
|
@@ -138,7 +140,7 @@ public SixModelObject lookup(CallCaptureInstance capture) {
|
138 | 140 | case CallSiteDescriptor.ARG_OBJ:
|
139 | 141 | if (numArgs >= MD_CACHE_MAX_ARITY)
|
140 | 142 | return null;
|
141 |
| - long flag = ((long)((SixModelObject)args[i]).st.hashCode()) << 1; |
| 143 | + long flag = ((long)Ops.decont((SixModelObject)args[i], tc).st.hashCode()) << 1; |
142 | 144 | if (!(args[i] instanceof TypeObject))
|
143 | 145 | flag |= 1;
|
144 | 146 | argTup[numArgs++] = flag;
|
|
0 commit comments