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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 2235433002: VM: Add more array intrinsics. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 4 years, 4 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/intrinsifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index a8e27c04c676222df00f560f571e4136c9e54818..8ee673924629ba7db508622c72f75cd75baba107 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -2102,86 +2102,6 @@ static intptr_t PrepareInlineIndexedOp(FlowGraph* flow_graph,
}
-static intptr_t MethodKindToCid(MethodRecognizer::Kind kind) {
- switch (kind) {
- case MethodRecognizer::kImmutableArrayGetIndexed:
- return kImmutableArrayCid;
-
- case MethodRecognizer::kObjectArrayGetIndexed:
- case MethodRecognizer::kObjectArraySetIndexed:
- return kArrayCid;
-
- case MethodRecognizer::kGrowableArrayGetIndexed:
- case MethodRecognizer::kGrowableArraySetIndexed:
- return kGrowableObjectArrayCid;
-
- case MethodRecognizer::kFloat32ArrayGetIndexed:
- case MethodRecognizer::kFloat32ArraySetIndexed:
- return kTypedDataFloat32ArrayCid;
-
- case MethodRecognizer::kFloat64ArrayGetIndexed:
- case MethodRecognizer::kFloat64ArraySetIndexed:
- return kTypedDataFloat64ArrayCid;
-
- case MethodRecognizer::kInt8ArrayGetIndexed:
- case MethodRecognizer::kInt8ArraySetIndexed:
- return kTypedDataInt8ArrayCid;
-
- case MethodRecognizer::kUint8ArrayGetIndexed:
- case MethodRecognizer::kUint8ArraySetIndexed:
- return kTypedDataUint8ArrayCid;
-
- case MethodRecognizer::kUint8ClampedArrayGetIndexed:
- case MethodRecognizer::kUint8ClampedArraySetIndexed:
- return kTypedDataUint8ClampedArrayCid;
-
- case MethodRecognizer::kExternalUint8ArrayGetIndexed:
- case MethodRecognizer::kExternalUint8ArraySetIndexed:
- return kExternalTypedDataUint8ArrayCid;
-
- case MethodRecognizer::kExternalUint8ClampedArrayGetIndexed:
- case MethodRecognizer::kExternalUint8ClampedArraySetIndexed:
- return kExternalTypedDataUint8ClampedArrayCid;
-
- case MethodRecognizer::kInt16ArrayGetIndexed:
- case MethodRecognizer::kInt16ArraySetIndexed:
- return kTypedDataInt16ArrayCid;
-
- case MethodRecognizer::kUint16ArrayGetIndexed:
- case MethodRecognizer::kUint16ArraySetIndexed:
- return kTypedDataUint16ArrayCid;
-
- case MethodRecognizer::kInt32ArrayGetIndexed:
- case MethodRecognizer::kInt32ArraySetIndexed:
- return kTypedDataInt32ArrayCid;
-
- case MethodRecognizer::kUint32ArrayGetIndexed:
- case MethodRecognizer::kUint32ArraySetIndexed:
- return kTypedDataUint32ArrayCid;
-
- case MethodRecognizer::kInt64ArrayGetIndexed:
- case MethodRecognizer::kInt64ArraySetIndexed:
- return kTypedDataInt64ArrayCid;
-
- case MethodRecognizer::kFloat32x4ArrayGetIndexed:
- case MethodRecognizer::kFloat32x4ArraySetIndexed:
- return kTypedDataFloat32x4ArrayCid;
-
- case MethodRecognizer::kInt32x4ArrayGetIndexed:
- case MethodRecognizer::kInt32x4ArraySetIndexed:
- return kTypedDataInt32x4ArrayCid;
-
- case MethodRecognizer::kFloat64x2ArrayGetIndexed:
- case MethodRecognizer::kFloat64x2ArraySetIndexed:
- return kTypedDataFloat64x2ArrayCid;
-
- default:
- break;
- }
- return kIllegalCid;
-}
-
-
static Instruction* GetCheckClass(FlowGraph* flow_graph,
Definition* to_check,
const ICData& unary_checks,
@@ -2204,8 +2124,7 @@ static bool InlineGetIndexed(FlowGraph* flow_graph,
Definition* receiver,
TargetEntryInstr** entry,
Definition** last) {
- intptr_t array_cid = MethodKindToCid(kind);
- ASSERT(array_cid != kIllegalCid);
+ intptr_t array_cid = MethodRecognizer::MethodKindToReceiverCid(kind);
Definition* array = receiver;
Definition* index = call->ArgumentAt(1);
@@ -2262,8 +2181,7 @@ static bool InlineSetIndexed(FlowGraph* flow_graph,
const ICData& value_check,
TargetEntryInstr** entry,
Definition** last) {
- intptr_t array_cid = MethodKindToCid(kind);
- ASSERT(array_cid != kIllegalCid);
+ intptr_t array_cid = MethodRecognizer::MethodKindToReceiverCid(kind);
Definition* array = receiver;
Definition* index = call->ArgumentAt(1);
« no previous file with comments | « no previous file | runtime/vm/intrinsifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698