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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2156 // R13: first IC entry | 2156 // R13: first IC entry |
2157 __ LoadTaggedClassIdMayBeSmi(RAX, RDI); | 2157 __ LoadTaggedClassIdMayBeSmi(RAX, RDI); |
2158 // RAX: receiver cid as Smi | 2158 // RAX: receiver cid as Smi |
2159 | 2159 |
2160 __ Bind(&loop); | 2160 __ Bind(&loop); |
2161 __ movq(R9, Address(R13, 0)); | 2161 __ movq(R9, Address(R13, 0)); |
2162 __ cmpq(RAX, R9); | 2162 __ cmpq(RAX, R9); |
2163 __ j(EQUAL, &found, Assembler::kNearJump); | 2163 __ j(EQUAL, &found, Assembler::kNearJump); |
2164 | 2164 |
2165 ASSERT(Smi::RawValue(kIllegalCid) == 0); | 2165 ASSERT(Smi::RawValue(kIllegalCid) == 0); |
2166 __ cmpq(R9, R9); | 2166 __ testq(R9, R9); |
2167 __ j(EQUAL, &miss, Assembler::kNearJump); | 2167 __ j(ZERO, &miss, Assembler::kNearJump); |
2168 | 2168 |
2169 const intptr_t entry_length = ICData::TestEntryLengthFor(1) * kWordSize; | 2169 const intptr_t entry_length = ICData::TestEntryLengthFor(1) * kWordSize; |
2170 __ addq(R13, Immediate(entry_length)); // Next entry. | 2170 __ addq(R13, Immediate(entry_length)); // Next entry. |
2171 __ jmp(&loop); | 2171 __ jmp(&loop); |
2172 | 2172 |
2173 __ Bind(&found); | 2173 __ Bind(&found); |
2174 const intptr_t target_offset = ICData::TargetIndexFor(1) * kWordSize; | 2174 const intptr_t target_offset = ICData::TargetIndexFor(1) * kWordSize; |
2175 __ movq(RAX, Address(R13, target_offset)); | 2175 __ movq(RAX, Address(R13, target_offset)); |
2176 __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset())); | 2176 __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset())); |
2177 __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset())); | 2177 __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset())); |
2178 __ ret(); | 2178 __ ret(); |
2179 | 2179 |
2180 __ Bind(&miss); | 2180 __ Bind(&miss); |
2181 __ LoadIsolate(RAX); | 2181 __ LoadIsolate(RAX); |
2182 __ movq(CODE_REG, Address(RAX, Isolate::ic_miss_code_offset())); | 2182 __ movq(CODE_REG, Address(RAX, Isolate::ic_miss_code_offset())); |
2183 __ movq(RCX, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2183 __ movq(RCX, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2184 __ ret(); | 2184 __ ret(); |
2185 } | 2185 } |
2186 | 2186 |
2187 } // namespace dart | 2187 } // namespace dart |
2188 | 2188 |
2189 #endif // defined TARGET_ARCH_X64 | 2189 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |