OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_ASMJS_TYPING_ASM_H_ | 5 #ifndef V8_ASMJS_TYPING_ASM_H_ |
6 #define V8_ASMJS_TYPING_ASM_H_ | 6 #define V8_ASMJS_TYPING_ASM_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast-type-bounds.h" | 9 #include "src/ast/ast-type-bounds.h" |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
11 #include "src/effects.h" | 11 #include "src/effects.h" |
12 #include "src/type-info.h" | 12 #include "src/type-info.h" |
13 #include "src/types.h" | 13 #include "src/types.h" |
14 #include "src/zone.h" | 14 #include "src/zone.h" |
15 | 15 |
16 namespace v8 { | 16 namespace v8 { |
17 namespace internal { | 17 namespace internal { |
18 | 18 |
19 class TypeCache; | 19 class TypeCache; |
20 | 20 |
21 class AsmTyper : public AstVisitor { | 21 class AsmTyper final : public AstVisitor<AsmTyper> { |
22 public: | 22 public: |
23 explicit AsmTyper(Isolate* isolate, Zone* zone, Script* script, | 23 explicit AsmTyper(Isolate* isolate, Zone* zone, Script* script, |
24 FunctionLiteral* root); | 24 FunctionLiteral* root); |
25 bool Validate(); | 25 bool Validate(); |
26 void set_allow_simd(bool simd) { allow_simd_ = simd; } | 26 void set_allow_simd(bool simd) { allow_simd_ = simd; } |
27 void set_fixed_signature(bool fixed) { fixed_signature_ = fixed; } | 27 void set_fixed_signature(bool fixed) { fixed_signature_ = fixed; } |
28 const char* error_message() { return error_message_; } | 28 const char* error_message() { return error_message_; } |
29 const AstTypeBounds* bounds() { return &bounds_; } | 29 const AstTypeBounds* bounds() { return &bounds_; } |
30 | 30 |
31 enum StandardMember { | 31 enum StandardMember { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 static const int kErrorMessageLimit = 150; | 126 static const int kErrorMessageLimit = 150; |
127 char error_message_[kErrorMessageLimit]; | 127 char error_message_[kErrorMessageLimit]; |
128 | 128 |
129 static const int kMaxUncombinedAdditiveSteps = 1 << 20; | 129 static const int kMaxUncombinedAdditiveSteps = 1 << 20; |
130 static const int kMaxUncombinedMultiplicativeSteps = 1; | 130 static const int kMaxUncombinedMultiplicativeSteps = 1; |
131 | 131 |
132 void InitializeStdlib(); | 132 void InitializeStdlib(); |
133 void InitializeStdlibSIMD(); | 133 void InitializeStdlibSIMD(); |
134 | 134 |
135 void VisitDeclarations(ZoneList<Declaration*>* d) override; | 135 void VisitDeclarations(ZoneList<Declaration*>* d); |
136 void VisitStatements(ZoneList<Statement*>* s) override; | 136 void VisitStatements(ZoneList<Statement*>* s); |
137 | 137 |
138 void VisitExpressionAnnotation(Expression* e, Variable* var, bool is_return); | 138 void VisitExpressionAnnotation(Expression* e, Variable* var, bool is_return); |
139 void VisitFunctionAnnotation(FunctionLiteral* f); | 139 void VisitFunctionAnnotation(FunctionLiteral* f); |
140 void VisitAsmModule(FunctionLiteral* f); | 140 void VisitAsmModule(FunctionLiteral* f); |
141 | 141 |
142 void VisitHeapAccess(Property* expr, bool assigning, Type* assignment_type); | 142 void VisitHeapAccess(Property* expr, bool assigning, Type* assignment_type); |
143 | 143 |
144 void CheckPolymorphicStdlibArguments(enum StandardMember standard_member, | 144 void CheckPolymorphicStdlibArguments(enum StandardMember standard_member, |
145 ZoneList<Expression*>* args); | 145 ZoneList<Expression*>* args); |
146 | 146 |
(...skipping 24 matching lines...) Expand all Loading... |
171 const char* msg); | 171 const char* msg); |
172 | 172 |
173 void VisitLiteral(Literal* expr, bool is_return); | 173 void VisitLiteral(Literal* expr, bool is_return); |
174 | 174 |
175 void VisitIntegerBitwiseOperator(BinaryOperation* expr, Type* left_expected, | 175 void VisitIntegerBitwiseOperator(BinaryOperation* expr, Type* left_expected, |
176 Type* right_expected, Type* result_type, | 176 Type* right_expected, Type* result_type, |
177 bool conversion); | 177 bool conversion); |
178 | 178 |
179 Zone* zone() const { return zone_; } | 179 Zone* zone() const { return zone_; } |
180 | 180 |
181 #define DECLARE_VISIT(type) void Visit##type(type* node) override; | 181 #define DECLARE_VISIT(type) void Visit##type(type* node); |
182 AST_NODE_LIST(DECLARE_VISIT) | 182 AST_NODE_LIST(DECLARE_VISIT) |
183 #undef DECLARE_VISIT | 183 #undef DECLARE_VISIT |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(AsmTyper); | 185 DISALLOW_COPY_AND_ASSIGN(AsmTyper); |
186 }; | 186 }; |
187 } // namespace internal | 187 } // namespace internal |
188 } // namespace v8 | 188 } // namespace v8 |
189 | 189 |
190 #endif // V8_TYPING_ASM_H_ | 190 #endif // V8_TYPING_ASM_H_ |
OLD | NEW |