js/src/frontend/BytecodeCompiler.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 * vim: set ts=8 sts=4 et sw=4 tw=99:
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef frontend_BytecodeCompiler_h
michael@0 8 #define frontend_BytecodeCompiler_h
michael@0 9
michael@0 10 #include "NamespaceImports.h"
michael@0 11
michael@0 12 class JSLinearString;
michael@0 13
michael@0 14 namespace js {
michael@0 15
michael@0 16 class AutoNameVector;
michael@0 17 class LazyScript;
michael@0 18 class LifoAlloc;
michael@0 19 struct SourceCompressionTask;
michael@0 20
michael@0 21 namespace frontend {
michael@0 22
michael@0 23 JSScript *
michael@0 24 CompileScript(ExclusiveContext *cx, LifoAlloc *alloc,
michael@0 25 HandleObject scopeChain, HandleScript evalCaller,
michael@0 26 const ReadOnlyCompileOptions &options, SourceBufferHolder &srcBuf,
michael@0 27 JSString *source_ = nullptr, unsigned staticLevel = 0,
michael@0 28 SourceCompressionTask *extraSct = nullptr);
michael@0 29
michael@0 30 bool
michael@0 31 CompileLazyFunction(JSContext *cx, Handle<LazyScript*> lazy, const jschar *chars, size_t length);
michael@0 32
michael@0 33 bool
michael@0 34 CompileFunctionBody(JSContext *cx, MutableHandleFunction fun,
michael@0 35 const ReadOnlyCompileOptions &options,
michael@0 36 const AutoNameVector &formals, JS::SourceBufferHolder &srcBuf);
michael@0 37 bool
michael@0 38 CompileStarGeneratorBody(JSContext *cx, MutableHandleFunction fun,
michael@0 39 const ReadOnlyCompileOptions &options,
michael@0 40 const AutoNameVector &formals, JS::SourceBufferHolder &srcBuf);
michael@0 41
michael@0 42 ScriptSourceObject *
michael@0 43 CreateScriptSourceObject(ExclusiveContext *cx, const ReadOnlyCompileOptions &options);
michael@0 44
michael@0 45 /*
michael@0 46 * This should be called while still on the main thread if compilation will
michael@0 47 * occur on a worker thread.
michael@0 48 */
michael@0 49 void
michael@0 50 MaybeCallSourceHandler(JSContext *cx, const ReadOnlyCompileOptions &options,
michael@0 51 JS::SourceBufferHolder &srcBuf);
michael@0 52
michael@0 53 /*
michael@0 54 * True if str consists of an IdentifierStart character, followed by one or
michael@0 55 * more IdentifierPart characters, i.e. it matches the IdentifierName production
michael@0 56 * in the language spec.
michael@0 57 *
michael@0 58 * This returns true even if str is a keyword like "if".
michael@0 59 *
michael@0 60 * Defined in TokenStream.cpp.
michael@0 61 */
michael@0 62 bool
michael@0 63 IsIdentifier(JSLinearString *str);
michael@0 64
michael@0 65 /* True if str is a keyword. Defined in TokenStream.cpp. */
michael@0 66 bool
michael@0 67 IsKeyword(JSLinearString *str);
michael@0 68
michael@0 69 /* GC marking. Defined in Parser.cpp. */
michael@0 70 void
michael@0 71 MarkParser(JSTracer *trc, AutoGCRooter *parser);
michael@0 72
michael@0 73 } /* namespace frontend */
michael@0 74 } /* namespace js */
michael@0 75
michael@0 76 #endif /* frontend_BytecodeCompiler_h */

mercurial