Index: src/asmjs/asm-typer.h |
diff --git a/src/asmjs/asm-typer.h b/src/asmjs/asm-typer.h |
index e1b36bcf7200bd1a9a6cf9e26fde6625b7124c1a..c7723b2b654e1723f5dc100f93e75dafc720e8a7 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() { |
Mircea Trofin
2016/09/19 16:16:24
could this be const ZoneVector<FFIUseSignature>&,
|
+ 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_; |