| 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_set> | 10 #include <unordered_set> |
| 11 | 11 |
| 12 #include "src/allocation.h" | 12 #include "src/allocation.h" |
| 13 #include "src/asmjs/asm-types.h" | 13 #include "src/asmjs/asm-types.h" |
| 14 #include "src/ast/ast-type-bounds.h" | 14 #include "src/ast/ast-type-bounds.h" |
| 15 #include "src/ast/ast-types.h" | 15 #include "src/ast/ast-types.h" |
| 16 #include "src/ast/ast.h" | 16 #include "src/ast/ast.h" |
| 17 #include "src/effects.h" | 17 #include "src/effects.h" |
| 18 #include "src/messages.h" |
| 18 #include "src/type-info.h" | 19 #include "src/type-info.h" |
| 19 #include "src/zone/zone-containers.h" | 20 #include "src/zone/zone-containers.h" |
| 20 #include "src/zone/zone.h" | 21 #include "src/zone/zone.h" |
| 21 | 22 |
| 22 namespace v8 { | 23 namespace v8 { |
| 23 namespace internal { | 24 namespace internal { |
| 24 namespace wasm { | 25 namespace wasm { |
| 25 | 26 |
| 26 class AsmType; | 27 class AsmType; |
| 27 class AsmTyperHarnessBuilder; | 28 class AsmTyperHarnessBuilder; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 kMathPI, | 64 kMathPI, |
| 64 kMathSQRT1_2, | 65 kMathSQRT1_2, |
| 65 kMathSQRT2, | 66 kMathSQRT2, |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 ~AsmTyper() = default; | 69 ~AsmTyper() = default; |
| 69 AsmTyper(Isolate* isolate, Zone* zone, Script* script, FunctionLiteral* root); | 70 AsmTyper(Isolate* isolate, Zone* zone, Script* script, FunctionLiteral* root); |
| 70 | 71 |
| 71 bool Validate(); | 72 bool Validate(); |
| 72 | 73 |
| 73 const char* error_message() const { return error_message_; } | 74 Handle<JSMessageObject> error_message() const { return error_message_; } |
| 74 | 75 |
| 75 AsmType* TypeOf(AstNode* node) const; | 76 AsmType* TypeOf(AstNode* node) const; |
| 76 AsmType* TypeOf(Variable* v) const; | 77 AsmType* TypeOf(Variable* v) const; |
| 77 StandardMember VariableAsStandardMember(Variable* var); | 78 StandardMember VariableAsStandardMember(Variable* var); |
| 78 | 79 |
| 79 typedef std::unordered_set<StandardMember, std::hash<int> > StdlibSet; | 80 typedef std::unordered_set<StandardMember, std::hash<int> > StdlibSet; |
| 80 | 81 |
| 81 StdlibSet StdlibUses() const { return stdlib_uses_; } | 82 StdlibSet StdlibUses() const { return stdlib_uses_; } |
| 82 | 83 |
| 83 // Each FFI import has a usage-site signature associated with it. | 84 // Each FFI import has a usage-site signature associated with it. |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // 3 Environments | 343 // 3 Environments |
| 343 ZoneHashMap global_scope_; // 3.1 Global environment | 344 ZoneHashMap global_scope_; // 3.1 Global environment |
| 344 ZoneHashMap local_scope_; // 3.2 Variable environment | 345 ZoneHashMap local_scope_; // 3.2 Variable environment |
| 345 | 346 |
| 346 std::uintptr_t stack_limit_; | 347 std::uintptr_t stack_limit_; |
| 347 bool stack_overflow_ = false; | 348 bool stack_overflow_ = false; |
| 348 ZoneMap<AstNode*, AsmType*> node_types_; | 349 ZoneMap<AstNode*, AsmType*> node_types_; |
| 349 static const int kErrorMessageLimit = 128; | 350 static const int kErrorMessageLimit = 128; |
| 350 AsmType* fround_type_; | 351 AsmType* fround_type_; |
| 351 AsmType* ffi_type_; | 352 AsmType* ffi_type_; |
| 352 char error_message_[kErrorMessageLimit]; | 353 Handle<JSMessageObject> error_message_; |
| 353 StdlibSet stdlib_uses_; | 354 StdlibSet stdlib_uses_; |
| 354 | 355 |
| 355 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmTyper); | 356 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmTyper); |
| 356 }; | 357 }; |
| 357 | 358 |
| 358 } // namespace wasm | 359 } // namespace wasm |
| 359 } // namespace internal | 360 } // namespace internal |
| 360 } // namespace v8 | 361 } // namespace v8 |
| 361 | 362 |
| 362 #endif // SRC_ASMJS_ASM_TYPER_H_ | 363 #endif // SRC_ASMJS_ASM_TYPER_H_ |
| OLD | NEW |