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

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

Issue 10875033: Specify kSmiCid as result of get string or array length operation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 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/cha.h" 7 #include "vm/cha.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/hash_map.h" 9 #include "vm/hash_map.h"
10 #include "vm/il_printer.h" 10 #include "vm/il_printer.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 case MethodRecognizer::kGrowableArrayLength: 446 case MethodRecognizer::kGrowableArrayLength:
447 length_offset = GrowableObjectArray::length_offset(); 447 length_offset = GrowableObjectArray::length_offset();
448 break; 448 break;
449 default: 449 default:
450 UNREACHABLE(); 450 UNREACHABLE();
451 } 451 }
452 LoadVMFieldComp* load = new LoadVMFieldComp( 452 LoadVMFieldComp* load = new LoadVMFieldComp(
453 comp->ArgumentAt(0)->value(), 453 comp->ArgumentAt(0)->value(),
454 length_offset, 454 length_offset,
455 Type::ZoneHandle(Type::IntInterface())); 455 Type::ZoneHandle(Type::IntInterface()));
456 load->set_result_cid(kSmiCid);
456 load->set_original(comp); 457 load->set_original(comp);
457 load->set_ic_data(comp->ic_data()); 458 load->set_ic_data(comp->ic_data());
458 instr->set_computation(load); 459 instr->set_computation(load);
459 RemovePushArguments(comp); 460 RemovePushArguments(comp);
460 return true; 461 return true;
461 } 462 }
462 463
463 if (recognized_kind == MethodRecognizer::kStringBaseLength) { 464 if (recognized_kind == MethodRecognizer::kStringBaseLength) {
464 if (!HasOneTarget(ic_data)) { 465 if (!HasOneTarget(ic_data)) {
465 // Target is not only StringBase_get_length. 466 // Target is not only StringBase_get_length.
466 return false; 467 return false;
467 } 468 }
468 ASSERT(HasOneTarget(ic_data)); 469 ASSERT(HasOneTarget(ic_data));
469 LoadVMFieldComp* load = new LoadVMFieldComp( 470 LoadVMFieldComp* load = new LoadVMFieldComp(
470 comp->ArgumentAt(0)->value(), 471 comp->ArgumentAt(0)->value(),
471 String::length_offset(), 472 String::length_offset(),
472 Type::ZoneHandle(Type::IntInterface())); 473 Type::ZoneHandle(Type::IntInterface()));
474 load->set_result_cid(kSmiCid);
473 load->set_original(comp); 475 load->set_original(comp);
474 load->set_ic_data(comp->ic_data()); 476 load->set_ic_data(comp->ic_data());
475 instr->set_computation(load); 477 instr->set_computation(load);
476 RemovePushArguments(comp); 478 RemovePushArguments(comp);
477 return true; 479 return true;
478 } 480 }
479 return false; 481 return false;
480 } 482 }
481 483
482 484
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 OS::Print("Replacing v%d with v%d\n", 977 OS::Print("Replacing v%d with v%d\n",
976 instr->ssa_temp_index(), 978 instr->ssa_temp_index(),
977 result->ssa_temp_index()); 979 result->ssa_temp_index());
978 } 980 }
979 } 981 }
980 } 982 }
981 } 983 }
982 984
983 985
984 } // namespace dart 986 } // 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