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_ASMJS_ASM_TYPER_H_ | 5 #ifndef SRC_ASMJS_ASM_TYPER_H_ |
6 #define SRC_ASMJS_ASM_TYPER_H_ | 6 #define SRC_ASMJS_ASM_TYPER_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 kMathLN10, | 61 kMathLN10, |
62 kMathLN2, | 62 kMathLN2, |
63 kMathLOG2E, | 63 kMathLOG2E, |
64 kMathLOG10E, | 64 kMathLOG10E, |
65 kMathPI, | 65 kMathPI, |
66 kMathSQRT1_2, | 66 kMathSQRT1_2, |
67 kMathSQRT2, | 67 kMathSQRT2, |
68 }; | 68 }; |
69 | 69 |
70 ~AsmTyper() = default; | 70 ~AsmTyper() = default; |
71 AsmTyper(Isolate* isolate, Zone* zone, Script* script, FunctionLiteral* root); | 71 AsmTyper(Isolate* isolate, Zone* zone, Handle<Script> script, |
| 72 FunctionLiteral* root); |
72 | 73 |
73 bool Validate(); | 74 bool Validate(); |
74 // Do asm.js validation in phases (to interleave with conversion to wasm). | 75 // Do asm.js validation in phases (to interleave with conversion to wasm). |
75 bool ValidateBeforeFunctionsPhase(); | 76 bool ValidateBeforeFunctionsPhase(); |
76 bool ValidateInnerFunction(FunctionDeclaration* decl); | 77 bool ValidateInnerFunction(FunctionDeclaration* decl); |
77 bool ValidateAfterFunctionsPhase(); | 78 bool ValidateAfterFunctionsPhase(); |
78 void ClearFunctionNodeTypes(); | 79 void ClearFunctionNodeTypes(); |
79 | 80 |
80 const char* error_message() const { return error_message_; } | 81 const char* error_message() const { return error_message_; } |
81 | 82 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // 5.4 VariableTypeAnnotations | 363 // 5.4 VariableTypeAnnotations |
363 // 5.5 GlobalVariableTypeAnnotations | 364 // 5.5 GlobalVariableTypeAnnotations |
364 AsmType* VariableTypeAnnotations( | 365 AsmType* VariableTypeAnnotations( |
365 Expression* initializer, | 366 Expression* initializer, |
366 VariableInfo::Mutability global = VariableInfo::kLocal); | 367 VariableInfo::Mutability global = VariableInfo::kLocal); |
367 AsmType* ImportExpression(Property* import); | 368 AsmType* ImportExpression(Property* import); |
368 AsmType* NewHeapView(CallNew* new_heap_view); | 369 AsmType* NewHeapView(CallNew* new_heap_view); |
369 | 370 |
370 Isolate* isolate_; | 371 Isolate* isolate_; |
371 Zone* zone_; | 372 Zone* zone_; |
372 Script* script_; | 373 Handle<Script> script_; |
373 FunctionLiteral* root_; | 374 FunctionLiteral* root_; |
374 bool in_function_ = false; | 375 bool in_function_ = false; |
375 | 376 |
376 AsmType* return_type_ = nullptr; | 377 AsmType* return_type_ = nullptr; |
377 | 378 |
378 ZoneVector<VariableInfo*> forward_definitions_; | 379 ZoneVector<VariableInfo*> forward_definitions_; |
379 ZoneVector<FFIUseSignature> ffi_use_signatures_; | 380 ZoneVector<FFIUseSignature> ffi_use_signatures_; |
380 ObjectTypeMap stdlib_types_; | 381 ObjectTypeMap stdlib_types_; |
381 ObjectTypeMap stdlib_math_types_; | 382 ObjectTypeMap stdlib_math_types_; |
382 | 383 |
(...skipping 21 matching lines...) Expand all Loading... |
404 ZoneVector<Assignment*> function_pointer_tables_; | 405 ZoneVector<Assignment*> function_pointer_tables_; |
405 | 406 |
406 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmTyper); | 407 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmTyper); |
407 }; | 408 }; |
408 | 409 |
409 } // namespace wasm | 410 } // namespace wasm |
410 } // namespace internal | 411 } // namespace internal |
411 } // namespace v8 | 412 } // namespace v8 |
412 | 413 |
413 #endif // SRC_ASMJS_ASM_TYPER_H_ | 414 #endif // SRC_ASMJS_ASM_TYPER_H_ |
OLD | NEW |