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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 Register registers[] = {cp, r2}; |
| 30 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 31 } |
| 32 { |
| 33 CallInterfaceDescriptor* descriptor = |
| 34 isolate->call_descriptor(CallDescriptorKey::FastNewContextCall); |
| 35 Register registers[] = {cp, r1}; |
| 36 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 37 } |
| 38 { |
| 39 CallInterfaceDescriptor* descriptor = |
| 40 isolate->call_descriptor(CallDescriptorKey::ToNumberCall); |
| 41 Register registers[] = {cp, r0}; |
| 42 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 43 } |
| 44 { |
| 45 CallInterfaceDescriptor* descriptor = |
| 46 isolate->call_descriptor(CallDescriptorKey::NumberToStringCall); |
| 47 Register registers[] = {cp, r0}; |
| 48 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 49 } |
| 50 { |
| 51 CallInterfaceDescriptor* descriptor = |
| 52 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowArrayCall); |
| 53 Register registers[] = {cp, r3, r2, r1}; |
| 54 Representation representations[] = { |
| 55 Representation::Tagged(), Representation::Tagged(), |
| 56 Representation::Smi(), Representation::Tagged()}; |
| 57 descriptor->Initialize(arraysize(registers), registers, representations); |
| 58 } |
| 59 { |
| 60 CallInterfaceDescriptor* descriptor = |
| 61 isolate->call_descriptor(CallDescriptorKey::FastCloneShallowObjectCall); |
| 62 Register registers[] = {cp, r3, r2, r1, r0}; |
| 63 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 64 } |
| 65 { |
| 66 CallInterfaceDescriptor* descriptor = |
| 67 isolate->call_descriptor(CallDescriptorKey::CreateAllocationSiteCall); |
| 68 Register registers[] = {cp, r2, r3}; |
| 69 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 70 } |
| 71 { |
| 72 CallInterfaceDescriptor* descriptor = |
| 73 isolate->call_descriptor(CallDescriptorKey::CallFunctionCall); |
| 74 Register registers[] = {cp, r1}; |
| 75 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 76 } |
| 77 { |
| 78 CallInterfaceDescriptor* descriptor = |
| 79 isolate->call_descriptor(CallDescriptorKey::CallConstructCall); |
| 80 // r0 : number of arguments |
| 81 // r1 : the function to call |
| 82 // r2 : feedback vector |
| 83 // r3 : (only if r2 is not the megamorphic symbol) slot in feedback |
| 84 // vector (Smi) |
| 85 // TODO(turbofan): So far we don't gather type feedback and hence skip the |
| 86 // slot parameter, but ArrayConstructStub needs the vector to be undefined. |
| 87 Register registers[] = {cp, r0, r1, r2}; |
| 88 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 89 } |
| 90 { |
| 91 CallInterfaceDescriptor* descriptor = |
| 92 isolate->call_descriptor(CallDescriptorKey::RegExpConstructResultCall); |
| 93 Register registers[] = {cp, r2, r1, r0}; |
| 94 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 95 } |
| 96 { |
| 97 CallInterfaceDescriptor* descriptor = |
| 98 isolate->call_descriptor(CallDescriptorKey::TransitionElementsKindCall); |
| 99 Register registers[] = {cp, r0, r1}; |
| 100 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 101 } |
| 102 { |
| 103 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 104 CallDescriptorKey::ArrayConstructorConstantArgCountCall); |
| 105 // register state |
| 106 // cp -- context |
| 107 // r0 -- number of arguments |
| 108 // r1 -- function |
| 109 // r2 -- allocation site with elements kind |
| 110 Register registers[] = {cp, r1, r2}; |
| 111 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 112 } |
| 113 { |
| 114 CallInterfaceDescriptor* descriptor = |
| 115 isolate->call_descriptor(CallDescriptorKey::ArrayConstructorCall); |
| 116 // stack param count needs (constructor pointer, and single argument) |
| 117 Register registers[] = {cp, r1, r2, r0}; |
| 118 Representation representations[] = { |
| 119 Representation::Tagged(), Representation::Tagged(), |
| 120 Representation::Tagged(), Representation::Integer32()}; |
| 121 descriptor->Initialize(arraysize(registers), registers, representations); |
| 122 } |
| 123 { |
| 124 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 125 CallDescriptorKey::InternalArrayConstructorConstantArgCountCall); |
| 126 // register state |
| 127 // cp -- context |
| 128 // r0 -- number of arguments |
| 129 // r1 -- constructor function |
| 130 Register registers[] = {cp, r1}; |
| 131 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 132 } |
| 133 { |
| 134 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 135 CallDescriptorKey::InternalArrayConstructorCall); |
| 136 // stack param count needs (constructor pointer, and single argument) |
| 137 Register registers[] = {cp, r1, r0}; |
| 138 Representation representations[] = {Representation::Tagged(), |
| 139 Representation::Tagged(), |
| 140 Representation::Integer32()}; |
| 141 descriptor->Initialize(arraysize(registers), registers, representations); |
| 142 } |
| 143 { |
| 144 CallInterfaceDescriptor* descriptor = |
| 145 isolate->call_descriptor(CallDescriptorKey::CompareNilCall); |
| 146 Register registers[] = {cp, r0}; |
| 147 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 148 } |
| 149 { |
| 150 CallInterfaceDescriptor* descriptor = |
| 151 isolate->call_descriptor(CallDescriptorKey::ToBooleanCall); |
| 152 Register registers[] = {cp, r0}; |
| 153 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 154 } |
| 155 { |
| 156 CallInterfaceDescriptor* descriptor = |
| 157 isolate->call_descriptor(CallDescriptorKey::BinaryOpCall); |
| 158 Register registers[] = {cp, r1, r0}; |
| 159 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 160 } |
| 161 { |
| 162 CallInterfaceDescriptor* descriptor = isolate->call_descriptor( |
| 163 CallDescriptorKey::BinaryOpWithAllocationSiteCall); |
| 164 Register registers[] = {cp, r2, r1, r0}; |
| 165 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 166 } |
| 167 { |
| 168 CallInterfaceDescriptor* descriptor = |
| 169 isolate->call_descriptor(CallDescriptorKey::StringAddCall); |
| 170 Register registers[] = {cp, r1, r0}; |
| 171 descriptor->Initialize(arraysize(registers), registers, NULL); |
| 172 } |
| 173 |
24 { | 174 { |
25 CallInterfaceDescriptor* descriptor = | 175 CallInterfaceDescriptor* descriptor = |
26 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); | 176 isolate->call_descriptor(CallDescriptorKey::ArgumentAdaptorCall); |
27 Register registers[] = { | 177 Register registers[] = { |
28 cp, // context | 178 cp, // context |
29 r1, // JSFunction | 179 r1, // JSFunction |
30 r0, // actual number of arguments | 180 r0, // actual number of arguments |
31 r2, // expected number of arguments | 181 r2, // expected number of arguments |
32 }; | 182 }; |
33 Representation representations[] = { | 183 Representation representations[] = { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 Representation::External(), // api_function_address | 249 Representation::External(), // api_function_address |
100 }; | 250 }; |
101 descriptor->Initialize(arraysize(registers), registers, representations, | 251 descriptor->Initialize(arraysize(registers), registers, representations, |
102 &default_descriptor); | 252 &default_descriptor); |
103 } | 253 } |
104 } | 254 } |
105 } | 255 } |
106 } // namespace v8::internal | 256 } // namespace v8::internal |
107 | 257 |
108 #endif // V8_TARGET_ARCH_ARM | 258 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |