| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_ | 5 #ifndef V8_CALL_INTERFACE_DESCRIPTOR_H_ |
| 6 #define V8_CALL_INTERFACE_DESCRIPTOR_H_ | 6 #define V8_CALL_INTERFACE_DESCRIPTOR_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
| 10 | 10 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 | 134 |
| 135 class CallInterfaceDescriptor { | 135 class CallInterfaceDescriptor { |
| 136 public: | 136 public: |
| 137 CallInterfaceDescriptor() : data_(NULL) {} | 137 CallInterfaceDescriptor() : data_(NULL) {} |
| 138 virtual ~CallInterfaceDescriptor() {} | 138 virtual ~CallInterfaceDescriptor() {} |
| 139 | 139 |
| 140 CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key) | 140 CallInterfaceDescriptor(Isolate* isolate, CallDescriptors::Key key) |
| 141 : data_(isolate->call_descriptor_data(key)) {} | 141 : data_(isolate->call_descriptor_data(key)) {} |
| 142 | 142 |
| 143 int GetEnvironmentLength() const { return data()->register_param_count(); } | |
| 144 | |
| 145 int GetRegisterParameterCount() const { | 143 int GetRegisterParameterCount() const { |
| 146 return data()->register_param_count(); | 144 return data()->register_param_count(); |
| 147 } | 145 } |
| 148 | 146 |
| 149 Register GetParameterRegister(int index) const { | 147 int GetStackParameterCount() const { |
| 148 return data()->function_type()->Arity() - data()->register_param_count(); |
| 149 } |
| 150 |
| 151 Register GetRegisterParameter(int index) const { |
| 150 return data()->register_param(index); | 152 return data()->register_param(index); |
| 151 } | 153 } |
| 152 | 154 |
| 153 Type* GetParameterType(int index) const { | 155 Type* GetParameterType(int index) const { |
| 154 DCHECK(index < data()->register_param_count()); | 156 DCHECK(index < data()->register_param_count()); |
| 155 return data()->register_param_type(index); | 157 return data()->register_param_type(index); |
| 156 } | 158 } |
| 157 | 159 |
| 158 // "Environment" versions of parameter functions. The first register | |
| 159 // parameter (context) is not included. | |
| 160 int GetEnvironmentParameterCount() const { | |
| 161 return GetEnvironmentLength() - 1; | |
| 162 } | |
| 163 | |
| 164 Register GetEnvironmentParameterRegister(int index) const { | |
| 165 return GetParameterRegister(index + 1); | |
| 166 } | |
| 167 | |
| 168 Type* GetEnvironmentParameterType(int index) const { | |
| 169 return GetParameterType(index + 1); | |
| 170 } | |
| 171 | |
| 172 // Some platforms have extra information to associate with the descriptor. | 160 // Some platforms have extra information to associate with the descriptor. |
| 173 PlatformInterfaceDescriptor* platform_specific_descriptor() const { | 161 PlatformInterfaceDescriptor* platform_specific_descriptor() const { |
| 174 return data()->platform_specific_descriptor(); | 162 return data()->platform_specific_descriptor(); |
| 175 } | 163 } |
| 176 | 164 |
| 177 Type::FunctionType* GetFunctionType() const { | 165 Type::FunctionType* GetFunctionType() const { |
| 178 return data()->function_type(); | 166 return data()->function_type(); |
| 179 } | 167 } |
| 180 | 168 |
| 181 static const Register ContextRegister(); | 169 static const Register ContextRegister(); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 } // namespace v8::internal | 619 } // namespace v8::internal |
| 632 | 620 |
| 633 | 621 |
| 634 #if V8_TARGET_ARCH_ARM64 | 622 #if V8_TARGET_ARCH_ARM64 |
| 635 #include "src/arm64/interface-descriptors-arm64.h" | 623 #include "src/arm64/interface-descriptors-arm64.h" |
| 636 #elif V8_TARGET_ARCH_ARM | 624 #elif V8_TARGET_ARCH_ARM |
| 637 #include "src/arm/interface-descriptors-arm.h" | 625 #include "src/arm/interface-descriptors-arm.h" |
| 638 #endif | 626 #endif |
| 639 | 627 |
| 640 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ | 628 #endif // V8_CALL_INTERFACE_DESCRIPTOR_H_ |
| OLD | NEW |