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 // The intrinsic code below is executed before a method has built its frame. | 5 // The intrinsic code below is executed before a method has built its frame. |
6 // The return address is on the stack and the arguments below it. | 6 // The return address is on the stack and the arguments below it. |
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. | 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. |
8 // Each intrinsification method returns true if the corresponding | 8 // Each intrinsification method returns true if the corresponding |
9 // Dart method was intrinsified. | 9 // Dart method was intrinsified. |
10 | 10 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 | 169 |
170 | 170 |
171 bool Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { | 171 bool Intrinsifier::ImmutableArray_getIndexed(Assembler* assembler) { |
172 return Array_getIndexed(assembler); | 172 return Array_getIndexed(assembler); |
173 } | 173 } |
174 | 174 |
175 | 175 |
176 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { | 176 static intptr_t ComputeObjectArrayTypeArgumentsOffset() { |
177 const String& class_name = String::Handle(Symbols::New("_ObjectArray")); | 177 const String& class_name = String::Handle(Symbols::New("_ObjectArray")); |
178 const Library& coreimpl_lib = Library::Handle(Library::CoreImplLibrary()); | 178 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
179 const Class& cls = | 179 const Class& cls = |
180 Class::Handle(coreimpl_lib.LookupClassAllowPrivate(class_name)); | 180 Class::Handle(core_lib.LookupClassAllowPrivate(class_name)); |
181 ASSERT(!cls.IsNull()); | 181 ASSERT(!cls.IsNull()); |
182 ASSERT(cls.HasTypeArguments()); | 182 ASSERT(cls.HasTypeArguments()); |
183 ASSERT(cls.NumTypeArguments() == 1); | 183 ASSERT(cls.NumTypeArguments() == 1); |
184 const intptr_t field_offset = cls.type_arguments_instance_field_offset(); | 184 const intptr_t field_offset = cls.type_arguments_instance_field_offset(); |
185 ASSERT(field_offset != Class::kNoTypeArguments); | 185 ASSERT(field_offset != Class::kNoTypeArguments); |
186 return field_offset; | 186 return field_offset; |
187 } | 187 } |
188 | 188 |
189 | 189 |
190 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 190 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 __ ret(); | 245 __ ret(); |
246 __ Bind(&fall_through); | 246 __ Bind(&fall_through); |
247 return false; | 247 return false; |
248 } | 248 } |
249 | 249 |
250 | 250 |
251 static intptr_t GetOffsetForField(const char* class_name_p, | 251 static intptr_t GetOffsetForField(const char* class_name_p, |
252 const char* field_name_p) { | 252 const char* field_name_p) { |
253 const String& class_name = String::Handle(Symbols::New(class_name_p)); | 253 const String& class_name = String::Handle(Symbols::New(class_name_p)); |
254 const String& field_name = String::Handle(Symbols::New(field_name_p)); | 254 const String& field_name = String::Handle(Symbols::New(field_name_p)); |
255 const Library& coreimpl_lib = Library::Handle(Library::CoreImplLibrary()); | 255 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
256 const Class& cls = | 256 const Class& cls = |
257 Class::Handle(coreimpl_lib.LookupClassAllowPrivate(class_name)); | 257 Class::Handle(core_lib.LookupClassAllowPrivate(class_name)); |
258 ASSERT(!cls.IsNull()); | 258 ASSERT(!cls.IsNull()); |
259 const Field& field = Field::ZoneHandle(cls.LookupInstanceField(field_name)); | 259 const Field& field = Field::ZoneHandle(cls.LookupInstanceField(field_name)); |
260 ASSERT(!field.IsNull()); | 260 ASSERT(!field.IsNull()); |
261 return field.Offset(); | 261 return field.Offset(); |
262 } | 262 } |
263 | 263 |
264 | 264 |
265 // Allocate a GrowableObjectArray using the backing array specified. | 265 // Allocate a GrowableObjectArray using the backing array specified. |
266 // On stack: type argument (+2), data (+1), return-address (+0). | 266 // On stack: type argument (+2), data (+1), return-address (+0). |
267 bool Intrinsifier::GArray_Allocate(Assembler* assembler) { | 267 bool Intrinsifier::GArray_Allocate(Assembler* assembler) { |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 __ Bind(&is_true); | 1725 __ Bind(&is_true); |
1726 __ LoadObject(EAX, bool_true); | 1726 __ LoadObject(EAX, bool_true); |
1727 __ ret(); | 1727 __ ret(); |
1728 return true; | 1728 return true; |
1729 } | 1729 } |
1730 | 1730 |
1731 #undef __ | 1731 #undef __ |
1732 } // namespace dart | 1732 } // namespace dart |
1733 | 1733 |
1734 #endif // defined TARGET_ARCH_IA32 | 1734 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |