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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2897803002: 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 68430e4afae19239230c03e4a68500c6f9d87b6f..e017cf72e4c9b99f338f0ad972aadb7b7b4a2fb6 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -4555,6 +4555,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