| 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 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
| 9 #include "src/ast/ast-value-factory.h" | 9 #include "src/ast/ast-value-factory.h" |
| 10 #include "src/ast/modules.h" | 10 #include "src/ast/modules.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 EXPRESSION_NODE_LIST(V) | 99 EXPRESSION_NODE_LIST(V) |
| 100 | 100 |
| 101 // Optional type nodes are intentionally not in in AST_NODE_LIST. | 101 // Optional type nodes are intentionally not in in AST_NODE_LIST. |
| 102 // Visitors should not have to worry about them. | 102 // Visitors should not have to worry about them. |
| 103 #define TYPESYSTEM_NODE_LIST(V) \ | 103 #define TYPESYSTEM_NODE_LIST(V) \ |
| 104 V(PredefinedType) \ | 104 V(PredefinedType) \ |
| 105 V(ThisType) \ | 105 V(ThisType) \ |
| 106 V(UnionType) \ | 106 V(UnionType) \ |
| 107 V(IntersectionType) \ | 107 V(IntersectionType) \ |
| 108 V(ArrayType) \ | 108 V(ArrayType) \ |
| 109 V(TupleType) \ |
| 109 V(FunctionType) \ | 110 V(FunctionType) \ |
| 110 V(TypeParameter) \ | 111 V(TypeParameter) \ |
| 111 V(FormalParameter) \ | 112 V(FormalParameter) \ |
| 112 V(TypeReference) \ | 113 V(TypeReference) \ |
| 113 V(StringLiteralType) \ | 114 V(StringLiteralType) \ |
| 114 V(QueryType) \ | 115 V(QueryType) \ |
| 115 V(TypeOrParameters) | 116 V(TypeOrParameters) |
| 116 | 117 |
| 117 // Forward declarations | 118 // Forward declarations |
| 118 class AstNodeFactory; | 119 class AstNodeFactory; |
| (...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2928 private: | 2929 private: |
| 2929 EmptyParentheses(Zone* zone, int pos) : Expression(zone, pos) {} | 2930 EmptyParentheses(Zone* zone, int pos) : Expression(zone, pos) {} |
| 2930 }; | 2931 }; |
| 2931 | 2932 |
| 2932 | 2933 |
| 2933 // Nodes for the optional type system. | 2934 // Nodes for the optional type system. |
| 2934 namespace typesystem { | 2935 namespace typesystem { |
| 2935 | 2936 |
| 2936 class FormalParameter; | 2937 class FormalParameter; |
| 2937 | 2938 |
| 2939 |
| 2940 // Abstract class for all types. |
| 2941 // It also covers: binding identifiers, binding (array and object) patterns |
| 2942 // and formal parameter lists. |
| 2938 class Type : public AstNode { | 2943 class Type : public AstNode { |
| 2939 public: | 2944 public: |
| 2940 // Uncovers the case of a single, parenthesized valid type. | 2945 // Uncovers the case of a single, parenthesized valid type. |
| 2941 V8_INLINE Type* Uncover(bool* ok); | 2946 V8_INLINE Type* Uncover(bool* ok); |
| 2942 | 2947 |
| 2943 V8_INLINE ZoneList<FormalParameter*>* AsValidParameterList(Zone* zone, | 2948 V8_INLINE ZoneList<FormalParameter*>* AsValidParameterList(Zone* zone, |
| 2944 bool* ok) const; | 2949 bool* ok) const; |
| 2945 | 2950 |
| 2946 V8_INLINE bool IsSimpleIdentifier() const; | 2951 V8_INLINE bool IsValidType() const; |
| 2947 V8_INLINE const AstRawString* AsSimpleIdentifier() const; | 2952 V8_INLINE bool IsValidBindingIdentifierOrPattern() const; |
| 2948 | 2953 |
| 2949 protected: | 2954 protected: |
| 2950 explicit Type(Zone* zone, int position) : AstNode(position) {} | 2955 explicit Type(Zone* zone, int position) : AstNode(position) {} |
| 2951 }; | 2956 }; |
| 2952 | 2957 |
| 2953 | 2958 |
| 2959 // Class for predefined types. |
| 2960 // It also covers the use of "number", "any", etc. when used as binding |
| 2961 // identifiers. |
| 2954 class PredefinedType : public Type { | 2962 class PredefinedType : public Type { |
| 2955 public: | 2963 public: |
| 2956 DECLARE_NODE_TYPE(PredefinedType) | 2964 DECLARE_NODE_TYPE(PredefinedType) |
| 2957 | 2965 |
| 2958 enum Kind { | 2966 enum Kind { |
| 2959 kAnyType, | 2967 kAnyType, |
| 2960 kNumberType, | 2968 kNumberType, |
| 2961 kBooleanType, | 2969 kBooleanType, |
| 2962 kStringType, | 2970 kStringType, |
| 2963 kSymbolType, | 2971 kSymbolType, |
| 2964 kVoidType | 2972 kVoidType |
| 2965 }; | 2973 }; |
| 2966 | 2974 |
| 2967 Kind kind() const { return kind_; } | 2975 Kind kind() const { return kind_; } |
| 2976 bool IsValidBindingIdentifier() const { return kind_ != kVoidType; } |
| 2968 | 2977 |
| 2969 protected: | 2978 protected: |
| 2970 PredefinedType(Zone* zone, Kind kind, int pos) | 2979 PredefinedType(Zone* zone, Kind kind, int pos) |
| 2971 : Type(zone, pos), kind_(kind) {} | 2980 : Type(zone, pos), kind_(kind) {} |
| 2972 | 2981 |
| 2973 private: | 2982 private: |
| 2974 Kind kind_; | 2983 Kind kind_; |
| 2975 }; | 2984 }; |
| 2976 | 2985 |
| 2977 | 2986 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3025 Type* base() const { return base_; } | 3034 Type* base() const { return base_; } |
| 3026 | 3035 |
| 3027 protected: | 3036 protected: |
| 3028 ArrayType(Zone* zone, Type* base, int pos) : Type(zone, pos), base_(base) {} | 3037 ArrayType(Zone* zone, Type* base, int pos) : Type(zone, pos), base_(base) {} |
| 3029 | 3038 |
| 3030 private: | 3039 private: |
| 3031 Type* base_; | 3040 Type* base_; |
| 3032 }; | 3041 }; |
| 3033 | 3042 |
| 3034 | 3043 |
| 3044 // Class for tuple type. |
| 3045 // It also covers binding array patterns. |
| 3046 class TupleType : public Type { |
| 3047 public: |
| 3048 DECLARE_NODE_TYPE(TupleType) |
| 3049 |
| 3050 ZoneList<Type*>* elements() const { return elements_; } |
| 3051 bool IsValidType() const { return valid_type_; } |
| 3052 bool IsValidBindingPattern() const { return valid_binder_; } |
| 3053 bool spread() const { return spread_; } |
| 3054 |
| 3055 protected: |
| 3056 TupleType(Zone* zone, ZoneList<Type*>* elements, bool valid_type, |
| 3057 bool valid_binder, bool spread, int pos) |
| 3058 : Type(zone, pos), |
| 3059 elements_(elements), |
| 3060 valid_type_(valid_type), |
| 3061 valid_binder_(valid_binder), |
| 3062 spread_(spread) {} |
| 3063 |
| 3064 private: |
| 3065 ZoneList<Type*>* elements_; |
| 3066 bool valid_type_; |
| 3067 bool valid_binder_; |
| 3068 bool spread_; |
| 3069 }; |
| 3070 |
| 3071 |
| 3035 class TypeParameter : public AstNode { | 3072 class TypeParameter : public AstNode { |
| 3036 public: | 3073 public: |
| 3037 DECLARE_NODE_TYPE(TypeParameter) | 3074 DECLARE_NODE_TYPE(TypeParameter) |
| 3038 | 3075 |
| 3039 const AstRawString* name() const { return name_; } | 3076 const AstRawString* name() const { return name_; } |
| 3040 Type* extends() const { return extends_; } | 3077 Type* extends() const { return extends_; } |
| 3041 | 3078 |
| 3042 protected: | 3079 protected: |
| 3043 TypeParameter(Zone* zone, const AstRawString* name, Type* extends, int pos) | 3080 TypeParameter(Zone* zone, const AstRawString* name, Type* extends, int pos) |
| 3044 : AstNode(pos), name_(name), extends_(extends) {} | 3081 : AstNode(pos), name_(name), extends_(extends) {} |
| 3045 | 3082 |
| 3046 private: | 3083 private: |
| 3047 const AstRawString* name_; | 3084 const AstRawString* name_; |
| 3048 Type* extends_; | 3085 Type* extends_; |
| 3049 }; | 3086 }; |
| 3050 | 3087 |
| 3088 |
| 3089 // Class for function parameters. |
| 3090 // It also covers types when they occur inside parentheses. |
| 3051 class FormalParameter : public AstNode { | 3091 class FormalParameter : public AstNode { |
| 3052 public: | 3092 public: |
| 3053 DECLARE_NODE_TYPE(FormalParameter) | 3093 DECLARE_NODE_TYPE(FormalParameter) |
| 3054 | 3094 |
| 3055 bool IsValidType() const { return name_ == nullptr; } | 3095 bool IsValidType() const { |
| 3096 return binder_ == nullptr && type_->IsValidType(); |
| 3097 } |
| 3056 | 3098 |
| 3057 void MakeValidParameter(bool* ok) { | 3099 void MakeValidParameter(bool* ok) { |
| 3058 if (name_ != nullptr) return; | 3100 if (binder_ != nullptr) return; |
| 3059 if (optional_ || spread_ || !type_->IsSimpleIdentifier()) { | 3101 if (optional_ || spread_ || !type_->IsValidBindingIdentifierOrPattern()) { |
| 3060 *ok = false; | 3102 *ok = false; |
| 3061 return; | 3103 return; |
| 3062 } | 3104 } |
| 3063 name_ = type_->AsSimpleIdentifier(); | 3105 binder_ = type_; |
| 3064 type_ = nullptr; | 3106 type_ = nullptr; |
| 3065 } | 3107 } |
| 3066 | 3108 |
| 3067 const AstRawString* name() const { return name_; } | 3109 Type* binder() const { return binder_; } |
| 3068 bool optional() const { return optional_; } | 3110 bool optional() const { return optional_; } |
| 3069 bool spread() const { return spread_; } | 3111 bool spread() const { return spread_; } |
| 3070 Type* type() const { return type_; } | 3112 Type* type() const { return type_; } |
| 3071 | 3113 |
| 3072 protected: | 3114 protected: |
| 3073 FormalParameter(Zone* zone, const AstRawString* name, bool optional, | 3115 FormalParameter(Zone* zone, Type* binder, bool optional, bool spread, |
| 3074 bool spread, Type* type, int pos) | 3116 Type* type, int pos) |
| 3075 : AstNode(pos), | 3117 : AstNode(pos), |
| 3076 name_(name), | 3118 binder_(binder), |
| 3077 optional_(optional), | 3119 optional_(optional), |
| 3078 spread_(spread), | 3120 spread_(spread), |
| 3079 type_(type) {} | 3121 type_(type) {} |
| 3080 FormalParameter(Zone* zone, Type* type, int pos) | 3122 FormalParameter(Zone* zone, Type* type, int pos) |
| 3081 : AstNode(pos), | 3123 : AstNode(pos), |
| 3082 name_(nullptr), | 3124 binder_(nullptr), |
| 3083 optional_(false), | 3125 optional_(false), |
| 3084 spread_(false), | 3126 spread_(false), |
| 3085 type_(type) {} | 3127 type_(type) {} |
| 3086 | 3128 |
| 3087 friend class Type; | 3129 friend class Type; |
| 3088 | 3130 |
| 3089 private: | 3131 private: |
| 3090 const AstRawString* name_; | 3132 Type* binder_; |
| 3091 bool optional_; | 3133 bool optional_; |
| 3092 bool spread_; | 3134 bool spread_; |
| 3093 Type* type_; | 3135 Type* type_; |
| 3094 }; | 3136 }; |
| 3095 | 3137 |
| 3096 | 3138 |
| 3139 // Class for function and constructor types. |
| 3097 class FunctionType : public Type { | 3140 class FunctionType : public Type { |
| 3098 public: | 3141 public: |
| 3099 DECLARE_NODE_TYPE(FunctionType) | 3142 DECLARE_NODE_TYPE(FunctionType) |
| 3100 | 3143 |
| 3101 bool IsConstructorType() const { return constructor_; } | 3144 bool IsConstructorType() const { return constructor_; } |
| 3102 ZoneList<TypeParameter*>* type_parameters() const { return type_parameters_; } | 3145 ZoneList<TypeParameter*>* type_parameters() const { return type_parameters_; } |
| 3103 ZoneList<FormalParameter*>* parameters() const { return parameters_; } | 3146 ZoneList<FormalParameter*>* parameters() const { return parameters_; } |
| 3104 Type* result_type() const { return result_type_; } | 3147 Type* result_type() const { return result_type_; } |
| 3105 | 3148 |
| 3106 protected: | 3149 protected: |
| 3107 FunctionType(Zone* zone, ZoneList<TypeParameter*>* type_parameters, | 3150 FunctionType(Zone* zone, ZoneList<TypeParameter*>* type_parameters, |
| 3108 ZoneList<FormalParameter*>* parameters, Type* result_type, | 3151 ZoneList<FormalParameter*>* parameters, Type* result_type, |
| 3109 int pos, bool constructor = false) | 3152 int pos, bool constructor = false) |
| 3110 : Type(zone, pos), | 3153 : Type(zone, pos), |
| 3111 type_parameters_(type_parameters), | 3154 type_parameters_(type_parameters), |
| 3112 parameters_(parameters), | 3155 parameters_(parameters), |
| 3113 result_type_(result_type), | 3156 result_type_(result_type), |
| 3114 constructor_(constructor) {} | 3157 constructor_(constructor) {} |
| 3115 | 3158 |
| 3116 private: | 3159 private: |
| 3117 ZoneList<TypeParameter*>* type_parameters_; | 3160 ZoneList<TypeParameter*>* type_parameters_; |
| 3118 ZoneList<FormalParameter*>* parameters_; | 3161 ZoneList<FormalParameter*>* parameters_; |
| 3119 Type* result_type_; | 3162 Type* result_type_; |
| 3120 bool constructor_; | 3163 bool constructor_; |
| 3121 }; | 3164 }; |
| 3122 | 3165 |
| 3123 | 3166 |
| 3167 // Class for type references. |
| 3168 // It also covers binding identifiers. |
| 3124 class TypeReference : public Type { | 3169 class TypeReference : public Type { |
| 3125 public: | 3170 public: |
| 3126 DECLARE_NODE_TYPE(TypeReference) | 3171 DECLARE_NODE_TYPE(TypeReference) |
| 3127 | 3172 |
| 3128 const AstRawString* name() const { return name_; } | 3173 const AstRawString* name() const { return name_; } |
| 3129 ZoneList<Type*>* type_arguments() const { return type_arguments_; } | 3174 ZoneList<Type*>* type_arguments() const { return type_arguments_; } |
| 3130 | 3175 |
| 3176 bool IsValidBindingIdentifier() const { |
| 3177 // TODO(nikolaos): This should probably exclude restricted identifiers. |
| 3178 return type_arguments() == nullptr; |
| 3179 } |
| 3180 |
| 3131 protected: | 3181 protected: |
| 3132 TypeReference(Zone* zone, const AstRawString* name, | 3182 TypeReference(Zone* zone, const AstRawString* name, |
| 3133 ZoneList<Type*>* type_arguments, int pos) | 3183 ZoneList<Type*>* type_arguments, int pos) |
| 3134 : Type(zone, pos), name_(name), type_arguments_(type_arguments) {} | 3184 : Type(zone, pos), name_(name), type_arguments_(type_arguments) {} |
| 3135 | 3185 |
| 3136 private: | 3186 private: |
| 3137 const AstRawString* name_; | 3187 const AstRawString* name_; |
| 3138 ZoneList<Type*>* type_arguments_; | 3188 ZoneList<Type*>* type_arguments_; |
| 3139 }; | 3189 }; |
| 3140 | 3190 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 3167 QueryType(Zone* zone, const AstRawString* name, | 3217 QueryType(Zone* zone, const AstRawString* name, |
| 3168 ZoneList<const AstRawString*>* property_names, int pos) | 3218 ZoneList<const AstRawString*>* property_names, int pos) |
| 3169 : Type(zone, pos), name_(name), property_names_(property_names) {} | 3219 : Type(zone, pos), name_(name), property_names_(property_names) {} |
| 3170 | 3220 |
| 3171 private: | 3221 private: |
| 3172 const AstRawString* name_; | 3222 const AstRawString* name_; |
| 3173 ZoneList<const AstRawString*>* property_names_; | 3223 ZoneList<const AstRawString*>* property_names_; |
| 3174 }; | 3224 }; |
| 3175 | 3225 |
| 3176 | 3226 |
| 3227 // Class that covers parenthesized types and formal parameter lists. |
| 3177 class TypeOrParameters : public Type { | 3228 class TypeOrParameters : public Type { |
| 3178 public: | 3229 public: |
| 3179 DECLARE_NODE_TYPE(TypeOrParameters) | 3230 DECLARE_NODE_TYPE(TypeOrParameters) |
| 3180 | 3231 |
| 3181 ZoneList<FormalParameter*>* parameters() const { return parameters_; } | 3232 ZoneList<FormalParameter*>* parameters() const { return parameters_; } |
| 3182 | 3233 |
| 3183 protected: | 3234 protected: |
| 3184 TypeOrParameters(Zone* zone, ZoneList<FormalParameter*>* parameters, int pos) | 3235 TypeOrParameters(Zone* zone, ZoneList<FormalParameter*>* parameters, int pos) |
| 3185 : Type(zone, pos), parameters_(parameters) {} | 3236 : Type(zone, pos), parameters_(parameters) {} |
| 3186 | 3237 |
| 3187 private: | 3238 private: |
| 3188 ZoneList<FormalParameter*>* parameters_; | 3239 ZoneList<FormalParameter*>* parameters_; |
| 3189 }; | 3240 }; |
| 3190 | 3241 |
| 3191 V8_INLINE bool Type::IsSimpleIdentifier() const { | 3242 |
| 3192 const TypeReference* ref = AsTypeReference(); | 3243 V8_INLINE bool Type::IsValidType() const { |
| 3193 if (ref == nullptr) return false; | 3244 if (IsTypeOrParameters()) { |
| 3194 return ref->type_arguments() == nullptr; | 3245 ZoneList<FormalParameter*>* parameters = AsTypeOrParameters()->parameters(); |
| 3246 return parameters->length() == 1 && parameters->at(0)->IsValidType(); |
| 3247 } |
| 3248 if (IsTupleType()) return AsTupleType()->IsValidType(); |
| 3249 return true; |
| 3195 } | 3250 } |
| 3196 | 3251 |
| 3197 V8_INLINE const AstRawString* Type::AsSimpleIdentifier() const { | 3252 V8_INLINE bool Type::IsValidBindingIdentifierOrPattern() const { |
| 3198 const TypeReference* ref = AsTypeReference(); | 3253 if (IsTypeReference()) return AsTypeReference()->IsValidBindingIdentifier(); |
| 3199 DCHECK_NOT_NULL(ref); | 3254 if (IsTupleType()) return AsTupleType()->IsValidBindingPattern(); |
| 3200 DCHECK_NULL(ref->type_arguments()); | 3255 if (IsPredefinedType()) return AsPredefinedType()->IsValidBindingIdentifier(); |
| 3201 return ref->name(); | 3256 return false; |
| 3202 } | 3257 } |
| 3203 | 3258 |
| 3204 V8_INLINE Type* Type::Uncover(bool* ok) { | 3259 V8_INLINE Type* Type::Uncover(bool* ok) { |
| 3205 if (!IsTypeOrParameters()) return this; | 3260 if (IsTypeOrParameters()) { |
| 3206 ZoneList<FormalParameter*>* parameters = AsTypeOrParameters()->parameters(); | 3261 ZoneList<FormalParameter*>* parameters = AsTypeOrParameters()->parameters(); |
| 3207 if (parameters->length() == 1 && parameters->at(0)->IsValidType()) | 3262 if (parameters->length() == 1 && parameters->at(0)->IsValidType()) |
| 3208 return parameters->at(0)->type(); | 3263 return parameters->at(0)->type(); |
| 3264 } else if (IsTupleType()) { |
| 3265 if (AsTupleType()->IsValidType()) return this; |
| 3266 } else { |
| 3267 return this; |
| 3268 } |
| 3209 *ok = false; | 3269 *ok = false; |
| 3210 return nullptr; | 3270 return nullptr; |
| 3211 } | 3271 } |
| 3212 | 3272 |
| 3213 V8_INLINE ZoneList<FormalParameter*>* Type::AsValidParameterList( | 3273 V8_INLINE ZoneList<FormalParameter*>* Type::AsValidParameterList( |
| 3214 Zone* zone, bool* ok) const { | 3274 Zone* zone, bool* ok) const { |
| 3215 if (!IsTypeOrParameters()) { | 3275 if (!IsTypeOrParameters()) { |
| 3216 *ok = false; | 3276 *ok = false; |
| 3217 return nullptr; | 3277 return nullptr; |
| 3218 } | 3278 } |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3790 typesystem::Type* right, | 3850 typesystem::Type* right, |
| 3791 int pos) { | 3851 int pos) { |
| 3792 return new (local_zone_) | 3852 return new (local_zone_) |
| 3793 typesystem::IntersectionType(local_zone_, left, right, pos); | 3853 typesystem::IntersectionType(local_zone_, left, right, pos); |
| 3794 } | 3854 } |
| 3795 | 3855 |
| 3796 typesystem::ArrayType* NewArrayType(typesystem::Type* base, int pos) { | 3856 typesystem::ArrayType* NewArrayType(typesystem::Type* base, int pos) { |
| 3797 return new (local_zone_) typesystem::ArrayType(local_zone_, base, pos); | 3857 return new (local_zone_) typesystem::ArrayType(local_zone_, base, pos); |
| 3798 } | 3858 } |
| 3799 | 3859 |
| 3860 typesystem::TupleType* NewTupleType(ZoneList<typesystem::Type*>* elements, |
| 3861 bool valid_type, bool valid_binder, |
| 3862 bool spread, int pos) { |
| 3863 return new (local_zone_) typesystem::TupleType( |
| 3864 local_zone_, elements, valid_type, valid_binder, spread, pos); |
| 3865 } |
| 3866 |
| 3800 typesystem::FunctionType* NewFunctionType( | 3867 typesystem::FunctionType* NewFunctionType( |
| 3801 ZoneList<typesystem::TypeParameter*>* type_parameters, | 3868 ZoneList<typesystem::TypeParameter*>* type_parameters, |
| 3802 ZoneList<typesystem::FormalParameter*>* parameters, | 3869 ZoneList<typesystem::FormalParameter*>* parameters, |
| 3803 typesystem::Type* result_type, int pos, bool constructor = false) { | 3870 typesystem::Type* result_type, int pos, bool constructor = false) { |
| 3804 return new (local_zone_) | 3871 return new (local_zone_) |
| 3805 typesystem::FunctionType(local_zone_, type_parameters, parameters, | 3872 typesystem::FunctionType(local_zone_, type_parameters, parameters, |
| 3806 result_type, pos, constructor); | 3873 result_type, pos, constructor); |
| 3807 } | 3874 } |
| 3808 | 3875 |
| 3809 typesystem::TypeReference* NewTypeReference( | 3876 typesystem::TypeReference* NewTypeReference( |
| 3810 const AstRawString* name, ZoneList<typesystem::Type*>* type_arguments, | 3877 const AstRawString* name, ZoneList<typesystem::Type*>* type_arguments, |
| 3811 int pos) { | 3878 int pos) { |
| 3812 return new (local_zone_) | 3879 return new (local_zone_) |
| 3813 typesystem::TypeReference(local_zone_, name, type_arguments, pos); | 3880 typesystem::TypeReference(local_zone_, name, type_arguments, pos); |
| 3814 } | 3881 } |
| 3815 | 3882 |
| 3816 typesystem::StringLiteralType* NewStringLiteralType( | 3883 typesystem::StringLiteralType* NewStringLiteralType( |
| 3817 const AstRawString* string, int pos) { | 3884 const AstRawString* string, int pos) { |
| 3818 return new (local_zone_) | 3885 return new (local_zone_) |
| 3819 typesystem::StringLiteralType(local_zone_, string, pos); | 3886 typesystem::StringLiteralType(local_zone_, string, pos); |
| 3820 } | 3887 } |
| 3821 | 3888 |
| 3822 typesystem::QueryType* NewQueryType( | 3889 typesystem::QueryType* NewQueryType( |
| 3823 const AstRawString* name, ZoneList<const AstRawString*>* property_names, | 3890 const AstRawString* name, ZoneList<const AstRawString*>* property_names, |
| 3824 int pos) { | 3891 int pos) { |
| 3825 return new (local_zone_) | 3892 return new (local_zone_) |
| 3826 typesystem::QueryType(local_zone_, name, property_names, pos); | 3893 typesystem::QueryType(local_zone_, name, property_names, pos); |
| 3827 } | 3894 } |
| 3828 | 3895 |
| 3829 typesystem::FormalParameter* NewFormalParameter(const AstRawString* name, | 3896 typesystem::FormalParameter* NewFormalParameter(typesystem::Type* binder, |
| 3830 bool optional, bool spread, | 3897 bool optional, bool spread, |
| 3831 typesystem::Type* type, | 3898 typesystem::Type* type, |
| 3832 int pos) { | 3899 int pos) { |
| 3833 return new (local_zone_) typesystem::FormalParameter( | 3900 return new (local_zone_) typesystem::FormalParameter( |
| 3834 local_zone_, name, optional, spread, type, pos); | 3901 local_zone_, binder, optional, spread, type, pos); |
| 3835 } | 3902 } |
| 3836 | 3903 |
| 3837 typesystem::FormalParameter* NewFormalParameter(typesystem::Type* type, | 3904 typesystem::FormalParameter* NewFormalParameter(typesystem::Type* type, |
| 3838 int pos) { | 3905 int pos) { |
| 3839 return new (local_zone_) | 3906 return new (local_zone_) |
| 3840 typesystem::FormalParameter(local_zone_, type, pos); | 3907 typesystem::FormalParameter(local_zone_, type, pos); |
| 3841 } | 3908 } |
| 3842 | 3909 |
| 3843 typesystem::TypeOrParameters* NewTypeOrParameters( | 3910 typesystem::TypeOrParameters* NewTypeOrParameters( |
| 3844 ZoneList<typesystem::FormalParameter*>* parameters, int pos) { | 3911 ZoneList<typesystem::FormalParameter*>* parameters, int pos) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3938 : NULL; \ | 4005 : NULL; \ |
| 3939 } | 4006 } |
| 3940 TYPESYSTEM_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 4007 TYPESYSTEM_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3941 #undef DECLARE_NODE_FUNCTIONS | 4008 #undef DECLARE_NODE_FUNCTIONS |
| 3942 | 4009 |
| 3943 | 4010 |
| 3944 } // namespace internal | 4011 } // namespace internal |
| 3945 } // namespace v8 | 4012 } // namespace v8 |
| 3946 | 4013 |
| 3947 #endif // V8_AST_AST_H_ | 4014 #endif // V8_AST_AST_H_ |
| OLD | NEW |