OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "src/v8.h" |
| 6 |
| 7 #if V8_TARGET_ARCH_ARM |
| 8 |
| 9 #include "src/interface-descriptors.h" |
| 10 |
| 11 namespace v8 { |
| 12 namespace internal { |
| 13 |
| 14 const Register InterfaceDescriptor::ContextRegister() { return cp; } |
| 15 |
| 16 |
| 17 void CallDescriptors::InitializeForIsolate(Isolate* isolate) { |
| 18 static PlatformInterfaceDescriptor default_descriptor = |
| 19 PlatformInterfaceDescriptor(CAN_INLINE_TARGET_ADDRESS); |
| 20 |
| 21 static PlatformInterfaceDescriptor noInlineDescriptor = |
| 22 PlatformInterfaceDescriptor(NEVER_INLINE_TARGET_ADDRESS); |
| 23 |
| 24 { |
| 25 CallInterfaceDescriptor* descriptor = |
| 26 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); |
| 27 Register registers[] = { |
| 28 cp, // context |
| 29 r1, // JSFunction |
| 30 r0, // actual number of arguments |
| 31 r2, // expected number of arguments |
| 32 }; |
| 33 Representation representations[] = { |
| 34 Representation::Tagged(), // context |
| 35 Representation::Tagged(), // JSFunction |
| 36 Representation::Integer32(), // actual number of arguments |
| 37 Representation::Integer32(), // expected number of arguments |
| 38 }; |
| 39 descriptor->Initialize(arraysize(registers), registers, representations, |
| 40 &default_descriptor); |
| 41 } |
| 42 { |
| 43 CallInterfaceDescriptor* descriptor = |
| 44 isolate->call_descriptor(CallDescriptorKey::KeyedCall); |
| 45 Register registers[] = { |
| 46 cp, // context |
| 47 r2, // key |
| 48 }; |
| 49 Representation representations[] = { |
| 50 Representation::Tagged(), // context |
| 51 Representation::Tagged(), // key |
| 52 }; |
| 53 descriptor->Initialize(arraysize(registers), registers, representations, |
| 54 &noInlineDescriptor); |
| 55 } |
| 56 { |
| 57 CallInterfaceDescriptor* descriptor = |
| 58 isolate->call_descriptor(CallDescriptorKey::NamedCall); |
| 59 Register registers[] = { |
| 60 cp, // context |
| 61 r2, // name |
| 62 }; |
| 63 Representation representations[] = { |
| 64 Representation::Tagged(), // context |
| 65 Representation::Tagged(), // name |
| 66 }; |
| 67 descriptor->Initialize(arraysize(registers), registers, representations, |
| 68 &noInlineDescriptor); |
| 69 } |
| 70 { |
| 71 CallInterfaceDescriptor* descriptor = |
| 72 isolate->call_descriptor(CallDescriptorKey::CallHandler); |
| 73 Register registers[] = { |
| 74 cp, // context |
| 75 r0, // receiver |
| 76 }; |
| 77 Representation representations[] = { |
| 78 Representation::Tagged(), // context |
| 79 Representation::Tagged(), // receiver |
| 80 }; |
| 81 descriptor->Initialize(arraysize(registers), registers, representations, |
| 82 &default_descriptor); |
| 83 } |
| 84 { |
| 85 CallInterfaceDescriptor* descriptor = |
| 86 isolate->call_descriptor(CallDescriptorKey::ApiFunctionCall); |
| 87 Register registers[] = { |
| 88 cp, // context |
| 89 r0, // callee |
| 90 r4, // call_data |
| 91 r2, // holder |
| 92 r1, // api_function_address |
| 93 }; |
| 94 Representation representations[] = { |
| 95 Representation::Tagged(), // context |
| 96 Representation::Tagged(), // callee |
| 97 Representation::Tagged(), // call_data |
| 98 Representation::Tagged(), // holder |
| 99 Representation::External(), // api_function_address |
| 100 }; |
| 101 descriptor->Initialize(arraysize(registers), registers, representations, |
| 102 &default_descriptor); |
| 103 } |
| 104 } |
| 105 } |
| 106 } // namespace v8::internal |
| 107 |
| 108 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |