| 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 15 matching lines...) Expand all Loading... |
| 26 // The RBX, R10 registers can be destroyed only if there is no slow-path (i.e., | 26 // The RBX, R10 registers can be destroyed only if there is no slow-path (i.e., |
| 27 // the methods returns true). | 27 // the methods returns true). |
| 28 | 28 |
| 29 #define __ assembler-> | 29 #define __ assembler-> |
| 30 | 30 |
| 31 | 31 |
| 32 intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; } | 32 intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; } |
| 33 | 33 |
| 34 | 34 |
| 35 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 35 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
| 36 if (FLAG_enable_type_checks) { | 36 if (Isolate::Current()->TypeChecksEnabled()) { |
| 37 return; | 37 return; |
| 38 } | 38 } |
| 39 __ movq(RDX, Address(RSP, + 1 * kWordSize)); // Value. | 39 __ movq(RDX, Address(RSP, + 1 * kWordSize)); // Value. |
| 40 __ movq(RCX, Address(RSP, + 2 * kWordSize)); // Index. | 40 __ movq(RCX, Address(RSP, + 2 * kWordSize)); // Index. |
| 41 __ movq(RAX, Address(RSP, + 3 * kWordSize)); // Array. | 41 __ movq(RAX, Address(RSP, + 3 * kWordSize)); // Array. |
| 42 Label fall_through; | 42 Label fall_through; |
| 43 __ testq(RCX, Immediate(kSmiTagMask)); | 43 __ testq(RCX, Immediate(kSmiTagMask)); |
| 44 __ j(NOT_ZERO, &fall_through); | 44 __ j(NOT_ZERO, &fall_through); |
| 45 // Range check. | 45 // Range check. |
| 46 __ cmpq(RCX, FieldAddress(RAX, Array::length_offset())); | 46 __ cmpq(RCX, FieldAddress(RAX, Array::length_offset())); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 __ Bind(&fall_through); | 96 __ Bind(&fall_through); |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| 100 // Add an element to growable array if it doesn't need to grow, otherwise | 100 // Add an element to growable array if it doesn't need to grow, otherwise |
| 101 // call into regular code. | 101 // call into regular code. |
| 102 // On stack: growable array (+2), value (+1), return-address (+0). | 102 // On stack: growable array (+2), value (+1), return-address (+0). |
| 103 void Intrinsifier::GrowableArray_add(Assembler* assembler) { | 103 void Intrinsifier::GrowableArray_add(Assembler* assembler) { |
| 104 // In checked mode we need to check the incoming argument. | 104 // In checked mode we need to check the incoming argument. |
| 105 if (FLAG_enable_type_checks) return; | 105 if (Isolate::Current()->TypeChecksEnabled()) return; |
| 106 Label fall_through; | 106 Label fall_through; |
| 107 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Array. | 107 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Array. |
| 108 __ movq(RCX, FieldAddress(RAX, GrowableObjectArray::length_offset())); | 108 __ movq(RCX, FieldAddress(RAX, GrowableObjectArray::length_offset())); |
| 109 // RCX: length. | 109 // RCX: length. |
| 110 __ movq(RDX, FieldAddress(RAX, GrowableObjectArray::data_offset())); | 110 __ movq(RDX, FieldAddress(RAX, GrowableObjectArray::data_offset())); |
| 111 // RDX: data. | 111 // RDX: data. |
| 112 // Compare length with capacity. | 112 // Compare length with capacity. |
| 113 __ cmpq(RCX, FieldAddress(RDX, Array::length_offset())); | 113 __ cmpq(RCX, FieldAddress(RDX, Array::length_offset())); |
| 114 __ j(EQUAL, &fall_through); // Must grow data. | 114 __ j(EQUAL, &fall_through); // Must grow data. |
| 115 // len = len + 1; | 115 // len = len + 1; |
| (...skipping 1818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 // Set return value to Isolate::current_tag_. | 1934 // Set return value to Isolate::current_tag_. |
| 1935 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 1935 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
| 1936 __ ret(); | 1936 __ ret(); |
| 1937 } | 1937 } |
| 1938 | 1938 |
| 1939 #undef __ | 1939 #undef __ |
| 1940 | 1940 |
| 1941 } // namespace dart | 1941 } // namespace dart |
| 1942 | 1942 |
| 1943 #endif // defined TARGET_ARCH_X64 | 1943 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |