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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 2023423002: Revert "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
« no previous file with comments | « runtime/lib/typed_data.dart ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 98c184685cd5564ce476ff84af2a2e9bc66bb1ff..39f41b7e8834de6e1a063b959a194f268629f61b 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -2612,27 +2612,40 @@ void EffectGraphVisitor::VisitInstanceCallNode(InstanceCallNode* node) {
}
-static bool IsNativeListFactory(const Function& function) {
+static intptr_t GetResultCidOfNativeFactory(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 true;
+ return kTypedDataFloat64x2ArrayCid;
default:
break;
}
- return false;
+ return kDynamicCid;
}
@@ -2648,11 +2661,12 @@ void EffectGraphVisitor::VisitStaticCallNode(StaticCallNode* node) {
node->arguments()->names(),
arguments,
owner()->ic_data_array());
- 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()));
+ 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);
+ }
}
ReturnDefinition(call);
}
« no previous file with comments | « runtime/lib/typed_data.dart ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698