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 | 10 |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 void ArgumentAdaptorDescriptor::InitializePlatformIndependent( | 439 void ArgumentAdaptorDescriptor::InitializePlatformIndependent( |
440 CallInterfaceDescriptorData* data) { | 440 CallInterfaceDescriptorData* data) { |
441 // kFunction, kNewTarget, kActualArgumentsCount, kExpectedArgumentsCount | 441 // kFunction, kNewTarget, kActualArgumentsCount, kExpectedArgumentsCount |
442 MachineType machine_types[] = {MachineType::TaggedPointer(), | 442 MachineType machine_types[] = {MachineType::TaggedPointer(), |
443 MachineType::AnyTagged(), MachineType::Int32(), | 443 MachineType::AnyTagged(), MachineType::Int32(), |
444 MachineType::Int32()}; | 444 MachineType::Int32()}; |
445 data->InitializePlatformIndependent(arraysize(machine_types), 0, | 445 data->InitializePlatformIndependent(arraysize(machine_types), 0, |
446 machine_types); | 446 machine_types); |
447 } | 447 } |
448 | 448 |
449 CallInterfaceDescriptor ApiCallbackDescriptorBase::ForArgs(Isolate* isolate, | 449 void ApiCallbackDescriptor::InitializePlatformIndependent( |
450 int argc) { | |
451 switch (argc) { | |
452 case 0: | |
453 return ApiCallbackWith0ArgsDescriptor(isolate); | |
454 case 1: | |
455 return ApiCallbackWith1ArgsDescriptor(isolate); | |
456 case 2: | |
457 return ApiCallbackWith2ArgsDescriptor(isolate); | |
458 case 3: | |
459 return ApiCallbackWith3ArgsDescriptor(isolate); | |
460 case 4: | |
461 return ApiCallbackWith4ArgsDescriptor(isolate); | |
462 case 5: | |
463 return ApiCallbackWith5ArgsDescriptor(isolate); | |
464 case 6: | |
465 return ApiCallbackWith6ArgsDescriptor(isolate); | |
466 case 7: | |
467 return ApiCallbackWith7ArgsDescriptor(isolate); | |
468 default: | |
469 UNREACHABLE(); | |
470 return VoidDescriptor(isolate); | |
471 } | |
472 } | |
473 | |
474 void ApiCallbackDescriptorBase::InitializePlatformIndependent( | |
475 CallInterfaceDescriptorData* data) { | 450 CallInterfaceDescriptorData* data) { |
476 // kFunction, kCallData, kHolder, kApiFunctionAddress | 451 // kFunction, kCallData, kHolder, kApiFunctionAddress |
477 MachineType machine_types[] = { | 452 MachineType machine_types[] = { |
478 MachineType::AnyTagged(), MachineType::AnyTagged(), | 453 MachineType::AnyTagged(), MachineType::AnyTagged(), |
479 MachineType::AnyTagged(), MachineType::Pointer()}; | 454 MachineType::AnyTagged(), MachineType::Pointer()}; |
480 data->InitializePlatformIndependent(arraysize(machine_types), extra_args(), | 455 data->InitializePlatformIndependent(arraysize(machine_types), 0, |
481 machine_types); | 456 machine_types); |
482 } | 457 } |
483 | 458 |
484 void InterpreterDispatchDescriptor::InitializePlatformIndependent( | 459 void InterpreterDispatchDescriptor::InitializePlatformIndependent( |
485 CallInterfaceDescriptorData* data) { | 460 CallInterfaceDescriptorData* data) { |
486 // kAccumulator, kBytecodeOffset, kBytecodeArray, kDispatchTable | 461 // kAccumulator, kBytecodeOffset, kBytecodeArray, kDispatchTable |
487 MachineType machine_types[] = {MachineType::AnyTagged(), MachineType::Int32(), | 462 MachineType machine_types[] = {MachineType::AnyTagged(), MachineType::Int32(), |
488 MachineType::AnyTagged(), | 463 MachineType::AnyTagged(), |
489 MachineType::AnyTagged()}; | 464 MachineType::AnyTagged()}; |
490 data->InitializePlatformIndependent(arraysize(machine_types), 0, | 465 data->InitializePlatformIndependent(arraysize(machine_types), 0, |
491 machine_types); | 466 machine_types); |
492 } | 467 } |
493 | 468 |
494 } // namespace internal | 469 } // namespace internal |
495 } // namespace v8 | 470 } // namespace v8 |
OLD | NEW |