|
@@ -452,15 +452,21 @@ class ModelverseKernel(object):
|
|
|
self.jit.register_compiled(inst, compiled_func, suggested_name)
|
|
|
|
|
|
# Run the compiled function.
|
|
|
- results = yield [("CALL_KWARGS", [compiled_func, params])]
|
|
|
- if results is None:
|
|
|
- raise Exception("%s: primitive finished without returning a value!" % (self.debug_info[taskname]))
|
|
|
+ if compiled_func == primitive_functions.dict_read:
|
|
|
+ a = params['a']
|
|
|
+ b = params['b']
|
|
|
+ if "value" not in b:
|
|
|
+ b['value'], = yield [("RV", [b['id']])]
|
|
|
+ result, = yield [("RD", [a['id'], b['value']])]
|
|
|
+ result = {'id': result}
|
|
|
else:
|
|
|
- result, = results
|
|
|
-
|
|
|
- #print("Got result: " + str(result))
|
|
|
- if result is None:
|
|
|
- result = {'id': None, 'value': None}
|
|
|
+ results = yield [("CALL_KWARGS", [compiled_func, params])]
|
|
|
+ if results is None:
|
|
|
+ raise Exception("%s: primitive finished without returning a value!" % (self.debug_info[taskname]))
|
|
|
+ else:
|
|
|
+ result, = results
|
|
|
+ if result is None:
|
|
|
+ result = {'id': None, 'value': None}
|
|
|
|
|
|
if store:
|
|
|
# Clean up the current stack, as if a return happened
|