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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 51123003: VM: Fix checked mode crash (issue 13831). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 29679)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -4194,10 +4194,20 @@
}
+// Load instructions handled by load elimination.
+static bool IsCandidateLoad(Instruction* instr) {
+ return instr->IsLoadField()
+ || instr->IsLoadIndexed()
+ || instr->IsLoadStaticField()
+ || instr->IsCurrentContext();
+}
+
+
static bool IsLoopInvariantLoad(ZoneGrowableArray<BitVector*>* sets,
intptr_t loop_header_index,
Instruction* instr) {
- return (sets != NULL) &&
+ return IsCandidateLoad(instr) &&
+ (sets != NULL) &&
instr->HasPlaceId() &&
((*sets)[loop_header_index] != NULL) &&
(*sets)[loop_header_index]->Contains(instr->place_id());
@@ -6482,6 +6492,8 @@
ASSERT(field.is_static());
if (field.is_final()) {
Instance& obj = Instance::Handle(field.value());
+ ASSERT(obj.raw() != Object::sentinel().raw());
+ ASSERT(obj.raw() != Object::transition_sentinel().raw());
if (obj.IsSmi() || obj.IsOld()) {
SetValue(instr, obj);
return;

Powered by Google App Engine
This is Rietveld 408576698