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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 616873003: Use UnboxedInt32 and UnboxedUint32 representation for LoadIndexedInstr (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_arm.cc » ('j') | runtime/vm/intermediate_language_arm64.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index f5333546f2ed98d51cc45fded39181aab427b875..c9b9b0ad3187e9cf40c09507e318d5f286e0d54e 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -75,6 +75,7 @@ static bool CanConvertUnboxedMintToDouble() {
#endif
}
+
// Optimize instance calls using ICData.
void FlowGraphOptimizer::ApplyICData() {
VisitBlocks();
@@ -628,6 +629,8 @@ void FlowGraphOptimizer::InsertConversion(Representation from,
converted = new(I) UnboxIntegerInstr(use->CopyWithType(), deopt_id);
} else if ((from == kUnboxedMint) && (to == kTagged)) {
converted = new(I) BoxIntegerInstr(use->CopyWithType());
+ } else if ((from == kUnboxedUint32) && (to == kTagged)) {
+ converted = new(I) BoxUint32Instr(use->CopyWithType());
} else if (IsUnboxedInteger(from) && IsUnboxedInteger(to)) {
const intptr_t deopt_id = (to == kUnboxedInt32) && (deopt_target != NULL) ?
deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId;
@@ -1355,7 +1358,12 @@ bool FlowGraphOptimizer::InlineSetIndexed(
RawObject::IsTypedDataViewClassId(array_cid) ||
RawObject::IsExternalTypedDataClassId(array_cid)) ? kNoStoreBarrier
: kEmitStoreBarrier;
- if (!value_check.IsNull()) {
+
+ // No need to class check stores to Int32 and Uint32 arrays because
+ // we insert unboxing instructions below which include a class check.
+ if ((array_cid != kTypedDataUint32ArrayCid) &&
+ (array_cid != kTypedDataInt32ArrayCid) &&
+ !value_check.IsNull()) {
// No store barrier needed because checked value is a smi, an unboxed mint,
// an unboxed double, an unboxed Float32x4, or unboxed Int32x4.
needs_store_barrier = kNoStoreBarrier;
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_arm.cc » ('j') | runtime/vm/intermediate_language_arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698