// Copyright 2017 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_ASMJS_ASM_PARSER_H_ #define V8_ASMJS_ASM_PARSER_H_ #include <memory> #include "src/asmjs/asm-scanner.h" #include "src/asmjs/asm-types.h" #include "src/base/enum-set.h" #include "src/base/vector.h" #include "src/wasm/wasm-module-builder.h" #include "src/zone/zone-containers.h" namespace v8 { namespace internal { class Utf16CharacterStream; namespace wasm { // A custom parser + validator + wasm converter for asm.js: // http://asmjs.org/spec/latest/ // This parser intentionally avoids the portion of JavaScript parsing // that are not required to determine if code is valid asm.js code. // * It is mostly one pass. // * It bails out on unexpected input. // * It assumes strict ordering insofar as permitted by asm.js validation rules. // * It relies on a custom scanner that provides de-duped identifiers in two // scopes (local + module wide). class AsmJsParser { … }; } // namespace wasm } // namespace internal } // namespace v8 #endif // V8_ASMJS_ASM_PARSER_H_