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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 12377017: Use enum instead of bool parameter in IL instructions to indicate if a store barrier is needed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 18967)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -893,10 +893,15 @@
}
intptr_t array_cid = PrepareIndexedOp(call, class_id, &array, &index);
- // Check if store barrier is needed.
- bool needs_store_barrier = !RawObject::IsByteArrayClassId(array_cid);
+ // Check if store barrier is needed. Byte arrays don't need a store barrier.
+ StoreBarrierType needs_store_barrier =
+ RawObject::IsByteArrayClassId(array_cid)
+ ? kNoStoreBarrier
+ : kEmitStoreBarrier;
if (!value_check.IsNull()) {
- needs_store_barrier = false;
+ // No store barrier needed because checked value is a smi, an unboxed mint
+ // or unboxed double.
+ needs_store_barrier = kNoStoreBarrier;
AddCheckClass(stored_value, value_check, call->deopt_id(), call->env(),
call);
}
@@ -1906,14 +1911,14 @@
if (InstanceCallNeedsClassCheck(instr)) {
AddReceiverCheck(instr);
}
- bool needs_store_barrier = true;
+ StoreBarrierType needs_store_barrier = kEmitStoreBarrier;
if (ArgIsAlwaysSmi(*instr->ic_data(), 1)) {
InsertBefore(instr,
new CheckSmiInstr(new Value(instr->ArgumentAt(1)),
instr->deopt_id()),
instr->env(),
Definition::kEffect);
- needs_store_barrier = false;
+ needs_store_barrier = kNoStoreBarrier;
}
StoreInstanceFieldInstr* store = new StoreInstanceFieldInstr(
field,
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698