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 // 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 Library& core_lib = Library::Handle(Library::CoreLibrary()); | 177 const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
178 const Class& cls = | 178 const Class& cls = Class::Handle( |
179 Class::Handle(core_lib.LookupClassAllowPrivate(Symbols::ObjectArray())); | 179 core_lib.LookupClassAllowPrivate(Symbols::ObjectArray(), NULL)); |
180 ASSERT(!cls.IsNull()); | 180 ASSERT(!cls.IsNull()); |
181 ASSERT(cls.HasTypeArguments()); | 181 ASSERT(cls.HasTypeArguments()); |
182 ASSERT(cls.NumTypeArguments() == 1); | 182 ASSERT(cls.NumTypeArguments() == 1); |
183 const intptr_t field_offset = cls.type_arguments_field_offset(); | 183 const intptr_t field_offset = cls.type_arguments_field_offset(); |
184 ASSERT(field_offset != Class::kNoTypeArguments); | 184 ASSERT(field_offset != Class::kNoTypeArguments); |
185 return field_offset; | 185 return field_offset; |
186 } | 186 } |
187 | 187 |
188 | 188 |
189 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 189 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 return false; // Compile method for slow case. | 1427 return false; // Compile method for slow case. |
1428 } | 1428 } |
1429 | 1429 |
1430 | 1430 |
1431 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; | 1431 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; |
1432 // _state[kSTATE_LO] = state & _MASK_32; | 1432 // _state[kSTATE_LO] = state & _MASK_32; |
1433 // _state[kSTATE_HI] = state >> 32; | 1433 // _state[kSTATE_HI] = state >> 32; |
1434 bool Intrinsifier::Random_nextState(Assembler* assembler) { | 1434 bool Intrinsifier::Random_nextState(Assembler* assembler) { |
1435 const Library& math_lib = Library::Handle(Library::MathLibrary()); | 1435 const Library& math_lib = Library::Handle(Library::MathLibrary()); |
1436 ASSERT(!math_lib.IsNull()); | 1436 ASSERT(!math_lib.IsNull()); |
1437 const Class& random_class = | 1437 const Class& random_class = Class::Handle( |
1438 Class::Handle(math_lib.LookupClassAllowPrivate(Symbols::_Random())); | 1438 math_lib.LookupClassAllowPrivate(Symbols::_Random(), NULL)); |
1439 ASSERT(!random_class.IsNull()); | 1439 ASSERT(!random_class.IsNull()); |
1440 const Field& state_field = Field::ZoneHandle( | 1440 const Field& state_field = Field::ZoneHandle( |
1441 random_class.LookupInstanceField(Symbols::_state())); | 1441 random_class.LookupInstanceField(Symbols::_state())); |
1442 ASSERT(!state_field.IsNull()); | 1442 ASSERT(!state_field.IsNull()); |
1443 const Field& random_A_field = Field::ZoneHandle( | 1443 const Field& random_A_field = Field::ZoneHandle( |
1444 random_class.LookupStaticField(Symbols::_A())); | 1444 random_class.LookupStaticField(Symbols::_A())); |
1445 ASSERT(!random_A_field.IsNull()); | 1445 ASSERT(!random_A_field.IsNull()); |
1446 ASSERT(random_A_field.is_const()); | 1446 ASSERT(random_A_field.is_const()); |
1447 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1447 const Instance& a_value = Instance::Handle(random_A_field.value()); |
1448 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1448 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 __ ret(); | 1769 __ ret(); |
1770 | 1770 |
1771 __ Bind(&fall_through); | 1771 __ Bind(&fall_through); |
1772 return false; | 1772 return false; |
1773 } | 1773 } |
1774 | 1774 |
1775 #undef __ | 1775 #undef __ |
1776 } // namespace dart | 1776 } // namespace dart |
1777 | 1777 |
1778 #endif // defined TARGET_ARCH_IA32 | 1778 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |