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 | 11 |
11 #include "src/allocation.h" | 12 #include "src/allocation.h" |
12 #include "src/asmjs/asm-types.h" | 13 #include "src/asmjs/asm-types.h" |
13 #include "src/ast/ast-type-bounds.h" | 14 #include "src/ast/ast-type-bounds.h" |
14 #include "src/ast/ast.h" | 15 #include "src/ast/ast.h" |
15 #include "src/effects.h" | 16 #include "src/effects.h" |
16 #include "src/type-info.h" | 17 #include "src/type-info.h" |
17 #include "src/types.h" | 18 #include "src/types.h" |
18 #include "src/zone-containers.h" | 19 #include "src/zone-containers.h" |
19 #include "src/zone.h" | 20 #include "src/zone.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 ~AsmTyper() = default; | 68 ~AsmTyper() = default; |
68 AsmTyper(Isolate* isolate, Zone* zone, Script* script, FunctionLiteral* root); | 69 AsmTyper(Isolate* isolate, Zone* zone, Script* script, FunctionLiteral* root); |
69 | 70 |
70 bool Validate(); | 71 bool Validate(); |
71 | 72 |
72 const char* error_message() const { return error_message_; } | 73 const char* error_message() const { return error_message_; } |
73 | 74 |
74 AsmType* TypeOf(AstNode* node) const; | 75 AsmType* TypeOf(AstNode* node) const; |
75 StandardMember VariableAsStandardMember(Variable* var); | 76 StandardMember VariableAsStandardMember(Variable* var); |
76 | 77 |
| 78 typedef std::unordered_set<StandardMember, std::hash<int> > StdlibSet; |
| 79 |
| 80 StdlibSet StdlibUses() const { return stdlib_uses_; } |
| 81 |
77 private: | 82 private: |
78 friend class v8::internal::wasm::AsmTyperHarnessBuilder; | 83 friend class v8::internal::wasm::AsmTyperHarnessBuilder; |
79 | 84 |
80 class VariableInfo : public ZoneObject { | 85 class VariableInfo : public ZoneObject { |
81 public: | 86 public: |
82 enum Mutability { | 87 enum Mutability { |
83 kInvalidMutability, | 88 kInvalidMutability, |
84 kLocal, | 89 kLocal, |
85 kMutableGlobal, | 90 kMutableGlobal, |
86 kImmutableGlobal, | 91 kImmutableGlobal, |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 ZoneHashMap global_scope_; // 3.1 Global environment | 318 ZoneHashMap global_scope_; // 3.1 Global environment |
314 ZoneHashMap local_scope_; // 3.2 Variable environment | 319 ZoneHashMap local_scope_; // 3.2 Variable environment |
315 | 320 |
316 std::uintptr_t stack_limit_; | 321 std::uintptr_t stack_limit_; |
317 bool stack_overflow_ = false; | 322 bool stack_overflow_ = false; |
318 ZoneMap<AstNode*, AsmType*> node_types_; | 323 ZoneMap<AstNode*, AsmType*> node_types_; |
319 static const int kErrorMessageLimit = 100; | 324 static const int kErrorMessageLimit = 100; |
320 AsmType* fround_type_; | 325 AsmType* fround_type_; |
321 AsmType* ffi_type_; | 326 AsmType* ffi_type_; |
322 char error_message_[kErrorMessageLimit]; | 327 char error_message_[kErrorMessageLimit]; |
| 328 StdlibSet stdlib_uses_; |
323 | 329 |
324 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmTyper); | 330 DISALLOW_IMPLICIT_CONSTRUCTORS(AsmTyper); |
325 }; | 331 }; |
326 | 332 |
327 } // namespace wasm | 333 } // namespace wasm |
328 } // namespace internal | 334 } // namespace internal |
329 } // namespace v8 | 335 } // namespace v8 |
330 | 336 |
331 #endif // SRC_ASMJS_ASM_TYPER_H_ | 337 #endif // SRC_ASMJS_ASM_TYPER_H_ |
OLD | NEW |