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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/become.h" | 10 #include "vm/become.h" |
(...skipping 4393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4404 static RawObject* NewKey(const CanonicalInstanceKey& obj) { | 4404 static RawObject* NewKey(const CanonicalInstanceKey& obj) { |
4405 return obj.key_.raw(); | 4405 return obj.key_.raw(); |
4406 } | 4406 } |
4407 }; | 4407 }; |
4408 typedef UnorderedHashSet <CanonicalInstanceTraits> CanonicalInstancesSet; | 4408 typedef UnorderedHashSet <CanonicalInstanceTraits> CanonicalInstancesSet; |
4409 | 4409 |
4410 | 4410 |
4411 RawInstance* Class::LookupCanonicalInstance(Zone* zone, | 4411 RawInstance* Class::LookupCanonicalInstance(Zone* zone, |
4412 const Instance& value) const { | 4412 const Instance& value) const { |
4413 ASSERT(this->raw() == value.clazz()); | 4413 ASSERT(this->raw() == value.clazz()); |
| 4414 ASSERT(is_finalized()); |
4414 Instance& canonical_value = Instance::Handle(zone); | 4415 Instance& canonical_value = Instance::Handle(zone); |
4415 if (this->constants() != Object::empty_array().raw()) { | 4416 if (this->constants() != Object::empty_array().raw()) { |
4416 CanonicalInstancesSet constants(zone, this->constants()); | 4417 CanonicalInstancesSet constants(zone, this->constants()); |
4417 canonical_value ^= constants.GetOrNull(CanonicalInstanceKey(value)); | 4418 canonical_value ^= constants.GetOrNull(CanonicalInstanceKey(value)); |
4418 this->set_constants(constants.Release()); | 4419 this->set_constants(constants.Release()); |
4419 } | 4420 } |
4420 return canonical_value.raw(); | 4421 return canonical_value.raw(); |
4421 } | 4422 } |
4422 | 4423 |
4423 | 4424 |
(...skipping 18611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23035 return UserTag::null(); | 23036 return UserTag::null(); |
23036 } | 23037 } |
23037 | 23038 |
23038 | 23039 |
23039 const char* UserTag::ToCString() const { | 23040 const char* UserTag::ToCString() const { |
23040 const String& tag_label = String::Handle(label()); | 23041 const String& tag_label = String::Handle(label()); |
23041 return tag_label.ToCString(); | 23042 return tag_label.ToCString(); |
23042 } | 23043 } |
23043 | 23044 |
23044 } // namespace dart | 23045 } // namespace dart |
OLD | NEW |