WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

Commit 84b36002 authored by Stefan Marr's avatar Stefan Marr
Browse files

Changed jitdriver to have one for float and one for int limits



- and correct debug output for merge points
Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent b31bfdc0
......@@ -4,17 +4,17 @@ from som.vmobjects.block import block_evaluate
from rpython.rlib import jit
def get_printable_location(interpreter, method_body, method_condition, while_type):
from som.vmobjects.method import Method
from som.interpreter.bytecodes import bytecode_as_str
assert isinstance(method_body, Method)
assert isinstance(method_condition, Method)
#bc = method.get_bytecode(bytecode_index)
# return "%s @ %d in %s" % (bytecode_as_str(bc),
# bytecode_index,
# method.merge_point_string())
return "TODO"
return "[%s>>%s] while [%s>>%s]" % (method_condition.get_holder().get_name().get_string(),
method_condition.get_signature().get_string(),
method_body.get_holder().get_name().get_string(),
method_body.get_signature().get_string())
jitdriver = jit.JitDriver(
greens=['interpreter', 'method_body', 'method_condition', 'while_type'],
......
......@@ -241,15 +241,54 @@ from rpython.rlib import jit
def get_printable_location(interpreter, block_method):
from som.vmobjects.method import Method
assert isinstance(block_method, Method)
return "TODO"
return "to:do: [%s>>%s]" % (block_method.get_holder().get_name().get_string(),
block_method.get_signature().get_string())
jitdriver = jit.JitDriver(
jitdriver_int = jit.JitDriver(
greens=['interpreter', 'block_method'],
reds='auto',
# virtualizables=['frame'],
get_printable_location=get_printable_location)
jitdriver_double = jit.JitDriver(
greens=['interpreter', 'block_method'],
reds='auto',
# virtualizables=['frame'],
get_printable_location=get_printable_location)
def _toDoInt(i, top, frame, context, interpreter, block_method, universe):
assert isinstance(i, int)
assert isinstance(top, int)
while i <= top:
jitdriver_int.jit_merge_point(interpreter=interpreter,
block_method=block_method)
b = universe.new_block(block_method, context)
frame.push(b)
frame.push(universe.new_integer(i))
block_evaluate(b, interpreter, frame)
frame.pop()
i += 1
def _toDoDouble(i, top, frame, context, interpreter, block_method, universe):
assert isinstance(i, int)
assert isinstance(top, float)
while i <= top:
jitdriver_double.jit_merge_point(interpreter=interpreter,
block_method=block_method)
b = universe.new_block(block_method, context)
frame.push(b)
frame.push(universe.new_integer(i))
block_evaluate(b, interpreter, frame)
frame.pop()
i += 1
def _toDo(ivkbl, frame, interpreter):
universe = interpreter.get_universe()
block = frame.pop()
......@@ -261,22 +300,15 @@ def _toDo(ivkbl, frame, interpreter):
i = self.get_embedded_integer()
if isinstance(limit, Double):
top = limit.get_embedded_double()
_toDoDouble(i, limit.get_embedded_double(), frame, context, interpreter,
block_method, universe)
else:
top = limit.get_embedded_value()
while i <= top:
jitdriver.jit_merge_point(interpreter=interpreter,
block_method=block_method)
b = universe.new_block(block_method, context)
frame.push(b)
frame.push(universe.new_integer(i))
block_evaluate(b, interpreter, frame)
frame.pop()
i += 1
_toDoInt(i, limit.get_embedded_value(), frame, context, interpreter,
block_method, universe)
frame.push(self)
class IntegerPrimitives(Primitives):
def install_primitives(self):
......
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