1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/frontend/BytecodeCompiler.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,76 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99: 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef frontend_BytecodeCompiler_h 1.11 +#define frontend_BytecodeCompiler_h 1.12 + 1.13 +#include "NamespaceImports.h" 1.14 + 1.15 +class JSLinearString; 1.16 + 1.17 +namespace js { 1.18 + 1.19 +class AutoNameVector; 1.20 +class LazyScript; 1.21 +class LifoAlloc; 1.22 +struct SourceCompressionTask; 1.23 + 1.24 +namespace frontend { 1.25 + 1.26 +JSScript * 1.27 +CompileScript(ExclusiveContext *cx, LifoAlloc *alloc, 1.28 + HandleObject scopeChain, HandleScript evalCaller, 1.29 + const ReadOnlyCompileOptions &options, SourceBufferHolder &srcBuf, 1.30 + JSString *source_ = nullptr, unsigned staticLevel = 0, 1.31 + SourceCompressionTask *extraSct = nullptr); 1.32 + 1.33 +bool 1.34 +CompileLazyFunction(JSContext *cx, Handle<LazyScript*> lazy, const jschar *chars, size_t length); 1.35 + 1.36 +bool 1.37 +CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, 1.38 + const ReadOnlyCompileOptions &options, 1.39 + const AutoNameVector &formals, JS::SourceBufferHolder &srcBuf); 1.40 +bool 1.41 +CompileStarGeneratorBody(JSContext *cx, MutableHandleFunction fun, 1.42 + const ReadOnlyCompileOptions &options, 1.43 + const AutoNameVector &formals, JS::SourceBufferHolder &srcBuf); 1.44 + 1.45 +ScriptSourceObject * 1.46 +CreateScriptSourceObject(ExclusiveContext *cx, const ReadOnlyCompileOptions &options); 1.47 + 1.48 +/* 1.49 + * This should be called while still on the main thread if compilation will 1.50 + * occur on a worker thread. 1.51 + */ 1.52 +void 1.53 +MaybeCallSourceHandler(JSContext *cx, const ReadOnlyCompileOptions &options, 1.54 + JS::SourceBufferHolder &srcBuf); 1.55 + 1.56 +/* 1.57 + * True if str consists of an IdentifierStart character, followed by one or 1.58 + * more IdentifierPart characters, i.e. it matches the IdentifierName production 1.59 + * in the language spec. 1.60 + * 1.61 + * This returns true even if str is a keyword like "if". 1.62 + * 1.63 + * Defined in TokenStream.cpp. 1.64 + */ 1.65 +bool 1.66 +IsIdentifier(JSLinearString *str); 1.67 + 1.68 +/* True if str is a keyword. Defined in TokenStream.cpp. */ 1.69 +bool 1.70 +IsKeyword(JSLinearString *str); 1.71 + 1.72 +/* GC marking. Defined in Parser.cpp. */ 1.73 +void 1.74 +MarkParser(JSTracer *trc, AutoGCRooter *parser); 1.75 + 1.76 +} /* namespace frontend */ 1.77 +} /* namespace js */ 1.78 + 1.79 +#endif /* frontend_BytecodeCompiler_h */