| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| 11 #include "src/regexp-macro-assembler.h" | 11 #include "src/regexp-macro-assembler.h" |
| 12 #include "src/stub-cache.h" | 12 #include "src/stub-cache.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 void FastNewClosureStub::InitializeInterfaceDescriptor( | 17 void FastNewClosureStub::InitializeInterfaceDescriptor( |
| 18 CodeStubInterfaceDescriptor* descriptor) { | 18 CodeStubInterfaceDescriptor* descriptor) { |
| 19 // cp: context |
| 19 // x2: function info | 20 // x2: function info |
| 20 Register registers[] = { x2 }; | 21 Register registers[] = { cp, x2 }; |
| 21 descriptor->Initialize( | 22 descriptor->Initialize( |
| 22 ARRAY_SIZE(registers), registers, | 23 ARRAY_SIZE(registers), registers, |
| 23 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); | 24 Runtime::FunctionForId(Runtime::kNewClosureFromStubFailure)->entry); |
| 24 } | 25 } |
| 25 | 26 |
| 26 | 27 |
| 27 void FastNewContextStub::InitializeInterfaceDescriptor( | 28 void FastNewContextStub::InitializeInterfaceDescriptor( |
| 28 CodeStubInterfaceDescriptor* descriptor) { | 29 CodeStubInterfaceDescriptor* descriptor) { |
| 30 // cp: context |
| 29 // x1: function | 31 // x1: function |
| 30 Register registers[] = { x1 }; | 32 Register registers[] = { cp, x1 }; |
| 31 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 33 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 32 } | 34 } |
| 33 | 35 |
| 34 | 36 |
| 35 void ToNumberStub::InitializeInterfaceDescriptor( | 37 void ToNumberStub::InitializeInterfaceDescriptor( |
| 36 CodeStubInterfaceDescriptor* descriptor) { | 38 CodeStubInterfaceDescriptor* descriptor) { |
| 39 // cp: context |
| 37 // x0: value | 40 // x0: value |
| 38 Register registers[] = { x0 }; | 41 Register registers[] = { cp, x0 }; |
| 39 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 42 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 40 } | 43 } |
| 41 | 44 |
| 42 | 45 |
| 43 void NumberToStringStub::InitializeInterfaceDescriptor( | 46 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 44 CodeStubInterfaceDescriptor* descriptor) { | 47 CodeStubInterfaceDescriptor* descriptor) { |
| 48 // cp: context |
| 45 // x0: value | 49 // x0: value |
| 46 Register registers[] = { x0 }; | 50 Register registers[] = { cp, x0 }; |
| 47 descriptor->Initialize( | 51 descriptor->Initialize( |
| 48 ARRAY_SIZE(registers), registers, | 52 ARRAY_SIZE(registers), registers, |
| 49 Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); | 53 Runtime::FunctionForId(Runtime::kNumberToStringRT)->entry); |
| 50 } | 54 } |
| 51 | 55 |
| 52 | 56 |
| 53 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 57 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 54 CodeStubInterfaceDescriptor* descriptor) { | 58 CodeStubInterfaceDescriptor* descriptor) { |
| 59 // cp: context |
| 55 // x3: array literals array | 60 // x3: array literals array |
| 56 // x2: array literal index | 61 // x2: array literal index |
| 57 // x1: constant elements | 62 // x1: constant elements |
| 58 Register registers[] = { x3, x2, x1 }; | 63 Register registers[] = { cp, x3, x2, x1 }; |
| 59 Representation representations[] = { | 64 Representation representations[] = { |
| 60 Representation::Tagged(), | 65 Representation::Tagged(), |
| 66 Representation::Tagged(), |
| 61 Representation::Smi(), | 67 Representation::Smi(), |
| 62 Representation::Tagged() }; | 68 Representation::Tagged() }; |
| 63 descriptor->Initialize( | 69 descriptor->Initialize( |
| 64 ARRAY_SIZE(registers), registers, | 70 ARRAY_SIZE(registers), registers, |
| 65 Runtime::FunctionForId( | 71 Runtime::FunctionForId( |
| 66 Runtime::kCreateArrayLiteralStubBailout)->entry, | 72 Runtime::kCreateArrayLiteralStubBailout)->entry, |
| 67 representations); | 73 representations); |
| 68 } | 74 } |
| 69 | 75 |
| 70 | 76 |
| 71 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( | 77 void FastCloneShallowObjectStub::InitializeInterfaceDescriptor( |
| 72 CodeStubInterfaceDescriptor* descriptor) { | 78 CodeStubInterfaceDescriptor* descriptor) { |
| 79 // cp: context |
| 73 // x3: object literals array | 80 // x3: object literals array |
| 74 // x2: object literal index | 81 // x2: object literal index |
| 75 // x1: constant properties | 82 // x1: constant properties |
| 76 // x0: object literal flags | 83 // x0: object literal flags |
| 77 Register registers[] = { x3, x2, x1, x0 }; | 84 Register registers[] = { cp, x3, x2, x1, x0 }; |
| 78 descriptor->Initialize( | 85 descriptor->Initialize( |
| 79 ARRAY_SIZE(registers), registers, | 86 ARRAY_SIZE(registers), registers, |
| 80 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); | 87 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry); |
| 81 } | 88 } |
| 82 | 89 |
| 83 | 90 |
| 84 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 91 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
| 85 CodeStubInterfaceDescriptor* descriptor) { | 92 CodeStubInterfaceDescriptor* descriptor) { |
| 93 // cp: context |
| 86 // x2: feedback vector | 94 // x2: feedback vector |
| 87 // x3: call feedback slot | 95 // x3: call feedback slot |
| 88 Register registers[] = { x2, x3 }; | 96 Register registers[] = { cp, x2, x3 }; |
| 89 descriptor->Initialize(ARRAY_SIZE(registers), registers); | 97 descriptor->Initialize(ARRAY_SIZE(registers), registers); |
| 90 } | 98 } |
| 91 | 99 |
| 92 | 100 |
| 93 void RegExpConstructResultStub::InitializeInterfaceDescriptor( | 101 void RegExpConstructResultStub::InitializeInterfaceDescriptor( |
| 94 CodeStubInterfaceDescriptor* descriptor) { | 102 CodeStubInterfaceDescriptor* descriptor) { |
| 103 // cp: context |
| 95 // x2: length | 104 // x2: length |
| 96 // x1: index (of last match) | 105 // x1: index (of last match) |
| 97 // x0: string | 106 // x0: string |
| 98 Register registers[] = { x2, x1, x0 }; | 107 Register registers[] = { cp, x2, x1, x0 }; |
| 99 descriptor->Initialize( | 108 descriptor->Initialize( |
| 100 ARRAY_SIZE(registers), registers, | 109 ARRAY_SIZE(registers), registers, |
| 101 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); | 110 Runtime::FunctionForId(Runtime::kRegExpConstructResult)->entry); |
| 102 } | 111 } |
| 103 | 112 |
| 104 | 113 |
| 105 void TransitionElementsKindStub::InitializeInterfaceDescriptor( | 114 void TransitionElementsKindStub::InitializeInterfaceDescriptor( |
| 106 CodeStubInterfaceDescriptor* descriptor) { | 115 CodeStubInterfaceDescriptor* descriptor) { |
| 116 // cp: context |
| 107 // x0: value (js_array) | 117 // x0: value (js_array) |
| 108 // x1: to_map | 118 // x1: to_map |
| 109 Register registers[] = { x0, x1 }; | 119 Register registers[] = { cp, x0, x1 }; |
| 110 Address entry = | 120 Address entry = |
| 111 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; | 121 Runtime::FunctionForId(Runtime::kTransitionElementsKind)->entry; |
| 112 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 122 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 113 FUNCTION_ADDR(entry)); | 123 FUNCTION_ADDR(entry)); |
| 114 } | 124 } |
| 115 | 125 |
| 116 | 126 |
| 117 void CompareNilICStub::InitializeInterfaceDescriptor( | 127 void CompareNilICStub::InitializeInterfaceDescriptor( |
| 118 CodeStubInterfaceDescriptor* descriptor) { | 128 CodeStubInterfaceDescriptor* descriptor) { |
| 129 // cp: context |
| 119 // x0: value to compare | 130 // x0: value to compare |
| 120 Register registers[] = { x0 }; | 131 Register registers[] = { cp, x0 }; |
| 121 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 132 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 122 FUNCTION_ADDR(CompareNilIC_Miss)); | 133 FUNCTION_ADDR(CompareNilIC_Miss)); |
| 123 descriptor->SetMissHandler( | 134 descriptor->SetMissHandler( |
| 124 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); | 135 ExternalReference(IC_Utility(IC::kCompareNilIC_Miss), isolate())); |
| 125 } | 136 } |
| 126 | 137 |
| 127 | 138 |
| 139 const Register InterfaceDescriptor::ContextRegister() { return cp; } |
| 140 |
| 141 |
| 128 static void InitializeArrayConstructorDescriptor( | 142 static void InitializeArrayConstructorDescriptor( |
| 129 CodeStubInterfaceDescriptor* descriptor, | 143 CodeStubInterfaceDescriptor* descriptor, |
| 130 int constant_stack_parameter_count) { | 144 int constant_stack_parameter_count) { |
| 145 // cp: context |
| 131 // x1: function | 146 // x1: function |
| 132 // x2: allocation site with elements kind | 147 // x2: allocation site with elements kind |
| 133 // x0: number of arguments to the constructor function | 148 // x0: number of arguments to the constructor function |
| 134 Address deopt_handler = Runtime::FunctionForId( | 149 Address deopt_handler = Runtime::FunctionForId( |
| 135 Runtime::kArrayConstructor)->entry; | 150 Runtime::kArrayConstructor)->entry; |
| 136 | 151 |
| 137 if (constant_stack_parameter_count == 0) { | 152 if (constant_stack_parameter_count == 0) { |
| 138 Register registers[] = { x1, x2 }; | 153 Register registers[] = { cp, x1, x2 }; |
| 139 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 154 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 140 deopt_handler, | 155 deopt_handler, |
| 141 NULL, | 156 NULL, |
| 142 constant_stack_parameter_count, | 157 constant_stack_parameter_count, |
| 143 JS_FUNCTION_STUB_MODE); | 158 JS_FUNCTION_STUB_MODE); |
| 144 } else { | 159 } else { |
| 145 // stack param count needs (constructor pointer, and single argument) | 160 // stack param count needs (constructor pointer, and single argument) |
| 146 Register registers[] = { x1, x2, x0 }; | 161 Register registers[] = { cp, x1, x2, x0 }; |
| 147 Representation representations[] = { | 162 Representation representations[] = { |
| 148 Representation::Tagged(), | 163 Representation::Tagged(), |
| 149 Representation::Tagged(), | 164 Representation::Tagged(), |
| 165 Representation::Tagged(), |
| 150 Representation::Integer32() }; | 166 Representation::Integer32() }; |
| 151 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 167 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 152 x0, | 168 x0, |
| 153 deopt_handler, | 169 deopt_handler, |
| 154 representations, | 170 representations, |
| 155 constant_stack_parameter_count, | 171 constant_stack_parameter_count, |
| 156 JS_FUNCTION_STUB_MODE, | 172 JS_FUNCTION_STUB_MODE, |
| 157 PASS_ARGUMENTS); | 173 PASS_ARGUMENTS); |
| 158 } | 174 } |
| 159 } | 175 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 173 | 189 |
| 174 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 190 void ArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
| 175 CodeStubInterfaceDescriptor* descriptor) { | 191 CodeStubInterfaceDescriptor* descriptor) { |
| 176 InitializeArrayConstructorDescriptor(descriptor, -1); | 192 InitializeArrayConstructorDescriptor(descriptor, -1); |
| 177 } | 193 } |
| 178 | 194 |
| 179 | 195 |
| 180 static void InitializeInternalArrayConstructorDescriptor( | 196 static void InitializeInternalArrayConstructorDescriptor( |
| 181 CodeStubInterfaceDescriptor* descriptor, | 197 CodeStubInterfaceDescriptor* descriptor, |
| 182 int constant_stack_parameter_count) { | 198 int constant_stack_parameter_count) { |
| 199 // cp: context |
| 183 // x1: constructor function | 200 // x1: constructor function |
| 184 // x0: number of arguments to the constructor function | 201 // x0: number of arguments to the constructor function |
| 185 Address deopt_handler = Runtime::FunctionForId( | 202 Address deopt_handler = Runtime::FunctionForId( |
| 186 Runtime::kInternalArrayConstructor)->entry; | 203 Runtime::kInternalArrayConstructor)->entry; |
| 187 | 204 |
| 188 if (constant_stack_parameter_count == 0) { | 205 if (constant_stack_parameter_count == 0) { |
| 189 Register registers[] = { x1 }; | 206 Register registers[] = { cp, x1 }; |
| 190 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 207 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 191 deopt_handler, | 208 deopt_handler, |
| 192 NULL, | 209 NULL, |
| 193 constant_stack_parameter_count, | 210 constant_stack_parameter_count, |
| 194 JS_FUNCTION_STUB_MODE); | 211 JS_FUNCTION_STUB_MODE); |
| 195 } else { | 212 } else { |
| 196 // stack param count needs (constructor pointer, and single argument) | 213 // stack param count needs (constructor pointer, and single argument) |
| 197 Register registers[] = { x1, x0 }; | 214 Register registers[] = { cp, x1, x0 }; |
| 198 Representation representations[] = { | 215 Representation representations[] = { |
| 199 Representation::Tagged(), | 216 Representation::Tagged(), |
| 217 Representation::Tagged(), |
| 200 Representation::Integer32() }; | 218 Representation::Integer32() }; |
| 201 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 219 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 202 x0, | 220 x0, |
| 203 deopt_handler, | 221 deopt_handler, |
| 204 representations, | 222 representations, |
| 205 constant_stack_parameter_count, | 223 constant_stack_parameter_count, |
| 206 JS_FUNCTION_STUB_MODE, | 224 JS_FUNCTION_STUB_MODE, |
| 207 PASS_ARGUMENTS); | 225 PASS_ARGUMENTS); |
| 208 } | 226 } |
| 209 } | 227 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 222 | 240 |
| 223 | 241 |
| 224 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( | 242 void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor( |
| 225 CodeStubInterfaceDescriptor* descriptor) { | 243 CodeStubInterfaceDescriptor* descriptor) { |
| 226 InitializeInternalArrayConstructorDescriptor(descriptor, -1); | 244 InitializeInternalArrayConstructorDescriptor(descriptor, -1); |
| 227 } | 245 } |
| 228 | 246 |
| 229 | 247 |
| 230 void ToBooleanStub::InitializeInterfaceDescriptor( | 248 void ToBooleanStub::InitializeInterfaceDescriptor( |
| 231 CodeStubInterfaceDescriptor* descriptor) { | 249 CodeStubInterfaceDescriptor* descriptor) { |
| 250 // cp: context |
| 232 // x0: value | 251 // x0: value |
| 233 Register registers[] = { x0 }; | 252 Register registers[] = { cp, x0 }; |
| 234 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 253 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 235 FUNCTION_ADDR(ToBooleanIC_Miss)); | 254 FUNCTION_ADDR(ToBooleanIC_Miss)); |
| 236 descriptor->SetMissHandler( | 255 descriptor->SetMissHandler( |
| 237 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); | 256 ExternalReference(IC_Utility(IC::kToBooleanIC_Miss), isolate())); |
| 238 } | 257 } |
| 239 | 258 |
| 240 | 259 |
| 241 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( | 260 void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor( |
| 242 CodeStubInterfaceDescriptor* descriptor) { | 261 CodeStubInterfaceDescriptor* descriptor) { |
| 262 // cp: context |
| 243 // x0: value | 263 // x0: value |
| 244 // x3: target map | 264 // x3: target map |
| 245 // x1: key | 265 // x1: key |
| 246 // x2: receiver | 266 // x2: receiver |
| 247 Register registers[] = { x0, x3, x1, x2 }; | 267 Register registers[] = { cp, x0, x3, x1, x2 }; |
| 248 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 268 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 249 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); | 269 FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss)); |
| 250 } | 270 } |
| 251 | 271 |
| 252 | 272 |
| 253 void BinaryOpICStub::InitializeInterfaceDescriptor( | 273 void BinaryOpICStub::InitializeInterfaceDescriptor( |
| 254 CodeStubInterfaceDescriptor* descriptor) { | 274 CodeStubInterfaceDescriptor* descriptor) { |
| 275 // cp: context |
| 255 // x1: left operand | 276 // x1: left operand |
| 256 // x0: right operand | 277 // x0: right operand |
| 257 Register registers[] = { x1, x0 }; | 278 Register registers[] = { cp, x1, x0 }; |
| 258 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 279 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 259 FUNCTION_ADDR(BinaryOpIC_Miss)); | 280 FUNCTION_ADDR(BinaryOpIC_Miss)); |
| 260 descriptor->SetMissHandler( | 281 descriptor->SetMissHandler( |
| 261 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); | 282 ExternalReference(IC_Utility(IC::kBinaryOpIC_Miss), isolate())); |
| 262 } | 283 } |
| 263 | 284 |
| 264 | 285 |
| 265 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( | 286 void BinaryOpWithAllocationSiteStub::InitializeInterfaceDescriptor( |
| 266 CodeStubInterfaceDescriptor* descriptor) { | 287 CodeStubInterfaceDescriptor* descriptor) { |
| 288 // cp: context |
| 267 // x2: allocation site | 289 // x2: allocation site |
| 268 // x1: left operand | 290 // x1: left operand |
| 269 // x0: right operand | 291 // x0: right operand |
| 270 Register registers[] = { x2, x1, x0 }; | 292 Register registers[] = { cp, x2, x1, x0 }; |
| 271 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 293 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 272 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); | 294 FUNCTION_ADDR(BinaryOpIC_MissWithAllocationSite)); |
| 273 } | 295 } |
| 274 | 296 |
| 275 | 297 |
| 276 void StringAddStub::InitializeInterfaceDescriptor( | 298 void StringAddStub::InitializeInterfaceDescriptor( |
| 277 CodeStubInterfaceDescriptor* descriptor) { | 299 CodeStubInterfaceDescriptor* descriptor) { |
| 300 // cp: context |
| 278 // x1: left operand | 301 // x1: left operand |
| 279 // x0: right operand | 302 // x0: right operand |
| 280 Register registers[] = { x1, x0 }; | 303 Register registers[] = { cp, x1, x0 }; |
| 281 descriptor->Initialize( | 304 descriptor->Initialize( |
| 282 ARRAY_SIZE(registers), registers, | 305 ARRAY_SIZE(registers), registers, |
| 283 Runtime::FunctionForId(Runtime::kStringAdd)->entry); | 306 Runtime::FunctionForId(Runtime::kStringAdd)->entry); |
| 284 } | 307 } |
| 285 | 308 |
| 286 | 309 |
| 287 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { | 310 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 288 static PlatformCallInterfaceDescriptor default_descriptor = | 311 static PlatformInterfaceDescriptor default_descriptor = |
| 289 PlatformCallInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); | 312 PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
| 290 | 313 |
| 291 static PlatformCallInterfaceDescriptor noInlineDescriptor = | 314 static PlatformInterfaceDescriptor noInlineDescriptor = |
| 292 PlatformCallInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); | 315 PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
| 293 | 316 |
| 294 { | 317 { |
| 295 CallInterfaceDescriptor* descriptor = | 318 CallInterfaceDescriptor* descriptor = |
| 296 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); | 319 isolate->call_descriptor(Isolate::ArgumentAdaptorCall); |
| 297 Register registers[] = { x1, // JSFunction | 320 Register registers[] = { cp, // context |
| 298 cp, // context | 321 x1, // JSFunction |
| 299 x0, // actual number of arguments | 322 x0, // actual number of arguments |
| 300 x2, // expected number of arguments | 323 x2, // expected number of arguments |
| 301 }; | 324 }; |
| 302 Representation representations[] = { | 325 Representation representations[] = { |
| 326 Representation::Tagged(), // context |
| 303 Representation::Tagged(), // JSFunction | 327 Representation::Tagged(), // JSFunction |
| 304 Representation::Tagged(), // context | |
| 305 Representation::Integer32(), // actual number of arguments | 328 Representation::Integer32(), // actual number of arguments |
| 306 Representation::Integer32(), // expected number of arguments | 329 Representation::Integer32(), // expected number of arguments |
| 307 }; | 330 }; |
| 308 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 331 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 309 representations, &default_descriptor); | 332 representations, &default_descriptor); |
| 310 } | 333 } |
| 311 { | 334 { |
| 312 CallInterfaceDescriptor* descriptor = | 335 CallInterfaceDescriptor* descriptor = |
| 313 isolate->call_descriptor(Isolate::KeyedCall); | 336 isolate->call_descriptor(Isolate::KeyedCall); |
| 314 Register registers[] = { cp, // context | 337 Register registers[] = { cp, // context |
| (...skipping 28 matching lines...) Expand all Loading... |
| 343 Representation representations[] = { | 366 Representation representations[] = { |
| 344 Representation::Tagged(), // context | 367 Representation::Tagged(), // context |
| 345 Representation::Tagged(), // receiver | 368 Representation::Tagged(), // receiver |
| 346 }; | 369 }; |
| 347 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 370 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 348 representations, &default_descriptor); | 371 representations, &default_descriptor); |
| 349 } | 372 } |
| 350 { | 373 { |
| 351 CallInterfaceDescriptor* descriptor = | 374 CallInterfaceDescriptor* descriptor = |
| 352 isolate->call_descriptor(Isolate::ApiFunctionCall); | 375 isolate->call_descriptor(Isolate::ApiFunctionCall); |
| 353 Register registers[] = { x0, // callee | 376 Register registers[] = { cp, // context |
| 377 x0, // callee |
| 354 x4, // call_data | 378 x4, // call_data |
| 355 x2, // holder | 379 x2, // holder |
| 356 x1, // api_function_address | 380 x1, // api_function_address |
| 357 cp, // context | |
| 358 }; | 381 }; |
| 359 Representation representations[] = { | 382 Representation representations[] = { |
| 383 Representation::Tagged(), // context |
| 360 Representation::Tagged(), // callee | 384 Representation::Tagged(), // callee |
| 361 Representation::Tagged(), // call_data | 385 Representation::Tagged(), // call_data |
| 362 Representation::Tagged(), // holder | 386 Representation::Tagged(), // holder |
| 363 Representation::External(), // api_function_address | 387 Representation::External(), // api_function_address |
| 364 Representation::Tagged(), // context | |
| 365 }; | 388 }; |
| 366 descriptor->Initialize(ARRAY_SIZE(registers), registers, | 389 descriptor->Initialize(ARRAY_SIZE(registers), registers, |
| 367 representations, &default_descriptor); | 390 representations, &default_descriptor); |
| 368 } | 391 } |
| 369 } | 392 } |
| 370 | 393 |
| 371 | 394 |
| 372 #define __ ACCESS_MASM(masm) | 395 #define __ ACCESS_MASM(masm) |
| 373 | 396 |
| 374 | 397 |
| 375 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { | 398 void HydrogenCodeStub::GenerateLightweightMiss(MacroAssembler* masm) { |
| 376 // Update the static counter each time a new code stub is generated. | 399 // Update the static counter each time a new code stub is generated. |
| 377 isolate()->counters()->code_stubs()->Increment(); | 400 isolate()->counters()->code_stubs()->Increment(); |
| 378 | 401 |
| 379 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); | 402 CodeStubInterfaceDescriptor* descriptor = GetInterfaceDescriptor(); |
| 380 int param_count = descriptor->register_param_count(); | 403 int param_count = descriptor->GetEnvironmentParameterCount(); |
| 381 { | 404 { |
| 382 // Call the runtime system in a fresh internal frame. | 405 // Call the runtime system in a fresh internal frame. |
| 383 FrameScope scope(masm, StackFrame::INTERNAL); | 406 FrameScope scope(masm, StackFrame::INTERNAL); |
| 384 ASSERT((descriptor->register_param_count() == 0) || | 407 ASSERT((param_count == 0) || |
| 385 x0.Is(descriptor->GetParameterRegister(param_count - 1))); | 408 x0.Is(descriptor->GetEnvironmentParameterRegister(param_count - 1))); |
| 386 | 409 |
| 387 // Push arguments | 410 // Push arguments |
| 388 MacroAssembler::PushPopQueue queue(masm); | 411 MacroAssembler::PushPopQueue queue(masm); |
| 389 for (int i = 0; i < param_count; ++i) { | 412 for (int i = 0; i < param_count; ++i) { |
| 390 queue.Queue(descriptor->GetParameterRegister(i)); | 413 queue.Queue(descriptor->GetEnvironmentParameterRegister(i)); |
| 391 } | 414 } |
| 392 queue.PushQueued(); | 415 queue.PushQueued(); |
| 393 | 416 |
| 394 ExternalReference miss = descriptor->miss_handler(); | 417 ExternalReference miss = descriptor->miss_handler(); |
| 395 __ CallExternalReference(miss, descriptor->register_param_count()); | 418 __ CallExternalReference(miss, param_count); |
| 396 } | 419 } |
| 397 | 420 |
| 398 __ Ret(); | 421 __ Ret(); |
| 399 } | 422 } |
| 400 | 423 |
| 401 | 424 |
| 402 void DoubleToIStub::Generate(MacroAssembler* masm) { | 425 void DoubleToIStub::Generate(MacroAssembler* masm) { |
| 403 Label done; | 426 Label done; |
| 404 Register input = source(); | 427 Register input = source(); |
| 405 Register result = destination(); | 428 Register result = destination(); |
| (...skipping 4997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5403 MemOperand(fp, 6 * kPointerSize), | 5426 MemOperand(fp, 6 * kPointerSize), |
| 5404 NULL); | 5427 NULL); |
| 5405 } | 5428 } |
| 5406 | 5429 |
| 5407 | 5430 |
| 5408 #undef __ | 5431 #undef __ |
| 5409 | 5432 |
| 5410 } } // namespace v8::internal | 5433 } } // namespace v8::internal |
| 5411 | 5434 |
| 5412 #endif // V8_TARGET_ARCH_ARM64 | 5435 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |