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

Unified Diff: runtime/vm/intermediate_language.h

Issue 2704623003: VM: [Kernel] Ensure we record [FieldLoadInstr]s in the ParsedFunction when using field guards (Closed)
Patch Set: Moved the AddToGuardedFields call to the LoadFieldInstr constructor Created 3 years, 10 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/flow_graph_builder.cc ('k') | runtime/vm/jit_optimizer.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 8359174d661d6fa662f1ad0b7708b4655b7ffa1f..54501a4f1d3d17e024e4e8a149fd4bc076ec8cdd 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -4289,7 +4289,8 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
LoadFieldInstr(Value* instance,
const Field* field,
const AbstractType& type,
- TokenPosition token_pos)
+ TokenPosition token_pos,
+ const ParsedFunction* parsed_function)
: offset_in_bytes_(field->Offset()),
type_(type),
result_cid_(kDynamicCid),
@@ -4301,6 +4302,13 @@ class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
// May be null if field is not an instance.
ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
SetInputAt(0, instance);
+
+ if (parsed_function != NULL && field->guarded_cid() != kIllegalCid) {
+ if (!field->is_nullable() || (field->guarded_cid() == kNullCid)) {
+ set_result_cid(field->guarded_cid());
+ }
+ parsed_function->AddToGuardedFields(field);
+ }
}
void set_is_immutable(bool value) { immutable_ = value; }
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698