diff options
author | Steven Laver <lavers@google.com> | 2019-11-05 13:42:59 -0800 |
---|---|---|
committer | Steven Laver <lavers@google.com> | 2019-11-09 01:16:30 +0000 |
commit | 7c6cc72e18cc1df5205fd2bc47664e6cc2534ad2 (patch) | |
tree | fc34e4ad6037cf231cccc3b56ccd13e82917520a /startop/view_compiler/dex_layout_compiler.h | |
parent | 8f4f93bf3ba75d8e83cb0a8618cb80f226ada5ac (diff) | |
parent | da5e1bd24a9a0ca24e7e49fad9e604409e573376 (diff) |
Merge RP1A.191024.001
Change-Id: I5cda3bba276e99d948b752be87d4599e9f882e0f
Diffstat (limited to 'startop/view_compiler/dex_layout_compiler.h')
-rw-r--r-- | startop/view_compiler/dex_layout_compiler.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/startop/view_compiler/dex_layout_compiler.h b/startop/view_compiler/dex_layout_compiler.h index 170a1a610297..a34ed1f0168e 100644 --- a/startop/view_compiler/dex_layout_compiler.h +++ b/startop/view_compiler/dex_layout_compiler.h @@ -79,36 +79,41 @@ class DexViewBuilder { private: // Accessors for the stack of views that are under construction. - dex::Value AcquireRegister(); - void ReleaseRegister(); + dex::LiveRegister AcquireRegister(); dex::Value GetCurrentView() const; dex::Value GetCurrentLayoutParams() const; dex::Value GetParentView() const; void PopViewStack(); + // Methods to simplify building different code fragments. + void BuildGetLayoutInflater(dex::Value dest); + void BuildGetResources(dex::Value dest); + void BuildGetLayoutResource(dex::Value dest, dex::Value resources, dex::Value resid); + void BuildLayoutResourceToAttributeSet(dex::Value dest, dex::Value layout_resource); + void BuildXmlNext(); + void BuildTryCreateView(dex::Value dest, dex::Value parent, dex::Value classname); + dex::MethodBuilder* method_; - // Registers used for code generation + // Parameters to the generated method dex::Value const context_; dex::Value const resid_; - const dex::Value inflater_; - const dex::Value xml_; - const dex::Value attrs_; - const dex::Value classname_tmp_; + + // Registers used for code generation + const dex::LiveRegister inflater_; + const dex::LiveRegister xml_; + const dex::LiveRegister attrs_; + const dex::LiveRegister classname_tmp_; const dex::MethodDeclData xml_next_; const dex::MethodDeclData try_create_view_; const dex::MethodDeclData generate_layout_params_; const dex::MethodDeclData add_view_; - // used for keeping track of which registers are in use - size_t top_register_{0}; - std::vector<dex::Value> register_stack_; - // Keep track of the views currently in progress. struct ViewEntry { - dex::Value view; - std::optional<dex::Value> layout_params; + dex::LiveRegister view; + std::optional<dex::LiveRegister> layout_params; }; std::vector<ViewEntry> view_stack_; }; |