Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Unified Diff: runtime/vm/intermediate_language.h

Issue 2897603002: VM: Constant fold more loads from constants in the optimizer. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/constant_propagator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index ff3822cf9754846491807a5a7f95e99c5ca8b044..07f1da47405c8ea036876b01befe2ec39fdc714f 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -4485,6 +4485,13 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
bool IsImmutableLengthLoad() const;
+ // Try evaluating this load against the given constant value of
+ // the instance. Returns true if evaluation succeeded and
+ // puts result into result.
+ // Note: we only evaluate loads when we can ensure that
+ // instance has the field.
+ bool Evaluate(const Object& instance_value, Object* result);
+
virtual Definition* Canonicalize(FlowGraph* flow_graph);
static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid);
« no previous file with comments | « runtime/vm/constant_propagator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698