OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 5490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5501 | 5501 |
5502 intptr_t index_constant() const { | 5502 intptr_t index_constant() const { |
5503 ASSERT(kind() == kConstantIndexed); | 5503 ASSERT(kind() == kConstantIndexed); |
5504 return index_constant_; | 5504 return index_constant_; |
5505 } | 5505 } |
5506 | 5506 |
5507 static const char* DefinitionName(Definition* def) { | 5507 static const char* DefinitionName(Definition* def) { |
5508 if (def == NULL) { | 5508 if (def == NULL) { |
5509 return "*"; | 5509 return "*"; |
5510 } else { | 5510 } else { |
5511 return Isolate::Current()->current_zone()->PrintToString( | 5511 return Thread::Current()->zone()->PrintToString( |
5512 "v%" Pd, def->ssa_temp_index()); | 5512 "v%" Pd, def->ssa_temp_index()); |
5513 } | 5513 } |
5514 } | 5514 } |
5515 | 5515 |
5516 const char* ToCString() const { | 5516 const char* ToCString() const { |
5517 switch (kind()) { | 5517 switch (kind()) { |
5518 case kNone: | 5518 case kNone: |
5519 return "<none>"; | 5519 return "<none>"; |
5520 | 5520 |
5521 case kField: { | 5521 case kField: { |
5522 const char* field_name = String::Handle(field().name()).ToCString(); | 5522 const char* field_name = String::Handle(field().name()).ToCString(); |
5523 if (field().is_static()) { | 5523 if (field().is_static()) { |
5524 return Isolate::Current()->current_zone()->PrintToString( | 5524 return Thread::Current()->zone()->PrintToString( |
5525 "<%s>", field_name); | 5525 "<%s>", field_name); |
5526 } else { | 5526 } else { |
5527 return Isolate::Current()->current_zone()->PrintToString( | 5527 return Thread::Current()->zone()->PrintToString( |
5528 "<%s.%s>", DefinitionName(instance()), field_name); | 5528 "<%s.%s>", DefinitionName(instance()), field_name); |
5529 } | 5529 } |
5530 } | 5530 } |
5531 | 5531 |
5532 case kVMField: | 5532 case kVMField: |
5533 return Isolate::Current()->current_zone()->PrintToString( | 5533 return Thread::Current()->zone()->PrintToString( |
5534 "<%s.@%" Pd ">", | 5534 "<%s.@%" Pd ">", |
5535 DefinitionName(instance()), | 5535 DefinitionName(instance()), |
5536 offset_in_bytes()); | 5536 offset_in_bytes()); |
5537 | 5537 |
5538 case kIndexed: | 5538 case kIndexed: |
5539 return Isolate::Current()->current_zone()->PrintToString( | 5539 return Thread::Current()->zone()->PrintToString( |
5540 "<%s[%s]>", | 5540 "<%s[%s]>", |
5541 DefinitionName(instance()), | 5541 DefinitionName(instance()), |
5542 DefinitionName(index())); | 5542 DefinitionName(index())); |
5543 | 5543 |
5544 case kConstantIndexed: | 5544 case kConstantIndexed: |
5545 if (element_size() == kNoSize) { | 5545 if (element_size() == kNoSize) { |
5546 return Isolate::Current()->current_zone()->PrintToString( | 5546 return Thread::Current()->zone()->PrintToString( |
5547 "<%s[%" Pd "]>", | 5547 "<%s[%" Pd "]>", |
5548 DefinitionName(instance()), | 5548 DefinitionName(instance()), |
5549 index_constant()); | 5549 index_constant()); |
5550 } else { | 5550 } else { |
5551 return Isolate::Current()->current_zone()->PrintToString( | 5551 return Thread::Current()->zone()->PrintToString( |
5552 "<%s[%" Pd "|%" Pd "]>", | 5552 "<%s[%" Pd "|%" Pd "]>", |
5553 DefinitionName(instance()), | 5553 DefinitionName(instance()), |
5554 index_constant(), | 5554 index_constant(), |
5555 ElementSizeMultiplier(element_size())); | 5555 ElementSizeMultiplier(element_size())); |
5556 } | 5556 } |
5557 } | 5557 } |
5558 UNREACHABLE(); | 5558 UNREACHABLE(); |
5559 return "<?>"; | 5559 return "<?>"; |
5560 } | 5560 } |
5561 | 5561 |
(...skipping 3169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8731 | 8731 |
8732 // Insert materializations at environment uses. | 8732 // Insert materializations at environment uses. |
8733 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 8733 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
8734 CreateMaterializationAt( | 8734 CreateMaterializationAt( |
8735 exits_collector_.exits()[i], alloc, *slots); | 8735 exits_collector_.exits()[i], alloc, *slots); |
8736 } | 8736 } |
8737 } | 8737 } |
8738 | 8738 |
8739 | 8739 |
8740 } // namespace dart | 8740 } // namespace dart |
OLD | NEW |