| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 RawBigint* left, | 2028 RawBigint* left, |
| 2029 RawBigint* right); | 2029 RawBigint* right); |
| 2030 | 2030 |
| 2031 | 2031 |
| 2032 // Does identical check (object references are equal or not equal) with special | 2032 // Does identical check (object references are equal or not equal) with special |
| 2033 // checks for boxed numbers. | 2033 // checks for boxed numbers. |
| 2034 // Left and right are pushed on stack. | 2034 // Left and right are pushed on stack. |
| 2035 // Return Zero condition flag set if equal. | 2035 // Return Zero condition flag set if equal. |
| 2036 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint | 2036 // Note: A Mint cannot contain a value that would fit in Smi, a Bigint |
| 2037 // cannot contain a value that fits in Mint or Smi. | 2037 // cannot contain a value that fits in Mint or Smi. |
| 2038 void StubCode::GenerateIdenticalWithNumberCheckStub(Assembler* assembler, | 2038 static void GenerateIdenticalWithNumberCheckStub(Assembler* assembler, |
| 2039 const Register left, | 2039 const Register left, |
| 2040 const Register right, | 2040 const Register right) { |
| 2041 const Register unused1, | |
| 2042 const Register unused2) { | |
| 2043 Label reference_compare, done, check_mint, check_bigint; | 2041 Label reference_compare, done, check_mint, check_bigint; |
| 2044 // If any of the arguments is Smi do reference compare. | 2042 // If any of the arguments is Smi do reference compare. |
| 2045 __ tsti(left, Immediate(kSmiTagMask)); | 2043 __ tsti(left, Immediate(kSmiTagMask)); |
| 2046 __ b(&reference_compare, EQ); | 2044 __ b(&reference_compare, EQ); |
| 2047 __ tsti(right, Immediate(kSmiTagMask)); | 2045 __ tsti(right, Immediate(kSmiTagMask)); |
| 2048 __ b(&reference_compare, EQ); | 2046 __ b(&reference_compare, EQ); |
| 2049 | 2047 |
| 2050 // Value compare for two doubles. | 2048 // Value compare for two doubles. |
| 2051 __ CompareClassId(left, kDoubleCid, kNoPP); | 2049 __ CompareClassId(left, kDoubleCid, kNoPP); |
| 2052 __ b(&check_mint, NE); | 2050 __ b(&check_mint, NE); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 } | 2122 } |
| 2125 | 2123 |
| 2126 | 2124 |
| 2127 // Called from optimized code only. | 2125 // Called from optimized code only. |
| 2128 // LR: return address. | 2126 // LR: return address. |
| 2129 // SP + 4: left operand. | 2127 // SP + 4: left operand. |
| 2130 // SP + 0: right operand. | 2128 // SP + 0: right operand. |
| 2131 // Return Zero condition flag set if equal. | 2129 // Return Zero condition flag set if equal. |
| 2132 void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( | 2130 void StubCode::GenerateOptimizedIdenticalWithNumberCheckStub( |
| 2133 Assembler* assembler) { | 2131 Assembler* assembler) { |
| 2134 const Register temp = R2; | |
| 2135 const Register left = R1; | 2132 const Register left = R1; |
| 2136 const Register right = R0; | 2133 const Register right = R0; |
| 2137 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); | 2134 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); |
| 2138 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); | 2135 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); |
| 2139 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2136 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
| 2140 __ ret(); | 2137 __ ret(); |
| 2141 } | 2138 } |
| 2142 | 2139 |
| 2143 | 2140 |
| 2144 void StubCode::EmitMegamorphicLookup( | 2141 void StubCode::EmitMegamorphicLookup( |
| 2145 Assembler* assembler, Register receiver, Register cache, Register target) { | 2142 Assembler* assembler, Register receiver, Register cache, Register target) { |
| 2146 ASSERT((cache != R0) && (cache != R2)); | 2143 ASSERT((cache != R0) && (cache != R2)); |
| 2147 __ LoadTaggedClassIdMayBeSmi(R0, receiver); | 2144 __ LoadTaggedClassIdMayBeSmi(R0, receiver); |
| 2148 // R0: class ID of the receiver (smi). | 2145 // R0: class ID of the receiver (smi). |
| 2149 __ LoadFieldFromOffset(R2, cache, MegamorphicCache::buckets_offset(), PP); | 2146 __ LoadFieldFromOffset(R2, cache, MegamorphicCache::buckets_offset(), PP); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2190 // Result: | 2187 // Result: |
| 2191 // R1: entry point. | 2188 // R1: entry point. |
| 2192 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2189 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2193 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2190 EmitMegamorphicLookup(assembler, R0, R1, R1); |
| 2194 __ ret(); | 2191 __ ret(); |
| 2195 } | 2192 } |
| 2196 | 2193 |
| 2197 } // namespace dart | 2194 } // namespace dart |
| 2198 | 2195 |
| 2199 #endif // defined TARGET_ARCH_ARM64 | 2196 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |