| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 SRC_WASM_ASM_TYPES_H_ | 5 #ifndef SRC_WASM_ASM_TYPES_H_ |
| 6 #define SRC_WASM_ASM_TYPES_H_ | 6 #define SRC_WASM_ASM_TYPES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "src/base/macros.h" | 10 #include "src/base/macros.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 public: | 125 public: |
| 126 AsmFunctionType* AsFunctionType() final { return this; } | 126 AsmFunctionType* AsFunctionType() final { return this; } |
| 127 | 127 |
| 128 void AddArgument(AsmType* type) { args_.push_back(type); } | 128 void AddArgument(AsmType* type) { args_.push_back(type); } |
| 129 const ZoneVector<AsmType*> Arguments() const { return args_; } | 129 const ZoneVector<AsmType*> Arguments() const { return args_; } |
| 130 AsmType* ReturnType() const { return return_type_; } | 130 AsmType* ReturnType() const { return return_type_; } |
| 131 | 131 |
| 132 virtual bool IsMinMaxType() const { return false; } | 132 virtual bool IsMinMaxType() const { return false; } |
| 133 virtual bool IsFroundType() const { return false; } | 133 virtual bool IsFroundType() const { return false; } |
| 134 | 134 |
| 135 AsmType* ValidateCall(AsmType* return_type, |
| 136 const ZoneVector<AsmType*>& args) override; |
| 137 |
| 135 protected: | 138 protected: |
| 136 AsmFunctionType(Zone* zone, AsmType* return_type) | 139 AsmFunctionType(Zone* zone, AsmType* return_type) |
| 137 : return_type_(return_type), args_(zone) {} | 140 : return_type_(return_type), args_(zone) {} |
| 138 | 141 |
| 139 private: | 142 private: |
| 140 friend AsmType; | 143 friend AsmType; |
| 141 | 144 |
| 142 std::string Name() override; | 145 std::string Name() override; |
| 143 AsmType* ValidateCall(AsmType* return_type, | |
| 144 const ZoneVector<AsmType*>& args) override; | |
| 145 | 146 |
| 146 AsmType* return_type_; | 147 AsmType* return_type_; |
| 147 ZoneVector<AsmType*> args_; | 148 ZoneVector<AsmType*> args_; |
| 148 | 149 |
| 149 DISALLOW_COPY_AND_ASSIGN(AsmFunctionType); | 150 DISALLOW_COPY_AND_ASSIGN(AsmFunctionType); |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 class AsmOverloadedFunctionType final : public AsmCallableType { | 153 class AsmOverloadedFunctionType final : public AsmCallableType { |
| 153 public: | 154 public: |
| 154 AsmOverloadedFunctionType* AsOverloadedFunctionType() override { | 155 AsmOverloadedFunctionType* AsOverloadedFunctionType() override { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 class AsmFunctionTableType : public AsmCallableType { | 191 class AsmFunctionTableType : public AsmCallableType { |
| 191 public: | 192 public: |
| 192 AsmFunctionTableType* AsFunctionTableType() override { return this; } | 193 AsmFunctionTableType* AsFunctionTableType() override { return this; } |
| 193 | 194 |
| 194 std::string Name() override; | 195 std::string Name() override; |
| 195 | 196 |
| 196 AsmType* ValidateCall(AsmType* return_type, | 197 AsmType* ValidateCall(AsmType* return_type, |
| 197 const ZoneVector<AsmType*>& args) override; | 198 const ZoneVector<AsmType*>& args) override; |
| 198 | 199 |
| 199 size_t length() const { return length_; } | 200 size_t length() const { return length_; } |
| 201 AsmType* signature() { return signature_; } |
| 200 | 202 |
| 201 private: | 203 private: |
| 202 friend class AsmType; | 204 friend class AsmType; |
| 203 | 205 |
| 204 AsmFunctionTableType(size_t length, AsmType* signature); | 206 AsmFunctionTableType(size_t length, AsmType* signature); |
| 205 | 207 |
| 206 size_t length_; | 208 size_t length_; |
| 207 AsmType* signature_; | 209 AsmType* signature_; |
| 208 | 210 |
| 209 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmFunctionTableType); | 211 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmFunctionTableType); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // Returns the store type if this is a heap type. AsmType::None is returned if | 337 // Returns the store type if this is a heap type. AsmType::None is returned if |
| 336 // this is not a heap type. | 338 // this is not a heap type. |
| 337 AsmType* StoreType(); | 339 AsmType* StoreType(); |
| 338 }; | 340 }; |
| 339 | 341 |
| 340 } // namespace wasm | 342 } // namespace wasm |
| 341 } // namespace internal | 343 } // namespace internal |
| 342 } // namespace v8 | 344 } // namespace v8 |
| 343 | 345 |
| 344 #endif // SRC_WASM_ASM_TYPES_H_ | 346 #endif // SRC_WASM_ASM_TYPES_H_ |
| OLD | NEW |