Commit 920240b8 authored by Tobias Pape's avatar Tobias Pape Committed by Stefan Marr

hash() is not rpython

parent 3b0cd388
......@@ -9,7 +9,7 @@ import math
def _push_long_result(frame, result, universe):
# Check with integer bounds and push:
if integer_value_fits(result):
frame.push(universe.new_integer(result))
frame.push(universe.new_integer(int(result)))
else:
frame.push(universe.new_biginteger(result))
......
from rpython.rlib.objectmodel import compute_identity_hash
from som.primitives.primitives import Primitives
from som.vmobjects.primitive import Primitive
......@@ -13,7 +15,8 @@ def _equals(ivkbl, frame, interpreter):
def _hashcode(ivkbl, frame, interpreter):
rcvr = frame.pop()
frame.push(interpreter.get_universe().new_integer(hash(rcvr)))
frame.push(interpreter.get_universe().new_integer(
compute_identity_hash(rcvr)))
def _objectSize(ivkbl, frame, interpreter):
rcvr = frame.pop()
......
from rpython.rlib.objectmodel import compute_identity_hash
from som.primitives.primitives import Primitives
from som.vmobjects.primitive import Primitive
......@@ -40,7 +42,8 @@ def _substring(ivkbl, frame, interpreter):
def _hashcode(ivkbl, frame, interpreter):
rcvr = frame.pop()
frame.push(interpreter.get_universe().new_integer(hash(rcvr.get_embedded_string())))
frame.push(interpreter.universe().new_integer(
compute_identity_hash(rcvr.get_embedded_string())))
class StringPrimitives(Primitives):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment