From f976aa822dd35496e4e936b5802af0d53d39ac95 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 24 Jun 2022 11:16:35 +0100 Subject: Add an environment to the beginning of catch blocks We can use the HNop to generate an environment for us and start using the existing environment infrastructure (e.g. EmitEnvironment) for recording the catch block's environment. This is done to provide support for try catch inlining since it requires several environments rather than just the one. When doing so, we now have a HNop at the beginning of each catch block. We have to modify code sinking to allow it to sink code past this HNop because if we don't we will sink code right before this instruction which will break the invariant of that HNop being the first instruction of a catch block. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I16e7b8cad499fd2d6f7415112b46206db8daf544 --- compiler/optimizing/code_generator.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index de247a98b9..6b85aaa880 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -846,8 +846,11 @@ class CodeGenerator : public DeletableArenaObject { void BlockIfInRegister(Location location, bool is_out = false) const; void EmitEnvironment(HEnvironment* environment, SlowPathCode* slow_path, - bool needs_vreg_info = true); - void EmitVRegInfo(HEnvironment* environment, SlowPathCode* slow_path); + bool needs_vreg_info = true, + bool is_for_catch_handler = false, + bool innermost_environment = true); + void EmitVRegInfo(HEnvironment* environment, SlowPathCode* slow_path, bool is_for_catch_handler); + void EmitVRegInfoOnlyCatchPhis(HEnvironment* environment); static void PrepareCriticalNativeArgumentMoves( HInvokeStaticOrDirect* invoke, -- cgit v1.2.3-59-g8ed1b