|
@@ -62,7 +62,8 @@ def create_bare_function(function_name, parameter_list, function_body):
|
|
|
|
|
|
def create_function(
|
|
|
function_name, parameter_list, param_dict,
|
|
|
- body_param_dict, function_body, source_map_name=None):
|
|
|
+ body_param_dict, function_body, source_map_name=None,
|
|
|
+ compatible_temporary_protects=False):
|
|
|
"""Creates a function from the given function name, parameter list,
|
|
|
variable-to-parameter name map, variable-to-local name map and
|
|
|
function body. An optional source map can be included, too."""
|
|
@@ -101,7 +102,9 @@ def create_function(
|
|
|
|
|
|
# Shield temporaries from the GC.
|
|
|
constructed_body = tree_ir.protect_temporaries_from_gc(
|
|
|
- constructed_body, tree_ir.LoadLocalInstruction(jit_runtime.LOCALS_NODE_NAME))
|
|
|
+ constructed_body,
|
|
|
+ tree_ir.LoadLocalInstruction(jit_runtime.LOCALS_NODE_NAME),
|
|
|
+ compatible_temporary_protects)
|
|
|
|
|
|
return create_bare_function(function_name, parameter_list, constructed_body)
|
|
|
|
|
@@ -745,7 +748,9 @@ def compile_function_body_interpret(jit, function_name, body_id, task_root, head
|
|
|
jit.jit_globals[function_name] = __interpret_function
|
|
|
raise primitive_functions.PrimitiveFinished(__interpret_function)
|
|
|
|
|
|
-def compile_function_body_baseline(jit, function_name, body_id, task_root, header=None):
|
|
|
+def compile_function_body_baseline(
|
|
|
+ jit, function_name, body_id, task_root,
|
|
|
+ header=None, compatible_temporary_protects=False):
|
|
|
"""Have the baseline JIT compile the function with the given name and body id."""
|
|
|
(parameter_ids, parameter_list, _), = yield [
|
|
|
("CALL_ARGS", [jit.jit_signature, (body_id,)])]
|
|
@@ -766,7 +771,8 @@ def compile_function_body_baseline(jit, function_name, body_id, task_root, heade
|
|
|
# Wrap the tree IR in a function definition.
|
|
|
constructed_function = create_function(
|
|
|
function_name, parameter_list, param_dict,
|
|
|
- body_param_dict, constructed_body, jit.get_source_map_name(function_name))
|
|
|
+ body_param_dict, constructed_body, jit.get_source_map_name(function_name),
|
|
|
+ compatible_temporary_protects)
|
|
|
|
|
|
# Convert the function definition to Python code, and compile it.
|
|
|
raise primitive_functions.PrimitiveFinished(
|
|
@@ -972,7 +978,7 @@ class AdaptiveJitState(object):
|
|
|
yield [
|
|
|
("TAIL_CALL_ARGS",
|
|
|
[compile_function_body_baseline,
|
|
|
- (jit, function_name, body_id, task_root, header)])]
|
|
|
+ (jit, function_name, body_id, task_root, header, True)])]
|
|
|
|
|
|
def compile_function_body_adaptive(
|
|
|
jit, function_name, body_id, task_root,
|