| 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/class_finalizer.h" | 5 #include "vm/class_finalizer.h" |
| 6 | 6 |
| 7 #include "vm/code_generator.h" | 7 #include "vm/code_generator.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 void ClassFinalizer::ResolveAndFinalizeSignature(const Class& cls, | 1158 void ClassFinalizer::ResolveAndFinalizeSignature(const Class& cls, |
| 1159 const Function& function) { | 1159 const Function& function) { |
| 1160 // Resolve result type. | 1160 // Resolve result type. |
| 1161 AbstractType& type = AbstractType::Handle(function.result_type()); | 1161 AbstractType& type = AbstractType::Handle(function.result_type()); |
| 1162 // It is not a compile time error if this name does not resolve to a class or | 1162 // It is not a compile time error if this name does not resolve to a class or |
| 1163 // interface. | 1163 // interface. |
| 1164 AbstractType& finalized_type = | 1164 AbstractType& finalized_type = |
| 1165 AbstractType::Handle(FinalizeType(cls, type, kCanonicalize)); | 1165 AbstractType::Handle(FinalizeType(cls, type, kCanonicalize)); |
| 1166 // The result type may be malformed or malbounded. | 1166 // The result type may be malformed or malbounded. |
| 1167 if (type.raw() != finalized_type.raw()) { | 1167 if (type.raw() != finalized_type.raw()) { |
| 1168 function.set_result_type(type); | 1168 function.set_result_type(finalized_type); |
| 1169 } | 1169 } |
| 1170 // Resolve formal parameter types. | 1170 // Resolve formal parameter types. |
| 1171 const intptr_t num_parameters = function.NumParameters(); | 1171 const intptr_t num_parameters = function.NumParameters(); |
| 1172 for (intptr_t i = 0; i < num_parameters; i++) { | 1172 for (intptr_t i = 0; i < num_parameters; i++) { |
| 1173 type = function.ParameterTypeAt(i); | 1173 type = function.ParameterTypeAt(i); |
| 1174 finalized_type = FinalizeType(cls, type, kCanonicalize); | 1174 finalized_type = FinalizeType(cls, type, kCanonicalize); |
| 1175 // The parameter type may be malformed or malbounded. | 1175 // The parameter type may be malformed or malbounded. |
| 1176 if (type.raw() != finalized_type.raw()) { | 1176 if (type.raw() != finalized_type.raw()) { |
| 1177 function.SetParameterTypeAt(i, type); | 1177 function.SetParameterTypeAt(i, finalized_type); |
| 1178 } | 1178 } |
| 1179 } | 1179 } |
| 1180 } | 1180 } |
| 1181 | 1181 |
| 1182 | 1182 |
| 1183 // Check if an instance field, getter, or method of same name exists | 1183 // Check if an instance field, getter, or method of same name exists |
| 1184 // in any super class. | 1184 // in any super class. |
| 1185 static RawClass* FindSuperOwnerOfInstanceMember(const Class& cls, | 1185 static RawClass* FindSuperOwnerOfInstanceMember(const Class& cls, |
| 1186 const String& name, | 1186 const String& name, |
| 1187 const String& getter_name) { | 1187 const String& getter_name) { |
| (...skipping 1992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3180 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); | 3180 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); |
| 3181 field ^= fields_array.At(0); | 3181 field ^= fields_array.At(0); |
| 3182 ASSERT(field.Offset() == ByteBuffer::data_offset()); | 3182 ASSERT(field.Offset() == ByteBuffer::data_offset()); |
| 3183 name ^= field.name(); | 3183 name ^= field.name(); |
| 3184 expected_name ^= String::New("_data"); | 3184 expected_name ^= String::New("_data"); |
| 3185 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3185 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 3186 #endif | 3186 #endif |
| 3187 } | 3187 } |
| 3188 | 3188 |
| 3189 } // namespace dart | 3189 } // namespace dart |
| OLD | NEW |