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

Side by Side Diff: runtime/vm/flow_graph_optimizer.cc

Issue 11280248: Add more spcific ranges for String length and charCode methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 load->set_result_cid(kSmiCid); 1008 load->set_result_cid(kSmiCid);
1009 return load; 1009 return load;
1010 } 1010 }
1011 1011
1012 1012
1013 void FlowGraphOptimizer::InlineStringLengthGetter(InstanceCallInstr* call) { 1013 void FlowGraphOptimizer::InlineStringLengthGetter(InstanceCallInstr* call) {
1014 // Check receiver class. 1014 // Check receiver class.
1015 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); 1015 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy());
1016 1016
1017 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value()); 1017 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value());
1018 load->set_recognized_kind(MethodRecognizer::kStringBaseLength);
1018 call->ReplaceWith(load, current_iterator()); 1019 call->ReplaceWith(load, current_iterator());
1019 RemovePushArguments(call); 1020 RemovePushArguments(call);
1020 } 1021 }
1021 1022
1022 1023
1023 void FlowGraphOptimizer::InlineStringIsEmptyGetter(InstanceCallInstr* call) { 1024 void FlowGraphOptimizer::InlineStringIsEmptyGetter(InstanceCallInstr* call) {
1024 // Check receiver class. 1025 // Check receiver class.
1025 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); 1026 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy());
1026 1027
1027 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value()); 1028 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value());
(...skipping 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after
3904 3905
3905 if (FLAG_trace_constant_propagation) { 3906 if (FLAG_trace_constant_propagation) {
3906 OS::Print("\n==== After constant propagation ====\n"); 3907 OS::Print("\n==== After constant propagation ====\n");
3907 FlowGraphPrinter printer(*graph_); 3908 FlowGraphPrinter printer(*graph_);
3908 printer.PrintBlocks(); 3909 printer.PrintBlocks();
3909 } 3910 }
3910 } 3911 }
3911 3912
3912 3913
3913 } // namespace dart 3914 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698