diff options
author | Carl Friedrich Bolz-Tereick <cfbolz@gmx.de> | 2023-05-30 21:01:11 +0200 |
---|---|---|
committer | Carl Friedrich Bolz-Tereick <cfbolz@gmx.de> | 2023-05-30 21:01:11 +0200 |
commit | 9bf21212003e0ef117f694e78278cc1d1f2fae4c (patch) | |
tree | 6feaba2e0f81e68fc85c8f6929449e8ebf91e1b6 | |
parent | add the value to the *FrontendOp constructors (diff) | |
download | pypy-9bf21212003e0ef117f694e78278cc1d1f2fae4c.tar.gz pypy-9bf21212003e0ef117f694e78278cc1d1f2fae4c.tar.bz2 pypy-9bf21212003e0ef117f694e78278cc1d1f2fae4c.zip |
fix virtualizables maybe
-rw-r--r-- | rpython/jit/metainterp/pyjitpl.py | 7 | ||||
-rw-r--r-- | rpython/jit/metainterp/virtualizable.py | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/rpython/jit/metainterp/pyjitpl.py b/rpython/jit/metainterp/pyjitpl.py index d614c0e6ac..9b58963c34 100644 --- a/rpython/jit/metainterp/pyjitpl.py +++ b/rpython/jit/metainterp/pyjitpl.py @@ -3162,8 +3162,10 @@ class MetaInterp(object): vinfo.clear_vable_token(virtualizable) # The field 'virtualizable_boxes' is not even present # if 'virtualizable_info' is None. Check for that first. + startindex = len(original_boxes) - self.jitdriver_sd.num_green_args self.virtualizable_boxes = vinfo.read_boxes(self.cpu, - virtualizable) + virtualizable, + startindex) original_boxes += self.virtualizable_boxes self.virtualizable_boxes.append(virtualizable_box) self.check_synchronized_virtualizable() @@ -3320,7 +3322,8 @@ class MetaInterp(object): virtualizable_box = self.virtualizable_boxes[-1] virtualizable = vinfo.unwrap_virtualizable_box(virtualizable_box) self.virtualizable_boxes = vinfo.read_boxes(self.cpu, - virtualizable) + virtualizable, + 0) self.virtualizable_boxes.append(virtualizable_box) def gen_store_back_in_vable(self, box): diff --git a/rpython/jit/metainterp/virtualizable.py b/rpython/jit/metainterp/virtualizable.py index 535c11e89a..8c57f0ae28 100644 --- a/rpython/jit/metainterp/virtualizable.py +++ b/rpython/jit/metainterp/virtualizable.py @@ -83,17 +83,18 @@ class VirtualizableInfo(object): self.array_field_by_descrs = dict( [(descr, i) for (i, descr) in enumerate(self.array_field_descrs)]) - def read_boxes(cpu, virtualizable): + def read_boxes(cpu, virtualizable, startindex): assert lltype.typeOf(virtualizable) == llmemory.GCREF virtualizable = cast_gcref_to_vtype(virtualizable) boxes = [] for _, fieldname in unroll_static_fields: x = getattr(virtualizable, fieldname) - boxes.append(wrap(cpu, x)) + boxes.append(wrap(cpu, x, startindex)) + startindex += 1 for _, fieldname in unroll_array_fields: lst = getattr(virtualizable, fieldname) for i in range(len(lst)): - boxes.append(wrap(cpu, lst[i])) + boxes.append(wrap(cpu, lst[i], startindex + i)) return boxes def write_boxes(virtualizable, boxes): |