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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 2033553002: Reapply "VM: Add result cid information for recognized methods." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 39f41b7e8834de6e1a063b959a194f268629f61b..98c184685cd5564ce476ff84af2a2e9bc66bb1ff 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -2612,40 +2612,27 @@ void EffectGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) {
}
-static intptr_t GetResultCidOfNativeFactory(const Function& function) {
+static bool IsNativeListFactory(const Function& function) {
switch (function.recognized_kind()) {
case MethodRecognizer::kTypedData_Int8Array_factory:
- return kTypedDataInt8ArrayCid;
case MethodRecognizer::kTypedData_Uint8Array_factory:
- return kTypedDataUint8ArrayCid;
case MethodRecognizer::kTypedData_Uint8ClampedArray_factory:
- return kTypedDataUint8ClampedArrayCid;
case MethodRecognizer::kTypedData_Int16Array_factory:
- return kTypedDataInt16ArrayCid;
case MethodRecognizer::kTypedData_Uint16Array_factory:
- return kTypedDataUint16ArrayCid;
case MethodRecognizer::kTypedData_Int32Array_factory:
- return kTypedDataInt32ArrayCid;
case MethodRecognizer::kTypedData_Uint32Array_factory:
- return kTypedDataUint32ArrayCid;
case MethodRecognizer::kTypedData_Int64Array_factory:
- return kTypedDataInt64ArrayCid;
case MethodRecognizer::kTypedData_Uint64Array_factory:
- return kTypedDataUint64ArrayCid;
case MethodRecognizer::kTypedData_Float32Array_factory:
- return kTypedDataFloat32ArrayCid;
case MethodRecognizer::kTypedData_Float64Array_factory:
- return kTypedDataFloat64ArrayCid;
case MethodRecognizer::kTypedData_Float32x4Array_factory:
- return kTypedDataFloat32x4ArrayCid;
case MethodRecognizer::kTypedData_Int32x4Array_factory:
- return kTypedDataInt32x4ArrayCid;
case MethodRecognizer::kTypedData_Float64x2Array_factory:
- return kTypedDataFloat64x2ArrayCid;
+ return true;
default:
break;
}
- return kDynamicCid;
+ return false;
}
@@ -2661,12 +2648,11 @@ void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) {
node->arguments()->names(),
arguments,
owner()->ic_data_array());
- if (node->function().is_native()) {
- const intptr_t result_cid = GetResultCidOfNativeFactory(node->function());
- if (result_cid != kDynamicCid) {
- call->set_result_cid(result_cid);
- call->set_is_native_list_factory(true);
- }
+ if (node->function().is_native() && IsNativeListFactory(node->function())) {
+ call->set_is_native_list_factory(true);
+ }
+ if (node->function().recognized_kind() != MethodRecognizer::kUnknown) {
+ call->set_result_cid(MethodRecognizer::ResultCid(node->function()));
}
ReturnDefinition(call);
}

Powered by Google App Engine
This is Rietveld 408576698