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 2302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2313 ASSERT(Array::Handle(cls.functions()).Length() == 0); | 2313 ASSERT(Array::Handle(cls.functions()).Length() == 0); |
2314 } | 2314 } |
2315 } | 2315 } |
2316 | 2316 |
2317 | 2317 |
2318 void ClassFinalizer::FinalizeClass(const Class& cls) { | 2318 void ClassFinalizer::FinalizeClass(const Class& cls) { |
2319 HANDLESCOPE(Isolate::Current()); | 2319 HANDLESCOPE(Isolate::Current()); |
2320 if (cls.is_finalized()) { | 2320 if (cls.is_finalized()) { |
2321 return; | 2321 return; |
2322 } | 2322 } |
2323 if (false && cls.is_patch()) { | 2323 if (cls.is_patch()) { |
2324 // The fields and functions of a patch class are copied to the | 2324 // The fields and functions of a patch class are copied to the |
2325 // patched class after parsing. There is nothing to finalize. | 2325 // patched class after parsing. There is nothing to finalize. |
2326 ASSERT(Array::Handle(cls.functions()).Length() == 0); | 2326 ASSERT(Array::Handle(cls.functions()).Length() == 0); |
2327 ASSERT(Array::Handle(cls.fields()).Length() == 0); | 2327 ASSERT(Array::Handle(cls.fields()).Length() == 0); |
2328 cls.set_is_finalized(); | 2328 cls.set_is_finalized(); |
2329 return; | 2329 return; |
2330 } | 2330 } |
2331 if (FLAG_trace_class_finalization) { | 2331 if (FLAG_trace_class_finalization) { |
2332 OS::Print("Finalize %s\n", cls.ToCString()); | 2332 OS::Print("Finalize %s\n", cls.ToCString()); |
2333 } | 2333 } |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); | 3172 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); |
3173 field ^= fields_array.At(0); | 3173 field ^= fields_array.At(0); |
3174 ASSERT(field.Offset() == ByteBuffer::data_offset()); | 3174 ASSERT(field.Offset() == ByteBuffer::data_offset()); |
3175 name ^= field.name(); | 3175 name ^= field.name(); |
3176 expected_name ^= String::New("_data"); | 3176 expected_name ^= String::New("_data"); |
3177 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 3177 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
3178 #endif | 3178 #endif |
3179 } | 3179 } |
3180 | 3180 |
3181 } // namespace dart | 3181 } // namespace dart |
OLD | NEW |