|
@@ -145,6 +145,8 @@ class AnalysisState(object):
|
|
#
|
|
#
|
|
# !loop_body():
|
|
# !loop_body():
|
|
# $result = <body>
|
|
# $result = <body>
|
|
|
|
+ # static if jit.nop_insertion_enabled:
|
|
|
|
+ # $_ = direct-call ('macro-io', void) nop()
|
|
# jump !loop_condition()
|
|
# jump !loop_condition()
|
|
#
|
|
#
|
|
# !loop_exit():
|
|
# !loop_exit():
|
|
@@ -165,6 +167,8 @@ class AnalysisState(object):
|
|
|
|
|
|
self.current_block = loop_body_block
|
|
self.current_block = loop_body_block
|
|
self.analyze(instruction.body)
|
|
self.analyze(instruction.body)
|
|
|
|
+ if self.jit.nop_insertion_enabled:
|
|
|
|
+ self.current_block.append_definition(cfg_ir.create_nop())
|
|
self.current_block.flow = cfg_ir.create_jump(loop_condition_block)
|
|
self.current_block.flow = cfg_ir.create_jump(loop_condition_block)
|
|
|
|
|
|
self.current_block = loop_exit_block
|
|
self.current_block = loop_exit_block
|
|
@@ -296,6 +300,8 @@ class AnalysisState(object):
|
|
raise jit_runtime.JitCompilationFailedException(
|
|
raise jit_runtime.JitCompilationFailedException(
|
|
"'continue' instruction targets a 'while' loop that has not been defined yet.")
|
|
"'continue' instruction targets a 'while' loop that has not been defined yet.")
|
|
|
|
|
|
|
|
+ if self.jit.nop_insertion_enabled:
|
|
|
|
+ self.current_block.append_definition(cfg_ir.create_nop())
|
|
cond_block, _ = self.loop_instructions[instruction.loop]
|
|
cond_block, _ = self.loop_instructions[instruction.loop]
|
|
self.current_block.flow = cfg_ir.create_jump(cond_block)
|
|
self.current_block.flow = cfg_ir.create_jump(cond_block)
|
|
self.current_block = cfg_ir.BasicBlock(self.counter)
|
|
self.current_block = cfg_ir.BasicBlock(self.counter)
|