| 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/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/heap.h" | 8 #include "vm/heap.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 | 32 |
| 33 // Removes optimized code once we load more classes, since --use_cha based | 33 // Removes optimized code once we load more classes, since --use_cha based |
| 34 // optimizations may have become invalid. | 34 // optimizations may have become invalid. |
| 35 // Only methods which owner classes where subclasses can be invalid. | 35 // Only methods which owner classes where subclasses can be invalid. |
| 36 // TODO(srdjan): Be even more precise by recording the exact CHA optimization. | 36 // TODO(srdjan): Be even more precise by recording the exact CHA optimization. |
| 37 static void RemoveOptimizedCode( | 37 static void RemoveOptimizedCode( |
| 38 const GrowableArray<intptr_t>& added_subclasses_to_cids) { | 38 const GrowableArray<intptr_t>& added_subclasses_to_cids) { |
| 39 ASSERT(FLAG_use_cha); | 39 ASSERT(FLAG_use_cha); |
| 40 if (added_subclasses_to_cids.is_empty()) return; | 40 if (added_subclasses_to_cids.is_empty()) return; |
| 41 // TODO(regis): Reenable this code for arm and mips when possible. | 41 // TODO(regis): Reenable this code for mips when possible. |
| 42 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) | 42 #if defined(TARGET_ARCH_IA32) || \ |
| 43 defined(TARGET_ARCH_X64) || \ |
| 44 defined(TARGET_ARCH_ARM) |
| 43 // Deoptimize all live frames. | 45 // Deoptimize all live frames. |
| 44 DeoptimizeIfOwner(added_subclasses_to_cids); | 46 DeoptimizeIfOwner(added_subclasses_to_cids); |
| 45 // Switch all functions' code to unoptimized. | 47 // Switch all functions' code to unoptimized. |
| 46 const ClassTable& class_table = *Isolate::Current()->class_table(); | 48 const ClassTable& class_table = *Isolate::Current()->class_table(); |
| 47 Class& cls = Class::Handle(); | 49 Class& cls = Class::Handle(); |
| 48 Array& array = Array::Handle(); | 50 Array& array = Array::Handle(); |
| 49 Function& function = Function::Handle(); | 51 Function& function = Function::Handle(); |
| 50 for (intptr_t i = 0; i < added_subclasses_to_cids.length(); i++) { | 52 for (intptr_t i = 0; i < added_subclasses_to_cids.length(); i++) { |
| 51 intptr_t cid = added_subclasses_to_cids[i]; | 53 intptr_t cid = added_subclasses_to_cids[i]; |
| 52 cls = class_table.At(cid); | 54 cls = class_table.At(cid); |
| (...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 expected_name ^= String::New("_offset"); | 1996 expected_name ^= String::New("_offset"); |
| 1995 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 1997 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 1996 field ^= fields_array.At(2); | 1998 field ^= fields_array.At(2); |
| 1997 ASSERT(field.Offset() == TypedDataView::length_offset()); | 1999 ASSERT(field.Offset() == TypedDataView::length_offset()); |
| 1998 name ^= field.name(); | 2000 name ^= field.name(); |
| 1999 ASSERT(name.Equals("length")); | 2001 ASSERT(name.Equals("length")); |
| 2000 #endif | 2002 #endif |
| 2001 } | 2003 } |
| 2002 | 2004 |
| 2003 } // namespace dart | 2005 } // namespace dart |
| OLD | NEW |