Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: rdict-fast-hash
Changeset: r93369:abf782e86675
Date: 2017-12-11 18:22 +0100
http://bitbucket.org/pypy/pypy/changeset/abf782e86675/
Log: fix iter*_with_hash
diff --git a/rpython/rtyper/rdict.py b/rpython/rtyper/rdict.py
--- a/rpython/rtyper/rdict.py
+++ b/rpython/rtyper/rdict.py
@@ -90,7 +90,7 @@
resulttype=ENTRIES)
# call the correct variant_*() method
method = getattr(self, 'variant_' + self.variant)
- return method(hop, ENTRIES, v_entries, v_index)
+ return method(hop, ENTRIES, v_entries, v_dict, v_index)
def get_tuple_result(self, hop, items_v):
# this allocates the tuple for the result, directly in the function
@@ -110,7 +110,7 @@
hop.genop('setfield', [v_result, c_item, v_item])
return v_result
- def variant_keys(self, hop, ENTRIES, v_entries, v_index):
+ def variant_keys(self, hop, ENTRIES, v_entries, v_dict, v_index):
KEY = ENTRIES.TO.OF.key
c_key = hop.inputconst(lltype.Void, 'key')
v_key = hop.genop('getinteriorfield', [v_entries, v_index, c_key],
@@ -119,30 +119,30 @@
variant_reversed = variant_keys
- def variant_values(self, hop, ENTRIES, v_entries, v_index):
+ def variant_values(self, hop, ENTRIES, v_entries, v_dict, v_index):
VALUE = ENTRIES.TO.OF.value
c_value = hop.inputconst(lltype.Void, 'value')
v_value = hop.genop('getinteriorfield', [v_entries,v_index,c_value],
resulttype=VALUE)
return self.r_dict.recast_value(hop.llops, v_value)
- def variant_items(self, hop, ENTRIES, v_entries, v_index):
- v_key = self.variant_keys(hop, ENTRIES, v_entries, v_index)
- v_value = self.variant_values(hop, ENTRIES, v_entries, v_index)
+ def variant_items(self, hop, ENTRIES, v_entries, v_dict, v_index):
+ v_key = self.variant_keys(hop, ENTRIES, v_entries, v_dict, v_index)
+ v_value = self.variant_values(hop, ENTRIES, v_entries, v_dict, v_index)
return self.get_tuple_result(hop, (v_key, v_value))
- def variant_hashes(self, hop, ENTRIES, v_entries, v_index):
+ def variant_hashes(self, hop, ENTRIES, v_entries, v_dict, v_index):
# there is not really a variant 'hashes', but this method is
# convenient for the following variants
- return hop.gendirectcall(ENTRIES.TO.hash, v_entries, v_index)
+ return hop.gendirectcall(ENTRIES.TO.entry_hash, v_entries, v_dict,
v_index)
- def variant_keys_with_hash(self, hop, ENTRIES, v_entries, v_index):
- v_key = self.variant_keys(hop, ENTRIES, v_entries, v_index)
- v_hash = self.variant_hashes(hop, ENTRIES, v_entries, v_index)
+ def variant_keys_with_hash(self, hop, ENTRIES, v_entries, v_dict, v_index):
+ v_key = self.variant_keys(hop, ENTRIES, v_entries, v_dict, v_index)
+ v_hash = self.variant_hashes(hop, ENTRIES, v_entries, v_dict, v_index)
return self.get_tuple_result(hop, (v_key, v_hash))
- def variant_items_with_hash(self, hop, ENTRIES, v_entries, v_index):
- v_key = self.variant_keys(hop, ENTRIES, v_entries, v_index)
- v_value = self.variant_values(hop, ENTRIES, v_entries, v_index)
- v_hash = self.variant_hashes(hop, ENTRIES, v_entries, v_index)
+ def variant_items_with_hash(self, hop, ENTRIES, v_entries, v_dict,
v_index):
+ v_key = self.variant_keys(hop, ENTRIES, v_entries, v_dict, v_index)
+ v_value = self.variant_values(hop, ENTRIES, v_entries, v_dict, v_index)
+ v_hash = self.variant_hashes(hop, ENTRIES, v_entries, v_dict, v_index)
return self.get_tuple_result(hop, (v_key, v_value, v_hash))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit