| OLD | NEW |
| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 ConstantInstr* constant = definition()->AsConstant(); | 131 ConstantInstr* constant = definition()->AsConstant(); |
| 132 ASSERT(constant != NULL); | 132 ASSERT(constant != NULL); |
| 133 return constant->value(); | 133 return constant->value(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 | 136 |
| 137 GraphEntryInstr::GraphEntryInstr(TargetEntryInstr* normal_entry) | 137 GraphEntryInstr::GraphEntryInstr(TargetEntryInstr* normal_entry) |
| 138 : BlockEntryInstr(CatchClauseNode::kInvalidTryIndex), | 138 : BlockEntryInstr(CatchClauseNode::kInvalidTryIndex), |
| 139 normal_entry_(normal_entry), | 139 normal_entry_(normal_entry), |
| 140 catch_entries_(), | 140 catch_entries_(), |
| 141 start_env_(NULL), | 141 initial_definitions_(), |
| 142 constant_null_(NULL), | |
| 143 spill_slot_count_(0) { | 142 spill_slot_count_(0) { |
| 144 } | 143 } |
| 145 | 144 |
| 146 | 145 |
| 146 ConstantInstr* GraphEntryInstr::constant_null() { |
| 147 ASSERT(initial_definitions_.length() > 0 && |
| 148 initial_definitions_[0]->IsConstant() && |
| 149 initial_definitions_[0]->AsConstant()->value().IsNull()); |
| 150 return initial_definitions_[0]->AsConstant(); |
| 151 } |
| 152 |
| 153 |
| 147 static bool CompareNames(const Library& lib, | 154 static bool CompareNames(const Library& lib, |
| 148 const char* test_name, | 155 const char* test_name, |
| 149 const String& name) { | 156 const String& name) { |
| 150 // If both names are private mangle test_name before comparison. | 157 // If both names are private mangle test_name before comparison. |
| 151 if ((name.CharAt(0) == '_') && (test_name[0] == '_')) { | 158 if ((name.CharAt(0) == '_') && (test_name[0] == '_')) { |
| 152 const String& test_name_symbol = String::Handle(Symbols::New(test_name)); | 159 const String& test_name_symbol = String::Handle(Symbols::New(test_name)); |
| 153 return String::Handle(lib.PrivateName(test_name_symbol)).Equals(name); | 160 return String::Handle(lib.PrivateName(test_name_symbol)).Equals(name); |
| 154 } | 161 } |
| 155 return name.Equals(test_name); | 162 return name.Equals(test_name); |
| 156 } | 163 } |
| (...skipping 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1748 value->set_use_index(use_index++); | 1755 value->set_use_index(use_index++); |
| 1749 value->AddToEnvUseList(); | 1756 value->AddToEnvUseList(); |
| 1750 } | 1757 } |
| 1751 instr->env()->outer_ = copy; | 1758 instr->env()->outer_ = copy; |
| 1752 } | 1759 } |
| 1753 | 1760 |
| 1754 | 1761 |
| 1755 #undef __ | 1762 #undef __ |
| 1756 | 1763 |
| 1757 } // namespace dart | 1764 } // namespace dart |
| OLD | NEW |