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

Unified Diff: runtime/vm/aot_optimizer.cc

Issue 2127273002: VM: Move inlining of _bitAndFromSmi to the flow graph inliner. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: correct condition Created 4 years, 5 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/flow_graph_inliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/aot_optimizer.cc
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index cdc4753e9a30c77344c5db607049f875c16d72c1..a193dcfc0ef72a6939864661bab421e2d471ce60 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -1674,8 +1674,8 @@ static bool IsSupportedByteArrayViewCid(intptr_t cid) {
bool AotOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) {
ASSERT(call->HasICData());
const ICData& ic_data = *call->ic_data();
- if ((ic_data.NumberOfUsedChecks() == 0) || !ic_data.HasOneTarget()) {
- // No type feedback collected or multiple targets found.
+ if (ic_data.NumberOfUsedChecks() != 1) {
+ // No type feedback collected or multiple receivers/targets found.
return false;
}
@@ -1690,14 +1690,13 @@ bool AotOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) {
(recognized_kind == MethodRecognizer::kExternalOneByteStringCodeUnitAt) ||
(recognized_kind == MethodRecognizer::kExternalTwoByteStringCodeUnitAt) ||
(recognized_kind == MethodRecognizer::kGrowableArraySetData) ||
- (recognized_kind == MethodRecognizer::kGrowableArraySetLength)) {
- ASSERT(ic_data.NumberOfChecks() == 1);
+ (recognized_kind == MethodRecognizer::kGrowableArraySetLength) ||
+ (recognized_kind == MethodRecognizer::kSmi_bitAndFromSmi)) {
return FlowGraphInliner::TryReplaceInstanceCallWithInline(
flow_graph_, current_iterator(), call);
}
- if ((recognized_kind == MethodRecognizer::kStringBaseCharAt) &&
- (ic_data.NumberOfChecks() == 1)) {
+ if (recognized_kind == MethodRecognizer::kStringBaseCharAt) {
ASSERT((class_ids[0] == kOneByteStringCid) ||
(class_ids[0] == kTwoByteStringCid) ||
(class_ids[0] == kExternalOneByteStringCid) ||
@@ -1706,7 +1705,7 @@ bool AotOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) {
flow_graph_, current_iterator(), call);
}
- if ((class_ids[0] == kOneByteStringCid) && (ic_data.NumberOfChecks() == 1)) {
+ if (class_ids[0] == kOneByteStringCid) {
if (recognized_kind == MethodRecognizer::kOneByteStringSetAt) {
// This is an internal method, no need to check argument types nor
// range.
@@ -1729,8 +1728,7 @@ bool AotOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) {
}
if (CanUnboxDouble() &&
- (recognized_kind == MethodRecognizer::kIntegerToDouble) &&
- (ic_data.NumberOfChecks() == 1)) {
+ (recognized_kind == MethodRecognizer::kIntegerToDouble)) {
if (class_ids[0] == kSmiCid) {
AddReceiverCheck(call);
ReplaceCall(call,
@@ -1799,21 +1797,20 @@ bool AotOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) {
}
}
- if (IsSupportedByteArrayViewCid(class_ids[0]) &&
- (ic_data.NumberOfChecks() == 1)) {
+ if (IsSupportedByteArrayViewCid(class_ids[0])) {
return FlowGraphInliner::TryReplaceInstanceCallWithInline(
flow_graph_, current_iterator(), call);
}
- if ((class_ids[0] == kFloat32x4Cid) && (ic_data.NumberOfChecks() == 1)) {
+ if (class_ids[0] == kFloat32x4Cid) {
return TryInlineFloat32x4Method(call, recognized_kind);
}
- if ((class_ids[0] == kInt32x4Cid) && (ic_data.NumberOfChecks() == 1)) {
+ if (class_ids[0] == kInt32x4Cid) {
return TryInlineInt32x4Method(call, recognized_kind);
}
- if ((class_ids[0] == kFloat64x2Cid) && (ic_data.NumberOfChecks() == 1)) {
+ if (class_ids[0] == kFloat64x2Cid) {
return TryInlineFloat64x2Method(call, recognized_kind);
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698