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 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 __ movq(left, Address(RSP, 2 * kWordSize)); | 2004 __ movq(left, Address(RSP, 2 * kWordSize)); |
2005 __ movq(right, Address(RSP, 1 * kWordSize)); | 2005 __ movq(right, Address(RSP, 1 * kWordSize)); |
2006 GenerateIdenticalWithNumberCheckStub(assembler, left, right); | 2006 GenerateIdenticalWithNumberCheckStub(assembler, left, right); |
2007 __ ret(); | 2007 __ ret(); |
2008 } | 2008 } |
2009 | 2009 |
2010 | 2010 |
2011 // Called from megamorphic calls. | 2011 // Called from megamorphic calls. |
2012 // RDI: receiver | 2012 // RDI: receiver |
2013 // RBX: MegamorphicCache (preserved) | 2013 // RBX: MegamorphicCache (preserved) |
2014 // Result: | 2014 // Passed to target: |
2015 // CODE_REG: target Code | 2015 // CODE_REG: target Code |
2016 // R10: arguments descriptor | 2016 // R10: arguments descriptor |
2017 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2017 void StubCode::GenerateMegamorphicCallStub(Assembler* assembler) { |
2018 __ NoMonomorphicCheckedEntry(); | 2018 __ NoMonomorphicCheckedEntry(); |
2019 | 2019 |
2020 // Jump if receiver is a smi. | 2020 // Jump if receiver is a smi. |
2021 Label smi_case; | 2021 Label smi_case; |
2022 __ testq(RDI, Immediate(kSmiTagMask)); | 2022 __ testq(RDI, Immediate(kSmiTagMask)); |
2023 // Jump out of line for smi case. | 2023 // Jump out of line for smi case. |
2024 __ j(ZERO, &smi_case, Assembler::kNearJump); | 2024 __ j(ZERO, &smi_case, Assembler::kNearJump); |
2025 | 2025 |
2026 // Loads the cid of the object. | 2026 // Loads the cid of the object. |
2027 __ LoadClassId(RAX, RDI); | 2027 __ LoadClassId(RAX, RDI); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2077 // Load cid for the Smi case. | 2077 // Load cid for the Smi case. |
2078 __ Bind(&smi_case); | 2078 __ Bind(&smi_case); |
2079 __ movq(RAX, Immediate(kSmiCid)); | 2079 __ movq(RAX, Immediate(kSmiCid)); |
2080 __ jmp(&cid_loaded); | 2080 __ jmp(&cid_loaded); |
2081 } | 2081 } |
2082 | 2082 |
2083 | 2083 |
2084 // Called from switchable IC calls. | 2084 // Called from switchable IC calls. |
2085 // RDI: receiver | 2085 // RDI: receiver |
2086 // RBX: ICData (preserved) | 2086 // RBX: ICData (preserved) |
2087 // Result: | 2087 // Passed to target: |
2088 // CODE_REG: target Code object | 2088 // CODE_REG: target Code object |
2089 // R10: arguments descriptor | 2089 // R10: arguments descriptor |
2090 void StubCode::GenerateICLookupThroughFunctionStub(Assembler* assembler) { | 2090 void StubCode::GenerateICCallThroughFunctionStub(Assembler* assembler) { |
2091 __ NoMonomorphicCheckedEntry(); | 2091 __ NoMonomorphicCheckedEntry(); |
2092 | 2092 |
2093 Label loop, found, miss; | 2093 Label loop, found, miss; |
2094 | 2094 |
2095 __ movq(R13, FieldAddress(RBX, ICData::ic_data_offset())); | 2095 __ movq(R13, FieldAddress(RBX, ICData::ic_data_offset())); |
2096 __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); | 2096 __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); |
2097 __ leaq(R13, FieldAddress(R13, Array::data_offset())); | 2097 __ leaq(R13, FieldAddress(R13, Array::data_offset())); |
2098 // R13: first IC entry | 2098 // R13: first IC entry |
2099 __ LoadTaggedClassIdMayBeSmi(RAX, RDI); | 2099 __ LoadTaggedClassIdMayBeSmi(RAX, RDI); |
2100 // RAX: receiver cid as Smi | 2100 // RAX: receiver cid as Smi |
(...skipping 19 matching lines...) Expand all Loading... |
2120 __ jmp(RCX); | 2120 __ jmp(RCX); |
2121 | 2121 |
2122 __ Bind(&miss); | 2122 __ Bind(&miss); |
2123 __ LoadIsolate(RAX); | 2123 __ LoadIsolate(RAX); |
2124 __ movq(CODE_REG, Address(RAX, Isolate::ic_miss_code_offset())); | 2124 __ movq(CODE_REG, Address(RAX, Isolate::ic_miss_code_offset())); |
2125 __ movq(RCX, FieldAddress(CODE_REG, Code::entry_point_offset())); | 2125 __ movq(RCX, FieldAddress(CODE_REG, Code::entry_point_offset())); |
2126 __ jmp(RCX); | 2126 __ jmp(RCX); |
2127 } | 2127 } |
2128 | 2128 |
2129 | 2129 |
2130 void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) { | 2130 void StubCode::GenerateICCallThroughCodeStub(Assembler* assembler) { |
2131 __ NoMonomorphicCheckedEntry(); | 2131 __ NoMonomorphicCheckedEntry(); |
2132 | 2132 |
2133 Label loop, found, miss; | 2133 Label loop, found, miss; |
2134 | 2134 |
2135 __ movq(R13, FieldAddress(RBX, ICData::ic_data_offset())); | 2135 __ movq(R13, FieldAddress(RBX, ICData::ic_data_offset())); |
2136 __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); | 2136 __ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset())); |
2137 __ leaq(R13, FieldAddress(R13, Array::data_offset())); | 2137 __ leaq(R13, FieldAddress(R13, Array::data_offset())); |
2138 // R13: first IC entry | 2138 // R13: first IC entry |
2139 __ LoadTaggedClassIdMayBeSmi(RAX, RDI); | 2139 __ LoadTaggedClassIdMayBeSmi(RAX, RDI); |
2140 // RAX: receiver cid as Smi | 2140 // RAX: receiver cid as Smi |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2188 } | 2188 } |
2189 | 2189 |
2190 | 2190 |
2191 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2191 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2192 __ int3(); | 2192 __ int3(); |
2193 } | 2193 } |
2194 | 2194 |
2195 } // namespace dart | 2195 } // namespace dart |
2196 | 2196 |
2197 #endif // defined TARGET_ARCH_X64 | 2197 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |