OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 const Register InterfaceDescriptor::ContextRegister() { return cp; } | 14 const Register InterfaceDescriptor::ContextRegister() { return cp; } |
15 | 15 |
16 | 16 |
17 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 17 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
18 static PlatformInterfaceDescriptor default_descriptor = | 18 static PlatformInterfaceDescriptor default_descriptor = |
19 PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | 19 PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
20 | 20 |
21 static PlatformInterfaceDescriptor noInlineDescriptor = | 21 static PlatformInterfaceDescriptor noInlineDescriptor = |
22 PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | 22 PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
23 | 23 |
| 24 InitializeForIsolateAllPlatforms(isolate); |
| 25 |
| 26 { |
| 27 CallInterfaceDescriptor* descriptor = |
| 28 isolate->call_descriptor(CallDescriptorKey::FastNewClosureCall); |
| 29 // cp: context |
| 30 // x2: function info |
| 31 Register registers[] = {cp, x2}; |
| 32 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 33 } |
| 34 { |
| 35 CallInterfaceDescriptor* descriptor = |
| 36 isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); |
| 37 // cp: context |
| 38 // x1: function |
| 39 Register registers[] = {cp, x1}; |
| 40 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 41 } |
| 42 { |
| 43 CallInterfaceDescriptor* descriptor = |
| 44 isolate->call_descriptor(CallDescriptorKey::ToNumberCall); |
| 45 // cp: context |
| 46 // x0: value |
| 47 Register registers[] = {cp, x0}; |
| 48 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 49 } |
| 50 { |
| 51 CallInterfaceDescriptor* descriptor = |
| 52 isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); |
| 53 // cp: context |
| 54 // x0: value |
| 55 Register registers[] = {cp, x0}; |
| 56 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 57 } |
| 58 { |
| 59 CallInterfaceDescriptor* descriptor = |
| 60 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); |
| 61 // cp: context |
| 62 // x3: array literals array |
| 63 // x2: array literal index |
| 64 // x1: constant elements |
| 65 Register registers[] = {cp, x3, x2, x1}; |
| 66 Representation representations[] = { |
| 67 Representation::Tagged(), Representation::Tagged(), |
| 68 Representation::Smi(), Representation::Tagged()}; |
| 69 descriptor->Initialize(arraysize(registers), registers, representations); |
| 70 } |
| 71 { |
| 72 CallInterfaceDescriptor* descriptor = |
| 73 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); |
| 74 // cp: context |
| 75 // x3: object literals array |
| 76 // x2: object literal index |
| 77 // x1: constant properties |
| 78 // x0: object literal flags |
| 79 Register registers[] = {cp, x3, x2, x1, x0}; |
| 80 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 81 } |
| 82 { |
| 83 CallInterfaceDescriptor* descriptor = |
| 84 isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); |
| 85 // cp: context |
| 86 // x2: feedback vector |
| 87 // x3: call feedback slot |
| 88 Register registers[] = {cp, x2, x3}; |
| 89 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 90 } |
| 91 { |
| 92 CallInterfaceDescriptor* descriptor = |
| 93 isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); |
| 94 // x1 function the function to call |
| 95 Register registers[] = {cp, x1}; |
| 96 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 97 } |
| 98 { |
| 99 CallInterfaceDescriptor* descriptor = |
| 100 isolate->call_descriptor(CallDescriptorKey::CallConstructCall); |
| 101 // x0 : number of arguments |
| 102 // x1 : the function to call |
| 103 // x2 : feedback vector |
| 104 // x3 : slot in feedback vector (smi) (if r2 is not the megamorphic symbol) |
| 105 // TODO(turbofan): So far we don't gather type feedback and hence skip the |
| 106 // slot parameter, but ArrayConstructStub needs the vector to be undefined. |
| 107 Register registers[] = {cp, x0, x1, x2}; |
| 108 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 109 } |
| 110 { |
| 111 CallInterfaceDescriptor* descriptor = |
| 112 isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); |
| 113 // cp: context |
| 114 // x2: length |
| 115 // x1: index (of last match) |
| 116 // x0: string |
| 117 Register registers[] = {cp, x2, x1, x0}; |
| 118 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 119 } |
| 120 { |
| 121 CallInterfaceDescriptor* descriptor = |
| 122 isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); |
| 123 // cp: context |
| 124 // x0: value (js_array) |
| 125 // x1: to_map |
| 126 Register registers[] = {cp, x0, x1}; |
| 127 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 128 } |
| 129 { |
| 130 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 131 CallDescriptorKey::ArrayConstructorConstantArgCountCall); |
| 132 // cp: context |
| 133 // x1: function |
| 134 // x2: allocation site with elements kind |
| 135 // x0: number of arguments to the constructor function |
| 136 Register registers[] = {cp, x1, x2}; |
| 137 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 138 } |
| 139 { |
| 140 CallInterfaceDescriptor* descriptor = |
| 141 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); |
| 142 // stack param count needs (constructor pointer, and single argument) |
| 143 Register registers[] = {cp, x1, x2, x0}; |
| 144 Representation representations[] = { |
| 145 Representation::Tagged(), Representation::Tagged(), |
| 146 Representation::Tagged(), Representation::Integer32()}; |
| 147 descriptor->Initialize(arraysize(registers), registers, representations); |
| 148 } |
| 149 { |
| 150 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 151 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); |
| 152 // cp: context |
| 153 // x1: constructor function |
| 154 // x0: number of arguments to the constructor function |
| 155 Register registers[] = {cp, x1}; |
| 156 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 157 } |
| 158 { |
| 159 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 160 CallDescriptorKey::InternalArrayConstructorCall); |
| 161 // stack param count needs (constructor pointer, and single argument) |
| 162 Register registers[] = {cp, x1, x0}; |
| 163 Representation representations[] = {Representation::Tagged(), |
| 164 Representation::Tagged(), |
| 165 Representation::Integer32()}; |
| 166 descriptor->Initialize(arraysize(registers), registers, representations); |
| 167 } |
| 168 { |
| 169 CallInterfaceDescriptor* descriptor = |
| 170 isolate->call_descriptor(CallDescriptorKey::CompareNilCall); |
| 171 // cp: context |
| 172 // x0: value to compare |
| 173 Register registers[] = {cp, x0}; |
| 174 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 175 } |
| 176 { |
| 177 CallInterfaceDescriptor* descriptor = |
| 178 isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); |
| 179 // cp: context |
| 180 // x0: value |
| 181 Register registers[] = {cp, x0}; |
| 182 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 183 } |
| 184 { |
| 185 CallInterfaceDescriptor* descriptor = |
| 186 isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); |
| 187 // cp: context |
| 188 // x1: left operand |
| 189 // x0: right operand |
| 190 Register registers[] = {cp, x1, x0}; |
| 191 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 192 } |
| 193 { |
| 194 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 195 CallDescriptorKey::BinaryOpWithAllocationSiteCall); |
| 196 // cp: context |
| 197 // x2: allocation site |
| 198 // x1: left operand |
| 199 // x0: right operand |
| 200 Register registers[] = {cp, x2, x1, x0}; |
| 201 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 202 } |
| 203 { |
| 204 CallInterfaceDescriptor* descriptor = |
| 205 isolate->call_descriptor(CallDescriptorKey::StringAddCall); |
| 206 // cp: context |
| 207 // x1: left operand |
| 208 // x0: right operand |
| 209 Register registers[] = {cp, x1, x0}; |
| 210 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 211 } |
| 212 |
24 { | 213 { |
25 CallInterfaceDescriptor* descriptor = | 214 CallInterfaceDescriptor* descriptor = |
26 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); | 215 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); |
27 Register registers[] = { | 216 Register registers[] = { |
28 cp, // context | 217 cp, // context |
29 x1, // JSFunction | 218 x1, // JSFunction |
30 x0, // actual number of arguments | 219 x0, // actual number of arguments |
31 x2, // expected number of arguments | 220 x2, // expected number of arguments |
32 }; | 221 }; |
33 Representation representations[] = { | 222 Representation representations[] = { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 Representation::External(), // api_function_address | 288 Representation::External(), // api_function_address |
100 }; | 289 }; |
101 descriptor->Initialize(arraysize(registers), registers, representations, | 290 descriptor->Initialize(arraysize(registers), registers, representations, |
102 &default_descriptor); | 291 &default_descriptor); |
103 } | 292 } |
104 } | 293 } |
105 } | 294 } |
106 } // namespace v8::internal | 295 } // namespace v8::internal |
107 | 296 |
108 #endif // V8_TARGET_ARCH_ARM64 | 297 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |