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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 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 | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
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 3f1baa3d03e5f3f10e1c474b641f6d41c8d9f571..d7fc697d06c344938f2ae09a3f00f296c3161c0f 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -977,7 +977,7 @@ void FlowGraphOptimizer::InlineStringLengthGetter(InstanceCallInstr* call) {
}
-void FlowGraphOptimizer::InlineStringIsEmptyTester(InstanceCallInstr* call) {
+void FlowGraphOptimizer::InlineStringIsEmptyGetter(InstanceCallInstr* call) {
// Check receiver class.
AddCheckClass(call, call->ArgumentAt(0)->value()->Copy());
@@ -1056,6 +1056,15 @@ bool FlowGraphOptimizer::TryInlineInstanceGetter(InstanceCallInstr* call) {
return true;
}
+ if (recognized_kind == MethodRecognizer::kStringBaseIsEmpty) {
+ if (!ic_data.HasOneTarget()) {
+ // Target is not only StringBase_get_isEmpty.
+ return false;
+ }
+ InlineStringIsEmptyGetter(call);
+ return true;
+ }
+
return false;
}
@@ -1117,15 +1126,6 @@ bool FlowGraphOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) {
return true;
}
- if (recognized_kind == MethodRecognizer::kStringBaseIsEmpty) {
- if (!ic_data.HasOneTarget()) {
- // Target is not only StringBase_get_length.
- return false;
- }
- InlineStringIsEmptyTester(call);
- return true;
- }
-
return false;
}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698