From c90dc3ed9787a0c671d4efff407911fd3003f786 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 1 Oct 2018 17:50:46 -0700 Subject: Tailcall (#918) This doesn't do any of the real work yet, it just adds the ReturnCall/ReturnCallIndirect Expr and Opcode types, and the "--enable-tail-call" flag. Still TODO: * Parse the opcodes in binary-reader.cc * Validate the opcodes in validator.cc and type-checker.cc * Implement the opcodes in interp.cc * Write standard wabt tests, and enable the spec proposal tests too --- src/validator.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/validator.cc') diff --git a/src/validator.cc b/src/validator.cc index 27bf2422..fc255b43 100644 --- a/src/validator.cc +++ b/src/validator.cc @@ -70,6 +70,8 @@ class Validator : public ExprVisitor::Delegate { Result OnMemorySizeExpr(MemorySizeExpr*) override; Result OnNopExpr(NopExpr*) override; Result OnReturnExpr(ReturnExpr*) override; + Result OnReturnCallExpr(ReturnCallExpr*) override; + Result OnReturnCallIndirectExpr(ReturnCallIndirectExpr*) override; Result OnSelectExpr(SelectExpr*) override; Result OnSetGlobalExpr(SetGlobalExpr*) override; Result OnSetLocalExpr(SetLocalExpr*) override; @@ -708,6 +710,16 @@ Result Validator::OnReturnExpr(ReturnExpr* expr) { return Result::Ok; } +Result Validator::OnReturnCallExpr(ReturnCallExpr* expr) { + // TODO(binji): implement. + return Result::Error; +} + +Result Validator::OnReturnCallIndirectExpr(ReturnCallIndirectExpr* expr) { + // TODO(binji): implement. + return Result::Error; +} + Result Validator::OnSelectExpr(SelectExpr* expr) { expr_loc_ = &expr->loc; typechecker_.OnSelect(); -- cgit v1.2.3