| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 return false; | 213 return false; |
| 214 } | 214 } |
| 215 | 215 |
| 216 | 216 |
| 217 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 217 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
| 218 // update. Array length is always a Smi. | 218 // update. Array length is always a Smi. |
| 219 static bool Array_setIndexed(Assembler* assembler) { | 219 static bool Array_setIndexed(Assembler* assembler) { |
| 220 if (FLAG_enable_type_checks) { | 220 if (FLAG_enable_type_checks) { |
| 221 return false; | 221 return false; |
| 222 } | 222 } |
| 223 const Immediate raw_null = | |
| 224 Immediate(reinterpret_cast<intptr_t>(Object::null())); | |
| 225 Label fall_through; | 223 Label fall_through; |
| 226 __ movl(EBX, Address(ESP, + 2 * kWordSize)); // Index. | 224 __ movl(EBX, Address(ESP, + 2 * kWordSize)); // Index. |
| 227 __ testl(EBX, Immediate(kSmiTagMask)); | 225 __ testl(EBX, Immediate(kSmiTagMask)); |
| 228 // Index not Smi. | 226 // Index not Smi. |
| 229 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); | 227 __ j(NOT_ZERO, &fall_through, Assembler::kNearJump); |
| 230 __ movl(EAX, Address(ESP, + 3 * kWordSize)); // Array. | 228 __ movl(EAX, Address(ESP, + 3 * kWordSize)); // Array. |
| 231 // Range check. | 229 // Range check. |
| 232 __ cmpl(EBX, FieldAddress(EAX, Array::length_offset())); | 230 __ cmpl(EBX, FieldAddress(EAX, Array::length_offset())); |
| 233 // Runtime throws exception. | 231 // Runtime throws exception. |
| 234 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); | 232 __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump); |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 } \ | 1244 } \ |
| 1247 | 1245 |
| 1248 INTRINSIC_LIST(FIND_INTRINSICS); | 1246 INTRINSIC_LIST(FIND_INTRINSICS); |
| 1249 #undef FIND_INTRINSICS | 1247 #undef FIND_INTRINSICS |
| 1250 return false; | 1248 return false; |
| 1251 } | 1249 } |
| 1252 | 1250 |
| 1253 } // namespace dart | 1251 } // namespace dart |
| 1254 | 1252 |
| 1255 #endif // defined TARGET_ARCH_IA32 | 1253 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |