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/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 // o#foo (o.get:#foo) failed, closurizee o.foo or o.foo(), whichever is | 1071 // o#foo (o.get:#foo) failed, closurizee o.foo or o.foo(), whichever is |
1072 // encountered first on the inheritance chain. Or, | 1072 // encountered first on the inheritance chain. Or, |
1073 // o#foo= (o.get:#set:foo) failed, closurize o.foo= if it exists. | 1073 // o#foo= (o.get:#set:foo) failed, closurize o.foo= if it exists. |
1074 String& field_name = | 1074 String& field_name = |
1075 String::Handle(zone, Field::NameFromGetter(target_name)); | 1075 String::Handle(zone, Field::NameFromGetter(target_name)); |
1076 | 1076 |
1077 const bool is_extractor = field_name.CharAt(0) == '#'; | 1077 const bool is_extractor = field_name.CharAt(0) == '#'; |
1078 if (is_extractor) { | 1078 if (is_extractor) { |
1079 field_name = String::SubString(field_name, 1); | 1079 field_name = String::SubString(field_name, 1); |
1080 ASSERT(!Field::IsGetterName(field_name)); | 1080 ASSERT(!Field::IsGetterName(field_name)); |
1081 field_name = Symbols::New(field_name); | 1081 field_name = Symbols::New(thread, field_name); |
1082 | 1082 |
1083 if (!Field::IsSetterName(field_name)) { | 1083 if (!Field::IsSetterName(field_name)) { |
1084 const String& getter_name = | 1084 const String& getter_name = |
1085 String::Handle(Field::GetterName(field_name)); | 1085 String::Handle(Field::GetterName(field_name)); |
1086 | 1086 |
1087 // Zigzagged lookup: closure either a regular method or a getter. | 1087 // Zigzagged lookup: closure either a regular method or a getter. |
1088 while (!cls.IsNull()) { | 1088 while (!cls.IsNull()) { |
1089 function ^= cls.LookupDynamicFunction(field_name); | 1089 function ^= cls.LookupDynamicFunction(field_name); |
1090 if (!function.IsNull()) { | 1090 if (!function.IsNull()) { |
1091 CLOSURIZE(function); | 1091 CLOSURIZE(function); |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 1885 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
1886 const TypedData& new_data = | 1886 const TypedData& new_data = |
1887 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 1887 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
1888 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 1888 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
1889 typed_data_cell.SetAt(0, new_data); | 1889 typed_data_cell.SetAt(0, new_data); |
1890 arguments.SetReturn(new_data); | 1890 arguments.SetReturn(new_data); |
1891 } | 1891 } |
1892 | 1892 |
1893 | 1893 |
1894 } // namespace dart | 1894 } // namespace dart |
OLD | NEW |