Index: src/asmjs/asm-typer.h |
diff --git a/src/asmjs/asm-typer.h b/src/asmjs/asm-typer.h |
index 0d7aa2542076dade88371f9761c913aca1f06a12..4fb402949d8aaa81605b43c34a6806c8bad42062 100644 |
--- a/src/asmjs/asm-typer.h |
+++ b/src/asmjs/asm-typer.h |
@@ -73,12 +73,26 @@ class AsmTyper final { |
const char* error_message() const { return error_message_; } |
AsmType* TypeOf(AstNode* node) const; |
+ AsmType* TypeOf(Variable* v) const; |
StandardMember VariableAsStandardMember(Variable* var); |
typedef std::unordered_set<StandardMember, std::hash<int> > StdlibSet; |
StdlibSet StdlibUses() const { return stdlib_uses_; } |
+ // Each FFI import has a usage-site signature associated with it. |
+ struct FFIUseSignature { |
+ Variable* var; |
+ ZoneVector<AsmType*> arg_types_; |
+ AsmType* return_type_; |
+ FFIUseSignature(Variable* v, Zone* zone) |
+ : var(v), arg_types_(zone), return_type_(nullptr) {} |
+ }; |
+ |
+ const ZoneVector<FFIUseSignature>& FFIUseSignatures() { |
+ return ffi_use_signatures_; |
+ } |
+ |
private: |
friend class v8::internal::wasm::AsmTyperHarnessBuilder; |
@@ -192,7 +206,7 @@ class AsmTyper final { |
// Lookup(Delta, Gamma, x) |
// |
// Delta is the global_scope_ member, and Gamma, local_scope_. |
- VariableInfo* Lookup(Variable* variable); |
+ VariableInfo* Lookup(Variable* variable) const; |
// All of the ValidateXXX methods below return AsmType::None() in case of |
// validation failure. |
@@ -306,6 +320,7 @@ class AsmTyper final { |
AsmType* return_type_ = nullptr; |
ZoneVector<VariableInfo*> forward_definitions_; |
+ ZoneVector<FFIUseSignature> ffi_use_signatures_; |
ObjectTypeMap stdlib_types_; |
ObjectTypeMap stdlib_math_types_; |