| 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/interface-descriptors.h" | 5 #include "src/interface-descriptors.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 void VoidDescriptor::InitializePlatformSpecific( | 77 void VoidDescriptor::InitializePlatformSpecific( |
| 78 CallInterfaceDescriptorData* data) { | 78 CallInterfaceDescriptorData* data) { |
| 79 data->InitializePlatformSpecific(0, nullptr); | 79 data->InitializePlatformSpecific(0, nullptr); |
| 80 } | 80 } |
| 81 | 81 |
| 82 FunctionType* LoadDescriptor::BuildCallInterfaceDescriptorFunctionType( | 82 FunctionType* LoadDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 83 Isolate* isolate, int parameter_count) { | 83 Isolate* isolate, int parameter_count) { |
| 84 Zone* zone = isolate->interface_descriptor_zone(); | 84 Zone* zone = isolate->interface_descriptor_zone(); |
| 85 FunctionType* function = | 85 FunctionType* function = |
| 86 Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction(); | 86 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 87 function->InitParameter(0, AnyTagged(zone)); | 87 ->AsFunction(); |
| 88 function->InitParameter(1, AnyTagged(zone)); | 88 function->InitParameter(kReceiver, AnyTagged(zone)); |
| 89 function->InitParameter(2, SmiType(zone)); | 89 function->InitParameter(kName, AnyTagged(zone)); |
| 90 function->InitParameter(kSlot, SmiType(zone)); |
| 90 return function; | 91 return function; |
| 91 } | 92 } |
| 92 | 93 |
| 93 | 94 |
| 94 void LoadDescriptor::InitializePlatformSpecific( | 95 void LoadDescriptor::InitializePlatformSpecific( |
| 95 CallInterfaceDescriptorData* data) { | 96 CallInterfaceDescriptorData* data) { |
| 96 Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister()}; | 97 Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister()}; |
| 97 data->InitializePlatformSpecific(arraysize(registers), registers); | 98 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 98 } | 99 } |
| 99 | 100 |
| 100 FunctionType* LoadGlobalDescriptor::BuildCallInterfaceDescriptorFunctionType( | 101 FunctionType* LoadGlobalDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 101 Isolate* isolate, int parameter_count) { | 102 Isolate* isolate, int parameter_count) { |
| 102 Zone* zone = isolate->interface_descriptor_zone(); | 103 Zone* zone = isolate->interface_descriptor_zone(); |
| 103 FunctionType* function = | 104 FunctionType* function = |
| 104 Type::Function(AnyTagged(zone), Type::Undefined(), 1, zone)->AsFunction(); | 105 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 105 function->InitParameter(0, SmiType(zone)); | 106 ->AsFunction(); |
| 107 function->InitParameter(kSlot, SmiType(zone)); |
| 106 return function; | 108 return function; |
| 107 } | 109 } |
| 108 | 110 |
| 109 void LoadGlobalDescriptor::InitializePlatformSpecific( | 111 void LoadGlobalDescriptor::InitializePlatformSpecific( |
| 110 CallInterfaceDescriptorData* data) { | 112 CallInterfaceDescriptorData* data) { |
| 111 Register registers[] = {LoadWithVectorDescriptor::SlotRegister()}; | 113 Register registers[] = {LoadWithVectorDescriptor::SlotRegister()}; |
| 112 data->InitializePlatformSpecific(arraysize(registers), registers); | 114 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 113 } | 115 } |
| 114 | 116 |
| 115 FunctionType* | 117 FunctionType* |
| 116 LoadGlobalWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType( | 118 LoadGlobalWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 117 Isolate* isolate, int parameter_count) { | 119 Isolate* isolate, int parameter_count) { |
| 118 Zone* zone = isolate->interface_descriptor_zone(); | 120 Zone* zone = isolate->interface_descriptor_zone(); |
| 119 FunctionType* function = | 121 FunctionType* function = |
| 120 Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction(); | 122 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 121 function->InitParameter(0, SmiType(zone)); | 123 ->AsFunction(); |
| 122 function->InitParameter(1, AnyTagged(zone)); | 124 function->InitParameter(kSlot, SmiType(zone)); |
| 125 function->InitParameter(kVector, AnyTagged(zone)); |
| 123 return function; | 126 return function; |
| 124 } | 127 } |
| 125 | 128 |
| 126 void LoadGlobalWithVectorDescriptor::InitializePlatformSpecific( | 129 void LoadGlobalWithVectorDescriptor::InitializePlatformSpecific( |
| 127 CallInterfaceDescriptorData* data) { | 130 CallInterfaceDescriptorData* data) { |
| 128 Register registers[] = {LoadWithVectorDescriptor::SlotRegister(), | 131 Register registers[] = {LoadWithVectorDescriptor::SlotRegister(), |
| 129 LoadWithVectorDescriptor::VectorRegister()}; | 132 LoadWithVectorDescriptor::VectorRegister()}; |
| 130 data->InitializePlatformSpecific(arraysize(registers), registers); | 133 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 131 } | 134 } |
| 132 | 135 |
| 133 FunctionType* StoreDescriptor::BuildCallInterfaceDescriptorFunctionType( | 136 FunctionType* StoreDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 134 Isolate* isolate, int parameter_count) { | 137 Isolate* isolate, int parameter_count) { |
| 135 Zone* zone = isolate->interface_descriptor_zone(); | 138 Zone* zone = isolate->interface_descriptor_zone(); |
| 136 FunctionType* function = | 139 FunctionType* function = |
| 137 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 140 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 138 function->InitParameter(0, AnyTagged(zone)); | 141 ->AsFunction(); |
| 139 function->InitParameter(1, AnyTagged(zone)); | 142 function->InitParameter(kReceiver, AnyTagged(zone)); |
| 140 function->InitParameter(2, AnyTagged(zone)); | 143 function->InitParameter(kName, AnyTagged(zone)); |
| 141 function->InitParameter(3, SmiType(zone)); | 144 function->InitParameter(kValue, AnyTagged(zone)); |
| 145 function->InitParameter(kSlot, SmiType(zone)); |
| 142 return function; | 146 return function; |
| 143 } | 147 } |
| 144 | 148 |
| 145 void StoreDescriptor::InitializePlatformSpecific( | 149 void StoreDescriptor::InitializePlatformSpecific( |
| 146 CallInterfaceDescriptorData* data) { | 150 CallInterfaceDescriptorData* data) { |
| 147 Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(), | 151 Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(), |
| 148 SlotRegister()}; | 152 SlotRegister()}; |
| 149 data->InitializePlatformSpecific(arraysize(registers), registers); | 153 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 150 } | 154 } |
| 151 | 155 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 171 SlotRegister(), VectorRegister()}; | 175 SlotRegister(), VectorRegister()}; |
| 172 data->InitializePlatformSpecific(arraysize(registers), registers); | 176 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 173 } | 177 } |
| 174 } | 178 } |
| 175 | 179 |
| 176 FunctionType* | 180 FunctionType* |
| 177 StoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType( | 181 StoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 178 Isolate* isolate, int parameter_count) { | 182 Isolate* isolate, int parameter_count) { |
| 179 Zone* zone = isolate->interface_descriptor_zone(); | 183 Zone* zone = isolate->interface_descriptor_zone(); |
| 180 FunctionType* function = | 184 FunctionType* function = |
| 181 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 185 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 182 function->InitParameter(0, AnyTagged(zone)); // Receiver | 186 ->AsFunction(); |
| 183 function->InitParameter(1, AnyTagged(zone)); // Name | 187 function->InitParameter(kReceiver, AnyTagged(zone)); |
| 184 function->InitParameter(2, AnyTagged(zone)); // Value | 188 function->InitParameter(kName, AnyTagged(zone)); |
| 185 function->InitParameter(3, AnyTagged(zone)); // Map | 189 function->InitParameter(kValue, AnyTagged(zone)); |
| 190 function->InitParameter(kMap, AnyTagged(zone)); |
| 186 return function; | 191 return function; |
| 187 } | 192 } |
| 188 | 193 |
| 189 FunctionType* | 194 FunctionType* |
| 190 StoreGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType( | 195 StoreGlobalViaContextDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 191 Isolate* isolate, int parameter_count) { | 196 Isolate* isolate, int parameter_count) { |
| 192 Zone* zone = isolate->interface_descriptor_zone(); | 197 Zone* zone = isolate->interface_descriptor_zone(); |
| 193 FunctionType* function = | 198 FunctionType* function = |
| 194 Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction(); | 199 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 195 function->InitParameter(0, UntaggedIntegral32(zone)); | 200 ->AsFunction(); |
| 196 function->InitParameter(1, AnyTagged(zone)); | 201 function->InitParameter(kSlot, UntaggedIntegral32(zone)); |
| 202 function->InitParameter(kValue, AnyTagged(zone)); |
| 197 return function; | 203 return function; |
| 198 } | 204 } |
| 199 | 205 |
| 200 | 206 |
| 201 void StoreGlobalViaContextDescriptor::InitializePlatformSpecific( | 207 void StoreGlobalViaContextDescriptor::InitializePlatformSpecific( |
| 202 CallInterfaceDescriptorData* data) { | 208 CallInterfaceDescriptorData* data) { |
| 203 Register registers[] = {SlotRegister(), ValueRegister()}; | 209 Register registers[] = {SlotRegister(), ValueRegister()}; |
| 204 data->InitializePlatformSpecific(arraysize(registers), registers); | 210 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 205 } | 211 } |
| 206 | 212 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 227 CallInterfaceDescriptorData* data) { | 233 CallInterfaceDescriptorData* data) { |
| 228 Register registers[] = {exponent()}; | 234 Register registers[] = {exponent()}; |
| 229 data->InitializePlatformSpecific(arraysize(registers), registers); | 235 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 230 } | 236 } |
| 231 | 237 |
| 232 FunctionType* | 238 FunctionType* |
| 233 LoadWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType( | 239 LoadWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 234 Isolate* isolate, int parameter_count) { | 240 Isolate* isolate, int parameter_count) { |
| 235 Zone* zone = isolate->interface_descriptor_zone(); | 241 Zone* zone = isolate->interface_descriptor_zone(); |
| 236 FunctionType* function = | 242 FunctionType* function = |
| 237 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 243 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 238 function->InitParameter(0, AnyTagged(zone)); | 244 ->AsFunction(); |
| 239 function->InitParameter(1, AnyTagged(zone)); | 245 function->InitParameter(kReceiver, AnyTagged(zone)); |
| 240 function->InitParameter(2, SmiType(zone)); | 246 function->InitParameter(kName, AnyTagged(zone)); |
| 241 function->InitParameter(3, AnyTagged(zone)); | 247 function->InitParameter(kSlot, SmiType(zone)); |
| 248 function->InitParameter(kVector, AnyTagged(zone)); |
| 242 return function; | 249 return function; |
| 243 } | 250 } |
| 244 | 251 |
| 245 | 252 |
| 246 void LoadWithVectorDescriptor::InitializePlatformSpecific( | 253 void LoadWithVectorDescriptor::InitializePlatformSpecific( |
| 247 CallInterfaceDescriptorData* data) { | 254 CallInterfaceDescriptorData* data) { |
| 248 Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister(), | 255 Register registers[] = {ReceiverRegister(), NameRegister(), SlotRegister(), |
| 249 VectorRegister()}; | 256 VectorRegister()}; |
| 250 data->InitializePlatformSpecific(arraysize(registers), registers); | 257 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 251 } | 258 } |
| 252 | 259 |
| 253 FunctionType* | 260 FunctionType* |
| 254 VectorStoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType( | 261 VectorStoreTransitionDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 255 Isolate* isolate, int parameter_count) { | 262 Isolate* isolate, int parameter_count) { |
| 256 Zone* zone = isolate->interface_descriptor_zone(); | 263 Zone* zone = isolate->interface_descriptor_zone(); |
| 257 bool has_slot = !VectorStoreTransitionDescriptor::SlotRegister().is(no_reg); | 264 bool has_slot = !VectorStoreTransitionDescriptor::SlotRegister().is(no_reg); |
| 258 int arg_count = has_slot ? 6 : 5; | 265 int arg_count = has_slot ? 6 : 5; |
| 259 FunctionType* function = | 266 FunctionType* function = |
| 260 Type::Function(AnyTagged(zone), Type::Undefined(), arg_count, zone) | 267 Type::Function(AnyTagged(zone), Type::Undefined(), arg_count, zone) |
| 261 ->AsFunction(); | 268 ->AsFunction(); |
| 262 int index = 0; | 269 int index = 0; |
| 270 // TODO(ishell): use ParameterIndices here |
| 263 function->InitParameter(index++, AnyTagged(zone)); // receiver | 271 function->InitParameter(index++, AnyTagged(zone)); // receiver |
| 264 function->InitParameter(index++, AnyTagged(zone)); // name | 272 function->InitParameter(index++, AnyTagged(zone)); // name |
| 265 function->InitParameter(index++, AnyTagged(zone)); // value | 273 function->InitParameter(index++, AnyTagged(zone)); // value |
| 266 function->InitParameter(index++, AnyTagged(zone)); // map | 274 function->InitParameter(index++, AnyTagged(zone)); // map |
| 267 if (has_slot) { | 275 if (has_slot) { |
| 268 function->InitParameter(index++, SmiType(zone)); // slot | 276 function->InitParameter(index++, SmiType(zone)); // slot |
| 269 } | 277 } |
| 270 function->InitParameter(index++, AnyTagged(zone)); // vector | 278 function->InitParameter(index++, AnyTagged(zone)); // vector |
| 271 return function; | 279 return function; |
| 272 } | 280 } |
| 273 | 281 |
| 274 FunctionType* | 282 FunctionType* |
| 275 StoreWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType( | 283 StoreWithVectorDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 276 Isolate* isolate, int parameter_count) { | 284 Isolate* isolate, int parameter_count) { |
| 277 Zone* zone = isolate->interface_descriptor_zone(); | 285 Zone* zone = isolate->interface_descriptor_zone(); |
| 278 FunctionType* function = | 286 FunctionType* function = |
| 279 Type::Function(AnyTagged(zone), Type::Undefined(), 5, zone)->AsFunction(); | 287 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 280 function->InitParameter(0, AnyTagged(zone)); | 288 ->AsFunction(); |
| 281 function->InitParameter(1, AnyTagged(zone)); | 289 function->InitParameter(kReceiver, AnyTagged(zone)); |
| 282 function->InitParameter(2, AnyTagged(zone)); | 290 function->InitParameter(kName, AnyTagged(zone)); |
| 283 function->InitParameter(3, SmiType(zone)); | 291 function->InitParameter(kValue, AnyTagged(zone)); |
| 284 function->InitParameter(4, AnyTagged(zone)); | 292 function->InitParameter(kSlot, SmiType(zone)); |
| 293 function->InitParameter(kVector, AnyTagged(zone)); |
| 285 return function; | 294 return function; |
| 286 } | 295 } |
| 287 | 296 |
| 288 void StoreWithVectorDescriptor::InitializePlatformSpecific( | 297 void StoreWithVectorDescriptor::InitializePlatformSpecific( |
| 289 CallInterfaceDescriptorData* data) { | 298 CallInterfaceDescriptorData* data) { |
| 290 Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(), | 299 Register registers[] = {ReceiverRegister(), NameRegister(), ValueRegister(), |
| 291 SlotRegister(), VectorRegister()}; | 300 SlotRegister(), VectorRegister()}; |
| 292 data->InitializePlatformSpecific(arraysize(registers), registers); | 301 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 293 } | 302 } |
| 294 | 303 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 CallInterfaceDescriptorData* data) { | 364 CallInterfaceDescriptorData* data) { |
| 356 Register registers[] = {ObjectRegister(), KeyRegister()}; | 365 Register registers[] = {ObjectRegister(), KeyRegister()}; |
| 357 data->InitializePlatformSpecific(arraysize(registers), registers); | 366 data->InitializePlatformSpecific(arraysize(registers), registers); |
| 358 } | 367 } |
| 359 | 368 |
| 360 FunctionType* | 369 FunctionType* |
| 361 VarArgFunctionDescriptor::BuildCallInterfaceDescriptorFunctionType( | 370 VarArgFunctionDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 362 Isolate* isolate, int parameter_count) { | 371 Isolate* isolate, int parameter_count) { |
| 363 Zone* zone = isolate->interface_descriptor_zone(); | 372 Zone* zone = isolate->interface_descriptor_zone(); |
| 364 FunctionType* function = | 373 FunctionType* function = |
| 365 Type::Function(AnyTagged(zone), AnyTagged(zone), 1, zone)->AsFunction(); | 374 Type::Function(AnyTagged(zone), AnyTagged(zone), kParameterCount, zone) |
| 366 function->InitParameter(0, UntaggedIntegral32(zone)); // actual #arguments | 375 ->AsFunction(); |
| 376 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 367 return function; | 377 return function; |
| 368 } | 378 } |
| 369 | 379 |
| 370 FunctionType* | 380 FunctionType* |
| 371 FastCloneRegExpDescriptor::BuildCallInterfaceDescriptorFunctionType( | 381 FastCloneRegExpDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 372 Isolate* isolate, int parameter_count) { | 382 Isolate* isolate, int parameter_count) { |
| 373 Zone* zone = isolate->interface_descriptor_zone(); | 383 Zone* zone = isolate->interface_descriptor_zone(); |
| 374 FunctionType* function = | 384 FunctionType* function = |
| 375 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 385 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 376 function->InitParameter(0, AnyTagged(zone)); // closure | 386 ->AsFunction(); |
| 377 function->InitParameter(1, SmiType(zone)); // literal_index | 387 function->InitParameter(kClosure, AnyTagged(zone)); |
| 378 function->InitParameter(2, AnyTagged(zone)); // pattern | 388 function->InitParameter(kLiteralIndex, SmiType(zone)); |
| 379 function->InitParameter(3, AnyTagged(zone)); // flags | 389 function->InitParameter(kPattern, AnyTagged(zone)); |
| 390 function->InitParameter(kFlags, AnyTagged(zone)); |
| 380 return function; | 391 return function; |
| 381 } | 392 } |
| 382 | 393 |
| 383 FunctionType* | 394 FunctionType* |
| 384 FastCloneShallowArrayDescriptor::BuildCallInterfaceDescriptorFunctionType( | 395 FastCloneShallowArrayDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 385 Isolate* isolate, int parameter_count) { | 396 Isolate* isolate, int parameter_count) { |
| 386 Zone* zone = isolate->interface_descriptor_zone(); | 397 Zone* zone = isolate->interface_descriptor_zone(); |
| 387 FunctionType* function = | 398 FunctionType* function = |
| 388 Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction(); | 399 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 389 function->InitParameter(0, AnyTagged(zone)); | 400 ->AsFunction(); |
| 390 function->InitParameter(1, SmiType(zone)); | 401 function->InitParameter(kClosure, AnyTagged(zone)); |
| 391 function->InitParameter(2, AnyTagged(zone)); | 402 function->InitParameter(kLiteralIndex, SmiType(zone)); |
| 403 function->InitParameter(kConstantElements, AnyTagged(zone)); |
| 392 return function; | 404 return function; |
| 393 } | 405 } |
| 394 | 406 |
| 395 FunctionType* | 407 FunctionType* |
| 396 CreateAllocationSiteDescriptor::BuildCallInterfaceDescriptorFunctionType( | 408 CreateAllocationSiteDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 397 Isolate* isolate, int parameter_count) { | 409 Isolate* isolate, int parameter_count) { |
| 398 Zone* zone = isolate->interface_descriptor_zone(); | 410 Zone* zone = isolate->interface_descriptor_zone(); |
| 399 FunctionType* function = | 411 FunctionType* function = |
| 400 Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction(); | 412 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 401 function->InitParameter(0, AnyTagged(zone)); | 413 ->AsFunction(); |
| 402 function->InitParameter(1, SmiType(zone)); | 414 function->InitParameter(kVector, AnyTagged(zone)); |
| 415 function->InitParameter(kSlot, SmiType(zone)); |
| 403 return function; | 416 return function; |
| 404 } | 417 } |
| 405 | 418 |
| 406 FunctionType* | 419 FunctionType* |
| 407 CreateWeakCellDescriptor::BuildCallInterfaceDescriptorFunctionType( | 420 CreateWeakCellDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 408 Isolate* isolate, int parameter_count) { | 421 Isolate* isolate, int parameter_count) { |
| 409 Zone* zone = isolate->interface_descriptor_zone(); | 422 Zone* zone = isolate->interface_descriptor_zone(); |
| 410 FunctionType* function = | 423 FunctionType* function = |
| 411 Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction(); | 424 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 412 function->InitParameter(0, AnyTagged(zone)); | 425 ->AsFunction(); |
| 413 function->InitParameter(1, SmiType(zone)); | 426 function->InitParameter(kVector, AnyTagged(zone)); |
| 414 function->InitParameter(2, AnyTagged(zone)); | 427 function->InitParameter(kSlot, SmiType(zone)); |
| 428 function->InitParameter(kValue, AnyTagged(zone)); |
| 415 return function; | 429 return function; |
| 416 } | 430 } |
| 417 | 431 |
| 418 FunctionType* | 432 FunctionType* |
| 419 CallTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType( | 433 CallTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 420 Isolate* isolate, int parameter_count) { | 434 Isolate* isolate, int parameter_count) { |
| 421 Zone* zone = isolate->interface_descriptor_zone(); | 435 Zone* zone = isolate->interface_descriptor_zone(); |
| 422 FunctionType* function = | 436 FunctionType* function = |
| 423 Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction(); | 437 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 424 function->InitParameter(0, AnyTagged(zone)); // target | 438 ->AsFunction(); |
| 425 function->InitParameter(1, UntaggedIntegral32(zone)); // actual #arguments | 439 function->InitParameter(kFunction, AnyTagged(zone)); |
| 440 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 426 return function; | 441 return function; |
| 427 } | 442 } |
| 428 | 443 |
| 429 FunctionType* ConstructStubDescriptor::BuildCallInterfaceDescriptorFunctionType( | 444 FunctionType* ConstructStubDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 430 Isolate* isolate, int parameter_count) { | 445 Isolate* isolate, int parameter_count) { |
| 431 Zone* zone = isolate->interface_descriptor_zone(); | 446 Zone* zone = isolate->interface_descriptor_zone(); |
| 432 FunctionType* function = | 447 FunctionType* function = |
| 433 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 448 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 434 function->InitParameter(0, AnyTagged(zone)); // target | 449 ->AsFunction(); |
| 435 function->InitParameter(1, AnyTagged(zone)); // new.target | 450 function->InitParameter(kFunction, AnyTagged(zone)); |
| 436 function->InitParameter(2, UntaggedIntegral32(zone)); // actual #arguments | 451 function->InitParameter(kNewTarget, AnyTagged(zone)); |
| 437 function->InitParameter(3, AnyTagged(zone)); // opt. allocation site | 452 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 453 function->InitParameter(kAllocationSite, AnyTagged(zone)); |
| 438 return function; | 454 return function; |
| 439 } | 455 } |
| 440 | 456 |
| 441 FunctionType* | 457 FunctionType* |
| 442 ConstructTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType( | 458 ConstructTrampolineDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 443 Isolate* isolate, int parameter_count) { | 459 Isolate* isolate, int parameter_count) { |
| 444 Zone* zone = isolate->interface_descriptor_zone(); | 460 Zone* zone = isolate->interface_descriptor_zone(); |
| 445 FunctionType* function = | 461 FunctionType* function = |
| 446 Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction(); | 462 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 447 function->InitParameter(0, AnyTagged(zone)); // target | 463 ->AsFunction(); |
| 448 function->InitParameter(1, AnyTagged(zone)); // new.target | 464 function->InitParameter(kFunction, AnyTagged(zone)); |
| 449 function->InitParameter(2, UntaggedIntegral32(zone)); // actual #arguments | 465 function->InitParameter(kNewTarget, AnyTagged(zone)); |
| 466 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 450 return function; | 467 return function; |
| 451 } | 468 } |
| 452 | 469 |
| 453 FunctionType* | 470 FunctionType* |
| 454 CallFunctionWithFeedbackDescriptor::BuildCallInterfaceDescriptorFunctionType( | 471 CallFunctionWithFeedbackDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 455 Isolate* isolate, int parameter_count) { | 472 Isolate* isolate, int parameter_count) { |
| 456 Zone* zone = isolate->interface_descriptor_zone(); | 473 Zone* zone = isolate->interface_descriptor_zone(); |
| 457 FunctionType* function = | 474 FunctionType* function = |
| 458 Type::Function(AnyTagged(zone), Type::Undefined(), 2, zone)->AsFunction(); | 475 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 459 function->InitParameter(0, Type::Receiver()); // JSFunction | 476 ->AsFunction(); |
| 460 function->InitParameter(1, SmiType(zone)); | 477 function->InitParameter(kFunction, Type::Receiver()); |
| 478 function->InitParameter(kSlot, SmiType(zone)); |
| 461 return function; | 479 return function; |
| 462 } | 480 } |
| 463 | 481 |
| 464 FunctionType* CallFunctionWithFeedbackAndVectorDescriptor:: | 482 FunctionType* CallFunctionWithFeedbackAndVectorDescriptor:: |
| 465 BuildCallInterfaceDescriptorFunctionType(Isolate* isolate, | 483 BuildCallInterfaceDescriptorFunctionType(Isolate* isolate, |
| 466 int parameter_count) { | 484 int parameter_count) { |
| 467 Zone* zone = isolate->interface_descriptor_zone(); | 485 Zone* zone = isolate->interface_descriptor_zone(); |
| 468 FunctionType* function = | 486 FunctionType* function = |
| 469 Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction(); | 487 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 470 function->InitParameter(0, Type::Receiver()); // JSFunction | 488 ->AsFunction(); |
| 471 function->InitParameter(1, SmiType(zone)); | 489 function->InitParameter(kFunction, Type::Receiver()); |
| 472 function->InitParameter(2, AnyTagged(zone)); | 490 function->InitParameter(kSlot, SmiType(zone)); |
| 491 function->InitParameter(kVector, AnyTagged(zone)); |
| 473 return function; | 492 return function; |
| 474 } | 493 } |
| 475 | 494 |
| 476 FunctionType* | 495 FunctionType* |
| 477 ArrayNoArgumentConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType( | 496 ArrayNoArgumentConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 478 Isolate* isolate, int parameter_count) { | 497 Isolate* isolate, int parameter_count) { |
| 479 Zone* zone = isolate->interface_descriptor_zone(); | 498 Zone* zone = isolate->interface_descriptor_zone(); |
| 480 FunctionType* function = | 499 FunctionType* function = |
| 481 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 500 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 482 function->InitParameter(0, Type::Receiver()); // JSFunction | 501 ->AsFunction(); |
| 483 function->InitParameter(1, AnyTagged(zone)); | 502 function->InitParameter(kFunction, Type::Receiver()); |
| 484 function->InitParameter(2, UntaggedIntegral32(zone)); | 503 function->InitParameter(kAllocationSite, AnyTagged(zone)); |
| 485 function->InitParameter(3, AnyTagged(zone)); | 504 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 505 function->InitParameter(kFunctionParameter, AnyTagged(zone)); |
| 486 return function; | 506 return function; |
| 487 } | 507 } |
| 488 | 508 |
| 489 FunctionType* ArraySingleArgumentConstructorDescriptor:: | 509 FunctionType* ArraySingleArgumentConstructorDescriptor:: |
| 490 BuildCallInterfaceDescriptorFunctionType(Isolate* isolate, | 510 BuildCallInterfaceDescriptorFunctionType(Isolate* isolate, |
| 491 int parameter_count) { | 511 int parameter_count) { |
| 492 Zone* zone = isolate->interface_descriptor_zone(); | 512 Zone* zone = isolate->interface_descriptor_zone(); |
| 493 FunctionType* function = | 513 FunctionType* function = |
| 494 Type::Function(AnyTagged(zone), Type::Undefined(), 5, zone)->AsFunction(); | 514 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 495 function->InitParameter(0, Type::Receiver()); // JSFunction | 515 ->AsFunction(); |
| 496 function->InitParameter(1, AnyTagged(zone)); | 516 function->InitParameter(kFunction, Type::Receiver()); |
| 497 function->InitParameter(2, UntaggedIntegral32(zone)); | 517 function->InitParameter(kAllocationSite, AnyTagged(zone)); |
| 498 function->InitParameter(3, AnyTagged(zone)); | 518 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 499 function->InitParameter(4, AnyTagged(zone)); | 519 function->InitParameter(kFunctionParameter, AnyTagged(zone)); |
| 520 function->InitParameter(kArraySizeSmiParameter, AnyTagged(zone)); |
| 500 return function; | 521 return function; |
| 501 } | 522 } |
| 502 | 523 |
| 503 FunctionType* | 524 FunctionType* |
| 504 ArrayNArgumentsConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType( | 525 ArrayNArgumentsConstructorDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 505 Isolate* isolate, int parameter_count) { | 526 Isolate* isolate, int parameter_count) { |
| 506 Zone* zone = isolate->interface_descriptor_zone(); | 527 Zone* zone = isolate->interface_descriptor_zone(); |
| 507 FunctionType* function = | 528 FunctionType* function = |
| 508 Type::Function(AnyTagged(zone), Type::Undefined(), 3, zone)->AsFunction(); | 529 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 509 function->InitParameter(0, Type::Receiver()); // JSFunction | 530 ->AsFunction(); |
| 510 function->InitParameter(1, AnyTagged(zone)); // Allocation site or undefined | 531 function->InitParameter(kFunction, Type::Receiver()); |
| 511 function->InitParameter(2, UntaggedIntegral32(zone)); // Arg count | 532 function->InitParameter(kAllocationSite, AnyTagged(zone)); |
| 533 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 512 return function; | 534 return function; |
| 513 } | 535 } |
| 514 | 536 |
| 515 FunctionType* | 537 FunctionType* |
| 516 ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType( | 538 ArgumentAdaptorDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 517 Isolate* isolate, int parameter_count) { | 539 Isolate* isolate, int parameter_count) { |
| 518 Zone* zone = isolate->interface_descriptor_zone(); | 540 Zone* zone = isolate->interface_descriptor_zone(); |
| 519 FunctionType* function = | 541 FunctionType* function = |
| 520 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 542 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 521 function->InitParameter(0, Type::Receiver()); // JSFunction | 543 ->AsFunction(); |
| 522 function->InitParameter(1, AnyTagged(zone)); // the new target | 544 function->InitParameter(kFunction, Type::Receiver()); |
| 523 function->InitParameter(2, UntaggedIntegral32(zone)); // actual #arguments | 545 function->InitParameter(kNewTarget, AnyTagged(zone)); |
| 524 function->InitParameter(3, UntaggedIntegral32(zone)); // expected #arguments | 546 function->InitParameter(kActualArgumentsCount, UntaggedIntegral32(zone)); |
| 547 function->InitParameter(kExpectedArgumentsCount, UntaggedIntegral32(zone)); |
| 525 return function; | 548 return function; |
| 526 } | 549 } |
| 527 | 550 |
| 528 CallInterfaceDescriptor ApiCallbackDescriptorBase::ForArgs(Isolate* isolate, | 551 CallInterfaceDescriptor ApiCallbackDescriptorBase::ForArgs(Isolate* isolate, |
| 529 int argc) { | 552 int argc) { |
| 530 switch (argc) { | 553 switch (argc) { |
| 531 case 0: | 554 case 0: |
| 532 return ApiCallbackWith0ArgsDescriptor(isolate); | 555 return ApiCallbackWith0ArgsDescriptor(isolate); |
| 533 case 1: | 556 case 1: |
| 534 return ApiCallbackWith1ArgsDescriptor(isolate); | 557 return ApiCallbackWith1ArgsDescriptor(isolate); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 547 default: | 570 default: |
| 548 UNREACHABLE(); | 571 UNREACHABLE(); |
| 549 return VoidDescriptor(isolate); | 572 return VoidDescriptor(isolate); |
| 550 } | 573 } |
| 551 } | 574 } |
| 552 | 575 |
| 553 FunctionType* | 576 FunctionType* |
| 554 ApiCallbackDescriptorBase::BuildCallInterfaceDescriptorFunctionTypeWithArg( | 577 ApiCallbackDescriptorBase::BuildCallInterfaceDescriptorFunctionTypeWithArg( |
| 555 Isolate* isolate, int parameter_count, int argc) { | 578 Isolate* isolate, int parameter_count, int argc) { |
| 556 Zone* zone = isolate->interface_descriptor_zone(); | 579 Zone* zone = isolate->interface_descriptor_zone(); |
| 557 FunctionType* function = | 580 FunctionType* function = Type::Function(AnyTagged(zone), Type::Undefined(), |
| 558 Type::Function(AnyTagged(zone), Type::Undefined(), 4 + argc, zone) | 581 kParameterCount + argc, zone) |
| 559 ->AsFunction(); | 582 ->AsFunction(); |
| 560 function->InitParameter(0, AnyTagged(zone)); // callee | 583 function->InitParameter(kFunction, AnyTagged(zone)); |
| 561 function->InitParameter(1, AnyTagged(zone)); // call_data | 584 function->InitParameter(kCallData, AnyTagged(zone)); |
| 562 function->InitParameter(2, AnyTagged(zone)); // holder | 585 function->InitParameter(kHolder, AnyTagged(zone)); |
| 563 function->InitParameter(3, ExternalPointer(zone)); // api_function_address | 586 function->InitParameter(kApiFunctionAddress, ExternalPointer(zone)); |
| 564 for (int i = 0; i < argc; i++) { | 587 for (int i = 0; i < argc; i++) { |
| 565 function->InitParameter(i, AnyTagged(zone)); | 588 function->InitParameter(i, AnyTagged(zone)); |
| 566 } | 589 } |
| 567 return function; | 590 return function; |
| 568 } | 591 } |
| 569 | 592 |
| 570 FunctionType* | 593 FunctionType* |
| 571 InterpreterDispatchDescriptor::BuildCallInterfaceDescriptorFunctionType( | 594 InterpreterDispatchDescriptor::BuildCallInterfaceDescriptorFunctionType( |
| 572 Isolate* isolate, int parameter_count) { | 595 Isolate* isolate, int parameter_count) { |
| 573 Zone* zone = isolate->interface_descriptor_zone(); | 596 Zone* zone = isolate->interface_descriptor_zone(); |
| 574 FunctionType* function = | 597 FunctionType* function = |
| 575 Type::Function(AnyTagged(zone), Type::Undefined(), 4, zone)->AsFunction(); | 598 Type::Function(AnyTagged(zone), Type::Undefined(), kParameterCount, zone) |
| 576 function->InitParameter(kAccumulatorParameter, AnyTagged(zone)); | 599 ->AsFunction(); |
| 577 function->InitParameter(kBytecodeOffsetParameter, UntaggedIntegral32(zone)); | 600 function->InitParameter(kAccumulator, AnyTagged(zone)); |
| 578 function->InitParameter(kBytecodeArrayParameter, AnyTagged(zone)); | 601 function->InitParameter(kBytecodeOffset, UntaggedIntegral32(zone)); |
| 579 function->InitParameter(kDispatchTableParameter, AnyTagged(zone)); | 602 function->InitParameter(kBytecodeArray, AnyTagged(zone)); |
| 603 function->InitParameter(kDispatchTable, AnyTagged(zone)); |
| 580 return function; | 604 return function; |
| 581 } | 605 } |
| 582 | 606 |
| 583 } // namespace internal | 607 } // namespace internal |
| 584 } // namespace v8 | 608 } // namespace v8 |
| OLD | NEW |