| 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/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #define __ assembler-> | 30 #define __ assembler-> |
| 31 | 31 |
| 32 | 32 |
| 33 intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; } | 33 intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; } |
| 34 | 34 |
| 35 | 35 |
| 36 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 36 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
| 37 if (Isolate::Current()->flags().type_checks()) { | 37 if (Isolate::Current()->flags().type_checks()) { |
| 38 return; | 38 return; |
| 39 } | 39 } |
| 40 |
| 41 Label fall_through; |
| 40 __ movq(RDX, Address(RSP, + 1 * kWordSize)); // Value. | 42 __ movq(RDX, Address(RSP, + 1 * kWordSize)); // Value. |
| 41 __ movq(RCX, Address(RSP, + 2 * kWordSize)); // Index. | 43 __ movq(RCX, Address(RSP, + 2 * kWordSize)); // Index. |
| 42 __ movq(RAX, Address(RSP, + 3 * kWordSize)); // Array. | 44 __ movq(RAX, Address(RSP, + 3 * kWordSize)); // Array. |
| 43 Label fall_through; | |
| 44 __ testq(RCX, Immediate(kSmiTagMask)); | 45 __ testq(RCX, Immediate(kSmiTagMask)); |
| 45 __ j(NOT_ZERO, &fall_through); | 46 __ j(NOT_ZERO, &fall_through); |
| 46 // Range check. | 47 // Range check. |
| 47 __ cmpq(RCX, FieldAddress(RAX, Array::length_offset())); | 48 __ cmpq(RCX, FieldAddress(RAX, Array::length_offset())); |
| 48 // Runtime throws exception. | 49 // Runtime throws exception. |
| 49 __ j(ABOVE_EQUAL, &fall_through); | 50 __ j(ABOVE_EQUAL, &fall_through); |
| 50 // Note that RBX is Smi, i.e, times 2. | 51 // Note that RBX is Smi, i.e, times 2. |
| 51 ASSERT(kSmiTagShift == 1); | 52 ASSERT(kSmiTagShift == 1); |
| 52 // Destroy RCX (ic data) as we will not continue in the function. | 53 // Destroy RCX (ic data) as we will not continue in the function. |
| 53 __ StoreIntoObject(RAX, | 54 __ StoreIntoObject(RAX, |
| (...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1998 __ LoadIsolate(RAX); | 1999 __ LoadIsolate(RAX); |
| 1999 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); | 2000 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); |
| 2000 __ ret(); | 2001 __ ret(); |
| 2001 } | 2002 } |
| 2002 | 2003 |
| 2003 #undef __ | 2004 #undef __ |
| 2004 | 2005 |
| 2005 } // namespace dart | 2006 } // namespace dart |
| 2006 | 2007 |
| 2007 #endif // defined TARGET_ARCH_X64 | 2008 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |