michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef builtin_Eval_h michael@0: #define builtin_Eval_h michael@0: michael@0: #include "jsbytecode.h" michael@0: #include "NamespaceImports.h" michael@0: michael@0: namespace js { michael@0: michael@0: // The C++ native for 'eval' (ES5 15.1.2.1). The function is named "indirect michael@0: // eval" because "direct eval" calls (as defined by the spec) will emit michael@0: // JSOP_EVAL which in turn calls DirectEval. Thus, even though IndirectEval is michael@0: // the callee function object for *all* calls to eval, it is by construction michael@0: // only ever called in the case indirect eval. michael@0: extern bool michael@0: IndirectEval(JSContext *cx, unsigned argc, Value *vp); michael@0: michael@0: // Performs a direct eval for the given arguments, which must correspond to the michael@0: // currently-executing stack frame, which must be a script frame. On completion michael@0: // the result is returned in args.rval. michael@0: extern bool michael@0: DirectEval(JSContext *cx, const CallArgs &args); michael@0: michael@0: // Performs a direct eval called from Ion code. michael@0: extern bool michael@0: DirectEvalStringFromIon(JSContext *cx, michael@0: HandleObject scopeObj, HandleScript callerScript, michael@0: HandleValue thisValue, HandleString str, michael@0: jsbytecode * pc, MutableHandleValue vp); michael@0: extern bool michael@0: DirectEvalValueFromIon(JSContext *cx, michael@0: HandleObject scopeObj, HandleScript callerScript, michael@0: HandleValue thisValue, HandleValue evalArg, michael@0: jsbytecode * pc, MutableHandleValue vp); michael@0: michael@0: // True iff fun is a built-in eval function. michael@0: extern bool michael@0: IsAnyBuiltinEval(JSFunction *fun); michael@0: michael@0: } // namespace js michael@0: #endif /* builtin_Eval_h */