Bug Summary

File:var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Realm-inl.h
Warning:line 71, column 31
Called C++ object pointer is uninitialized

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name Interpreter.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/js/src -fcoverage-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/js/src -resource-dir /usr/lib/llvm-18/lib/clang/18 -include /var/lib/jenkins/workspace/firefox-scan-build/config/gcc_hidden.h -include /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/js/src/js-confdefs.h -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D DEBUG=1 -D WASM_SUPPORTS_HUGE_MEMORY -D JS_CACHEIR_SPEW -D JS_STRUCTURED_SPEW -D JS_HAS_CTYPES -D FFI_BUILDING -D EXPORT_JS_API -D MOZ_HAS_MOZGLUE -I /var/lib/jenkins/workspace/firefox-scan-build/js/src -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/js/src -I /var/lib/jenkins/workspace/firefox-scan-build/intl/icu_capi/c/include -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/js/src/ctypes/libffi/include -I /var/lib/jenkins/workspace/firefox-scan-build/js/src/ctypes/libffi/src/x86 -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/x86_64-linux-gnu/c++/13 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/backward -internal-isystem /usr/lib/llvm-18/lib/clang/18/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wno-error=tautological-type-limit-compare -Wno-invalid-offsetof -Wno-range-loop-analysis -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-deprecated-this-capture -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -fdeprecated-macro -ferror-limit 19 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -fno-aligned-allocation -vectorize-loops -vectorize-slp -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2024-05-16-034744-15991-1 -x c++ /var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp

/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp

1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7/*
8 * JavaScript bytecode interpreter.
9 */
10
11#include "vm/Interpreter-inl.h"
12
13#include "mozilla/DebugOnly.h"
14#include "mozilla/FloatingPoint.h"
15#include "mozilla/Maybe.h"
16#include "mozilla/ScopeExit.h"
17#include "mozilla/Sprintf.h"
18#include "mozilla/TimeStamp.h"
19#include "mozilla/WrappingOperations.h"
20
21#include <string.h>
22
23#include "jsapi.h"
24#include "jslibmath.h"
25#include "jsmath.h"
26#include "jsnum.h"
27
28#include "builtin/Array.h"
29#include "builtin/Eval.h"
30#include "builtin/ModuleObject.h"
31#include "builtin/Object.h"
32#include "builtin/Promise.h"
33#include "gc/GC.h"
34#include "jit/BaselineJIT.h"
35#include "jit/Jit.h"
36#include "jit/JitRuntime.h"
37#include "js/experimental/JitInfo.h" // JSJitInfo
38#include "js/friend/ErrorMessages.h" // js::GetErrorMessage, JSMSG_*
39#include "js/friend/StackLimits.h" // js::AutoCheckRecursionLimit
40#include "js/friend/WindowProxy.h" // js::IsWindowProxy
41#include "js/Printer.h"
42#include "proxy/DeadObjectProxy.h"
43#include "util/CheckedArithmetic.h"
44#include "util/StringBuffer.h"
45#include "vm/AsyncFunction.h"
46#include "vm/AsyncIteration.h"
47#include "vm/BigIntType.h"
48#include "vm/BytecodeUtil.h" // JSDVG_SEARCH_STACK
49#include "vm/EqualityOperations.h" // js::StrictlyEqual
50#include "vm/GeneratorObject.h"
51#include "vm/Iteration.h"
52#include "vm/JSAtomUtils.h" // AtomToPrintableString
53#include "vm/JSContext.h"
54#include "vm/JSFunction.h"
55#include "vm/JSObject.h"
56#include "vm/JSScript.h"
57#include "vm/Opcodes.h"
58#include "vm/PIC.h"
59#include "vm/PlainObject.h" // js::PlainObject
60#include "vm/Scope.h"
61#include "vm/Shape.h"
62#include "vm/SharedStencil.h" // GCThingIndex
63#include "vm/StringType.h"
64#include "vm/ThrowMsgKind.h" // ThrowMsgKind
65#include "vm/Time.h"
66#include "vm/TypeofEqOperand.h" // TypeofEqOperand
67#ifdef ENABLE_RECORD_TUPLE
68# include "vm/RecordType.h"
69# include "vm/TupleType.h"
70#endif
71
72#include "builtin/Boolean-inl.h"
73#include "debugger/DebugAPI-inl.h"
74#include "vm/ArgumentsObject-inl.h"
75#include "vm/EnvironmentObject-inl.h"
76#include "vm/GeckoProfiler-inl.h"
77#include "vm/JSScript-inl.h"
78#include "vm/NativeObject-inl.h"
79#include "vm/ObjectOperations-inl.h"
80#include "vm/PlainObject-inl.h" // js::CopyInitializerObject, js::CreateThis
81#include "vm/Probes-inl.h"
82#include "vm/Stack-inl.h"
83
84using namespace js;
85
86using mozilla::DebugOnly;
87using mozilla::NumberEqualsInt32;
88
89using js::jit::JitScript;
90
91template <bool Eq>
92static MOZ_ALWAYS_INLINEinline bool LooseEqualityOp(JSContext* cx,
93 InterpreterRegs& regs) {
94 HandleValue rval = regs.stackHandleAt(-1);
95 HandleValue lval = regs.stackHandleAt(-2);
96 bool cond;
97 if (!LooselyEqual(cx, lval, rval, &cond)) {
98 return false;
99 }
100 cond = (cond == Eq);
101 regs.sp--;
102 regs.sp[-1].setBoolean(cond);
103 return true;
104}
105
106JSObject* js::BoxNonStrictThis(JSContext* cx, HandleValue thisv) {
107 MOZ_ASSERT(!thisv.isMagic())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!thisv.isMagic())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!thisv.isMagic()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("!thisv.isMagic()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 107); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!thisv.isMagic()"
")"); do { *((volatile int*)__null) = 107; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
108
109 if (thisv.isNullOrUndefined()) {
110 return cx->global()->lexicalEnvironment().thisObject();
111 }
112
113 if (thisv.isObject()) {
114 return &thisv.toObject();
115 }
116
117 return PrimitiveToObject(cx, thisv);
118}
119
120bool js::GetFunctionThis(JSContext* cx, AbstractFramePtr frame,
121 MutableHandleValue res) {
122 MOZ_ASSERT(frame.isFunctionFrame())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(frame.isFunctionFrame())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(frame.isFunctionFrame()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("frame.isFunctionFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 122); AnnotateMozCrashReason("MOZ_ASSERT" "(" "frame.isFunctionFrame()"
")"); do { *((volatile int*)__null) = 122; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
123 MOZ_ASSERT(!frame.callee()->isArrow())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!frame.callee()->isArrow())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!frame.callee()->isArrow(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!frame.callee()->isArrow()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 123); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!frame.callee()->isArrow()"
")"); do { *((volatile int*)__null) = 123; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
124
125 if (frame.thisArgument().isObject() || frame.callee()->strict()) {
126 res.set(frame.thisArgument());
127 return true;
128 }
129
130 MOZ_ASSERT(!frame.callee()->isSelfHostedBuiltin(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!frame.callee()->isSelfHostedBuiltin())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!frame.callee()->isSelfHostedBuiltin()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!frame.callee()->isSelfHostedBuiltin()"
" (" "Self-hosted builtins must be strict" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 131); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!frame.callee()->isSelfHostedBuiltin()"
") (" "Self-hosted builtins must be strict" ")"); do { *((volatile
int*)__null) = 131; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
131 "Self-hosted builtins must be strict")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!frame.callee()->isSelfHostedBuiltin())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!frame.callee()->isSelfHostedBuiltin()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("!frame.callee()->isSelfHostedBuiltin()"
" (" "Self-hosted builtins must be strict" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 131); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!frame.callee()->isSelfHostedBuiltin()"
") (" "Self-hosted builtins must be strict" ")"); do { *((volatile
int*)__null) = 131; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
132
133 RootedValue thisv(cx, frame.thisArgument());
134
135 // If there is a NSVO on environment chain, use it as basis for fallback
136 // global |this|. This gives a consistent definition of global lexical
137 // |this| between function and global contexts.
138 //
139 // NOTE: If only non-syntactic WithEnvironments are on the chain, we use the
140 // global lexical |this| value. This is for compatibility with the Subscript
141 // Loader.
142 if (frame.script()->hasNonSyntacticScope() && thisv.isNullOrUndefined()) {
143 RootedObject env(cx, frame.environmentChain());
144 while (true) {
145 if (IsNSVOLexicalEnvironment(env) || IsGlobalLexicalEnvironment(env)) {
146 res.setObject(*GetThisObjectOfLexical(env));
147 return true;
148 }
149 if (!env->enclosingEnvironment()) {
150 // This can only happen in Debugger eval frames: in that case we
151 // don't always have a global lexical env, see EvaluateInEnv.
152 MOZ_ASSERT(env->is<GlobalObject>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(env->is<GlobalObject>())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(env->is<GlobalObject>
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("env->is<GlobalObject>()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 152); AnnotateMozCrashReason("MOZ_ASSERT" "(" "env->is<GlobalObject>()"
")"); do { *((volatile int*)__null) = 152; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
153 res.setObject(*GetThisObject(env));
154 return true;
155 }
156 env = env->enclosingEnvironment();
157 }
158 }
159
160 JSObject* obj = BoxNonStrictThis(cx, thisv);
161 if (!obj) {
162 return false;
163 }
164
165 res.setObject(*obj);
166 return true;
167}
168
169void js::GetNonSyntacticGlobalThis(JSContext* cx, HandleObject envChain,
170 MutableHandleValue res) {
171 RootedObject env(cx, envChain);
172 while (true) {
173 if (IsExtensibleLexicalEnvironment(env)) {
174 res.setObject(*GetThisObjectOfLexical(env));
175 return;
176 }
177 if (!env->enclosingEnvironment()) {
178 // This can only happen in Debugger eval frames: in that case we
179 // don't always have a global lexical env, see EvaluateInEnv.
180 MOZ_ASSERT(env->is<GlobalObject>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(env->is<GlobalObject>())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(env->is<GlobalObject>
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("env->is<GlobalObject>()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 180); AnnotateMozCrashReason("MOZ_ASSERT" "(" "env->is<GlobalObject>()"
")"); do { *((volatile int*)__null) = 180; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
181 res.setObject(*GetThisObject(env));
182 return;
183 }
184 env = env->enclosingEnvironment();
185 }
186}
187
188#ifdef DEBUG1
189static bool IsSelfHostedOrKnownBuiltinCtor(JSFunction* fun, JSContext* cx) {
190 if (fun->isSelfHostedOrIntrinsic()) {
191 return true;
192 }
193
194 // GetBuiltinConstructor in MapGroupBy
195 if (fun == cx->global()->maybeGetConstructor(JSProto_Map)) {
196 return true;
197 }
198
199 // GetBuiltinConstructor in intlFallbackSymbol
200 if (fun == cx->global()->maybeGetConstructor(JSProto_Symbol)) {
201 return true;
202 }
203
204 // ConstructorForTypedArray in MergeSortTypedArray
205 if (fun == cx->global()->maybeGetConstructor(JSProto_Int8Array) ||
206 fun == cx->global()->maybeGetConstructor(JSProto_Uint8Array) ||
207 fun == cx->global()->maybeGetConstructor(JSProto_Int16Array) ||
208 fun == cx->global()->maybeGetConstructor(JSProto_Uint16Array) ||
209 fun == cx->global()->maybeGetConstructor(JSProto_Int32Array) ||
210 fun == cx->global()->maybeGetConstructor(JSProto_Uint32Array) ||
211 fun == cx->global()->maybeGetConstructor(JSProto_Float32Array) ||
212 fun == cx->global()->maybeGetConstructor(JSProto_Float64Array) ||
213 fun == cx->global()->maybeGetConstructor(JSProto_Uint8ClampedArray) ||
214 fun == cx->global()->maybeGetConstructor(JSProto_BigInt64Array) ||
215 fun == cx->global()->maybeGetConstructor(JSProto_BigUint64Array)) {
216 return true;
217 }
218
219 return false;
220}
221#endif // DEBUG
222
223bool js::Debug_CheckSelfHosted(JSContext* cx, HandleValue funVal) {
224#ifdef DEBUG1
225 JSFunction* fun = &UncheckedUnwrap(&funVal.toObject())->as<JSFunction>();
226 MOZ_ASSERT(IsSelfHostedOrKnownBuiltinCtor(fun, cx),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSelfHostedOrKnownBuiltinCtor(fun, cx))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsSelfHostedOrKnownBuiltinCtor(fun, cx)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
" (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 229); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
") (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")"); do { *((volatile int*)__null) = 229; __attribute__
((nomerge)) ::abort(); } while (false); } } while (false)
227 "functions directly called inside self-hosted JS must be one of "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSelfHostedOrKnownBuiltinCtor(fun, cx))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsSelfHostedOrKnownBuiltinCtor(fun, cx)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
" (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 229); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
") (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")"); do { *((volatile int*)__null) = 229; __attribute__
((nomerge)) ::abort(); } while (false); } } while (false)
228 "selfhosted function, self-hosted intrinsic, or known built-in "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSelfHostedOrKnownBuiltinCtor(fun, cx))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsSelfHostedOrKnownBuiltinCtor(fun, cx)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
" (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 229); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
") (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")"); do { *((volatile int*)__null) = 229; __attribute__
((nomerge)) ::abort(); } while (false); } } while (false)
229 "constructor")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsSelfHostedOrKnownBuiltinCtor(fun, cx))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsSelfHostedOrKnownBuiltinCtor(fun, cx)))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
" (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 229); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsSelfHostedOrKnownBuiltinCtor(fun, cx)"
") (" "functions directly called inside self-hosted JS must be one of "
"selfhosted function, self-hosted intrinsic, or known built-in "
"constructor" ")"); do { *((volatile int*)__null) = 229; __attribute__
((nomerge)) ::abort(); } while (false); } } while (false)
;
230#else
231 MOZ_CRASH("self-hosted checks should only be done in Debug builds")do { do { } while (false); MOZ_ReportCrash("" "self-hosted checks should only be done in Debug builds"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 231); AnnotateMozCrashReason("MOZ_CRASH(" "self-hosted checks should only be done in Debug builds"
")"); do { *((volatile int*)__null) = 231; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
232#endif
233
234 // This is purely to police self-hosted code. There is no actual operation.
235 return true;
236}
237
238static inline bool GetPropertyOperation(JSContext* cx,
239 Handle<PropertyName*> name,
240 HandleValue lval,
241 MutableHandleValue vp) {
242 if (name == cx->names().length && GetLengthProperty(lval, vp)) {
243 return true;
244 }
245
246 return GetProperty(cx, lval, name, vp);
247}
248
249static inline bool GetNameOperation(JSContext* cx, HandleObject envChain,
250 Handle<PropertyName*> name, JSOp nextOp,
251 MutableHandleValue vp) {
252 /* Kludge to allow (typeof foo == "undefined") tests. */
253 if (IsTypeOfNameOp(nextOp)) {
254 return GetEnvironmentName<GetNameMode::TypeOf>(cx, envChain, name, vp);
255 }
256 return GetEnvironmentName<GetNameMode::Normal>(cx, envChain, name, vp);
257}
258
259bool js::GetImportOperation(JSContext* cx, HandleObject envChain,
260 HandleScript script, jsbytecode* pc,
261 MutableHandleValue vp) {
262 RootedObject env(cx), pobj(cx);
263 Rooted<PropertyName*> name(cx, script->getName(pc));
264 PropertyResult prop;
265
266 MOZ_ALWAYS_TRUE(LookupName(cx, name, envChain, &env, &pobj, &prop))do { if ((__builtin_expect(!!(LookupName(cx, name, envChain, &
env, &pobj, &prop)), 1))) { } else { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(false)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(false))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("false" " (" "LookupName(cx, name, envChain, &env, &pobj, &prop)"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 266); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "LookupName(cx, name, envChain, &env, &pobj, &prop)"
")"); do { *((volatile int*)__null) = 266; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
267 MOZ_ASSERT(env && env->is<ModuleEnvironmentObject>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(env && env->is<ModuleEnvironmentObject
>())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(env && env->is<ModuleEnvironmentObject
>()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("env && env->is<ModuleEnvironmentObject>()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 267); AnnotateMozCrashReason("MOZ_ASSERT" "(" "env && env->is<ModuleEnvironmentObject>()"
")"); do { *((volatile int*)__null) = 267; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
268 MOZ_ASSERT(env->as<ModuleEnvironmentObject>().hasImportBinding(name))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(env->as<ModuleEnvironmentObject>().hasImportBinding
(name))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(env->as<ModuleEnvironmentObject>().hasImportBinding
(name)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("env->as<ModuleEnvironmentObject>().hasImportBinding(name)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 268); AnnotateMozCrashReason("MOZ_ASSERT" "(" "env->as<ModuleEnvironmentObject>().hasImportBinding(name)"
")"); do { *((volatile int*)__null) = 268; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
269 return FetchName<GetNameMode::Normal>(cx, env, pobj, name, prop, vp);
270}
271
272bool js::ReportIsNotFunction(JSContext* cx, HandleValue v, int numToSkip,
273 MaybeConstruct construct) {
274 unsigned error = construct ? JSMSG_NOT_CONSTRUCTOR : JSMSG_NOT_FUNCTION;
275 int spIndex = numToSkip >= 0 ? -(numToSkip + 1) : JSDVG_SEARCH_STACK1;
276
277 ReportValueError(cx, error, spIndex, v, nullptr);
278 return false;
279}
280
281JSObject* js::ValueToCallable(JSContext* cx, HandleValue v, int numToSkip,
282 MaybeConstruct construct) {
283 if (v.isObject() && v.toObject().isCallable()) {
284 return &v.toObject();
285 }
286
287 ReportIsNotFunction(cx, v, numToSkip, construct);
288 return nullptr;
289}
290
291static bool MaybeCreateThisForConstructor(JSContext* cx, const CallArgs& args) {
292 if (args.thisv().isObject()) {
293 return true;
294 }
295
296 RootedFunction callee(cx, &args.callee().as<JSFunction>());
297 RootedObject newTarget(cx, &args.newTarget().toObject());
298
299 MOZ_ASSERT(callee->hasBytecode())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(callee->hasBytecode())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(callee->hasBytecode()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("callee->hasBytecode()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 299); AnnotateMozCrashReason("MOZ_ASSERT" "(" "callee->hasBytecode()"
")"); do { *((volatile int*)__null) = 299; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
300
301 if (!CreateThis(cx, callee, newTarget, GenericObject, args.mutableThisv())) {
302 return false;
303 }
304
305 // Ensure the callee still has a non-lazy script. We normally don't relazify
306 // in active compartments, but the .prototype lookup might have called the
307 // relazifyFunctions testing function that doesn't have this restriction.
308 return JSFunction::getOrCreateScript(cx, callee);
309}
310
311#ifdef ENABLE_RECORD_TUPLE
312static bool AddRecordSpreadOperation(JSContext* cx, HandleValue recHandle,
313 HandleValue spreadeeHandle) {
314 MOZ_ASSERT(recHandle.toExtendedPrimitive().is<RecordType>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(recHandle.toExtendedPrimitive().is<RecordType>
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(recHandle.toExtendedPrimitive().is<RecordType>
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("recHandle.toExtendedPrimitive().is<RecordType>()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 314); AnnotateMozCrashReason("MOZ_ASSERT" "(" "recHandle.toExtendedPrimitive().is<RecordType>()"
")"); do { *((volatile int*)__null) = 314; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
315 RecordType* rec = &recHandle.toExtendedPrimitive().as<RecordType>();
316
317 RootedObject obj(cx, ToObjectOrGetObjectPayload(cx, spreadeeHandle));
318
319 RootedIdVector keys(cx);
320 if (!GetPropertyKeys(cx, obj, JSITER_OWNONLY0x8 | JSITER_SYMBOLS0x20, &keys)) {
321 return false;
322 }
323
324 size_t len = keys.length();
325 RootedId propKey(cx);
326 RootedValue propValue(cx);
327 for (size_t i = 0; i < len; i++) {
328 propKey.set(keys[i]);
329
330 // Step 4.c.ii.1.
331 if (MOZ_UNLIKELY(!GetProperty(cx, obj, obj, propKey, &propValue))(__builtin_expect(!!(!GetProperty(cx, obj, obj, propKey, &
propValue)), 0))
) {
332 return false;
333 }
334
335 if (MOZ_UNLIKELY(!rec->initializeNextProperty(cx, propKey, propValue))(__builtin_expect(!!(!rec->initializeNextProperty(cx, propKey
, propValue)), 0))
) {
336 return false;
337 }
338 }
339
340 return true;
341}
342#endif
343
344InterpreterFrame* InvokeState::pushInterpreterFrame(JSContext* cx) {
345 return cx->interpreterStack().pushInvokeFrame(cx, args_, construct_);
346}
347
348InterpreterFrame* ExecuteState::pushInterpreterFrame(JSContext* cx) {
349 return cx->interpreterStack().pushExecuteFrame(cx, script_, envChain_,
350 evalInFrame_);
351}
352
353InterpreterFrame* RunState::pushInterpreterFrame(JSContext* cx) {
354 if (isInvoke()) {
355 return asInvoke()->pushInterpreterFrame(cx);
356 }
357 return asExecute()->pushInterpreterFrame(cx);
358}
359
360static MOZ_ALWAYS_INLINEinline bool MaybeEnterInterpreterTrampoline(JSContext* cx,
361 RunState& state) {
362#ifdef NIGHTLY_BUILD1
363 if (jit::JitOptions.emitInterpreterEntryTrampoline &&
364 cx->runtime()->hasJitRuntime()) {
365 js::jit::JitRuntime* jitRuntime = cx->runtime()->jitRuntime();
366 JSScript* script = state.script();
367
368 uint8_t* codeRaw = nullptr;
369 auto p = jitRuntime->getInterpreterEntryMap()->lookup(script);
370 if (p) {
371 codeRaw = p->value().raw();
372 } else {
373 js::jit::JitCode* code =
374 jitRuntime->generateEntryTrampolineForScript(cx, script);
375 if (!code) {
376 ReportOutOfMemory(cx);
377 return false;
378 }
379
380 js::jit::EntryTrampoline entry(cx, code);
381 if (!jitRuntime->getInterpreterEntryMap()->put(script, entry)) {
382 ReportOutOfMemory(cx);
383 return false;
384 }
385 codeRaw = code->raw();
386 }
387
388 MOZ_ASSERT(codeRaw, "Should have a valid trampoline here.")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(codeRaw)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(codeRaw))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("codeRaw" " (" "Should have a valid trampoline here."
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 388); AnnotateMozCrashReason("MOZ_ASSERT" "(" "codeRaw" ") ("
"Should have a valid trampoline here." ")"); do { *((volatile
int*)__null) = 388; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
389 // The C++ entry thunk is located at the vmInterpreterEntryOffset offset.
390 codeRaw += jitRuntime->vmInterpreterEntryOffset();
391 return js::jit::EnterInterpreterEntryTrampoline(codeRaw, cx, &state);
392 }
393#endif
394 return Interpret(cx, state);
395}
396
397// MSVC with PGO inlines a lot of functions in RunScript, resulting in large
398// stack frames and stack overflow issues, see bug 1167883. Turn off PGO to
399// avoid this.
400#ifdef _MSC_VER
401# pragma optimize("g", off)
402#endif
403bool js::RunScript(JSContext* cx, RunState& state) {
404 AutoCheckRecursionLimit recursion(cx);
405 if (!recursion.check(cx)) {
406 return false;
407 }
408
409 MOZ_ASSERT_IF(cx->runtime()->hasJitRuntime(),do { if (cx->runtime()->hasJitRuntime()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(!cx->
runtime()->jitRuntime()->disallowArbitraryCode())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cx->runtime()->jitRuntime()->disallowArbitraryCode
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cx->runtime()->jitRuntime()->disallowArbitraryCode()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 410); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->runtime()->jitRuntime()->disallowArbitraryCode()"
")"); do { *((volatile int*)__null) = 410; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
410 !cx->runtime()->jitRuntime()->disallowArbitraryCode())do { if (cx->runtime()->hasJitRuntime()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(!cx->
runtime()->jitRuntime()->disallowArbitraryCode())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cx->runtime()->jitRuntime()->disallowArbitraryCode
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!cx->runtime()->jitRuntime()->disallowArbitraryCode()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 410); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->runtime()->jitRuntime()->disallowArbitraryCode()"
")"); do { *((volatile int*)__null) = 410; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
411
412 // Since any script can conceivably GC, make sure it's safe to do so.
413 cx->verifyIsSafeToGC();
414
415 MOZ_ASSERT(cx->realm() == state.script()->realm())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->realm() == state.script()->realm())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(cx->realm() == state.script()->realm()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("cx->realm() == state.script()->realm()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 415); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == state.script()->realm()"
")"); do { *((volatile int*)__null) = 415; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
416
417 MOZ_DIAGNOSTIC_ASSERT(cx->realm()->isSystem() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->realm()->isSystem() || cx->runtime()->
allowContentJS())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->realm()->isSystem(
) || cx->runtime()->allowContentJS()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("cx->realm()->isSystem() || cx->runtime()->allowContentJS()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 418); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "cx->realm()->isSystem() || cx->runtime()->allowContentJS()"
")"); do { *((volatile int*)__null) = 418; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
418 cx->runtime()->allowContentJS())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->realm()->isSystem() || cx->runtime()->
allowContentJS())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->realm()->isSystem(
) || cx->runtime()->allowContentJS()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("cx->realm()->isSystem() || cx->runtime()->allowContentJS()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 418); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "cx->realm()->isSystem() || cx->runtime()->allowContentJS()"
")"); do { *((volatile int*)__null) = 418; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
419
420 if (!DebugAPI::checkNoExecute(cx, state.script())) {
421 return false;
422 }
423
424 GeckoProfilerEntryMarker marker(cx, state.script());
425
426 bool measuringTime = !cx->isMeasuringExecutionTime();
427 mozilla::TimeStamp startTime;
428 if (measuringTime) {
429 cx->setIsMeasuringExecutionTime(true);
430 cx->setIsExecuting(true);
431 startTime = mozilla::TimeStamp::Now();
432 }
433 auto timerEnd = mozilla::MakeScopeExit([&]() {
434 if (measuringTime) {
435 mozilla::TimeDuration delta = mozilla::TimeStamp::Now() - startTime;
436 cx->realm()->timers.executionTime += delta;
437 cx->setIsMeasuringExecutionTime(false);
438 cx->setIsExecuting(false);
439 }
440 });
441
442 jit::EnterJitStatus status = jit::MaybeEnterJit(cx, state);
443 switch (status) {
444 case jit::EnterJitStatus::Error:
445 return false;
446 case jit::EnterJitStatus::Ok:
447 return true;
448 case jit::EnterJitStatus::NotEntered:
449 break;
450 }
451
452 bool ok = MaybeEnterInterpreterTrampoline(cx, state);
453
454 return ok;
455}
456#ifdef _MSC_VER
457# pragma optimize("", on)
458#endif
459
460STATIC_PRECONDITION_ASSUME(ubound(args.argv_) >= argc)
461MOZ_ALWAYS_INLINEinline bool CallJSNative(JSContext* cx, Native native,
462 CallReason reason, const CallArgs& args) {
463 AutoCheckRecursionLimit recursion(cx);
464 if (!recursion.check(cx)) {
465 return false;
466 }
467
468 NativeResumeMode resumeMode = DebugAPI::onNativeCall(cx, args, reason);
469 if (resumeMode != NativeResumeMode::Continue) {
470 return resumeMode == NativeResumeMode::Override;
471 }
472
473#ifdef DEBUG1
474 bool alreadyThrowing = cx->isExceptionPending();
475#endif
476 cx->check(args);
477 MOZ_ASSERT(!args.callee().is<ProxyObject>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!args.callee().is<ProxyObject>())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(!args.callee().is<ProxyObject>()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!args.callee().is<ProxyObject>()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 477); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!args.callee().is<ProxyObject>()"
")"); do { *((volatile int*)__null) = 477; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
478
479 AutoRealm ar(cx, &args.callee());
480 bool ok = native(cx, args.length(), args.base());
481 if (ok) {
482 cx->check(args.rval());
483 MOZ_ASSERT_IF(!alreadyThrowing, !cx->isExceptionPending())do { if (!alreadyThrowing) { do { static_assert( mozilla::detail
::AssertionConditionType<decltype(!cx->isExceptionPending
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cx->isExceptionPending()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!cx->isExceptionPending()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 483); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 483; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
484 }
485 return ok;
486}
487
488STATIC_PRECONDITION(ubound(args.argv_) >= argc)
489MOZ_ALWAYS_INLINEinline bool CallJSNativeConstructor(JSContext* cx, Native native,
490 const CallArgs& args) {
491#ifdef DEBUG1
492 RootedObject callee(cx, &args.callee());
493#endif
494
495 MOZ_ASSERT(args.thisv().isMagic())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.thisv().isMagic())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.thisv().isMagic()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("args.thisv().isMagic()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 495); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.thisv().isMagic()"
")"); do { *((volatile int*)__null) = 495; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
496 if (!CallJSNative(cx, native, CallReason::Call, args)) {
497 return false;
498 }
499
500 /*
501 * Native constructors must return non-primitive values on success.
502 * Although it is legal, if a constructor returns the callee, there is a
503 * 99.9999% chance it is a bug. If any valid code actually wants the
504 * constructor to return the callee, the assertion can be removed or
505 * (another) conjunct can be added to the antecedent.
506 *
507 * Exceptions:
508 * - (new Object(Object)) returns the callee.
509 * - The bound function construct hook can return an arbitrary object,
510 * including the callee.
511 *
512 * Also allow if this may be due to a debugger hook since fuzzing may let this
513 * happen.
514 */
515 MOZ_ASSERT(args.rval().isObject())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.rval().isObject())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.rval().isObject()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("args.rval().isObject()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 515); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.rval().isObject()"
")"); do { *((volatile int*)__null) = 515; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
516 MOZ_ASSERT_IF(!JS_IsNativeFunction(callee, obj_construct) &&do { if (!JS_IsNativeFunction(callee, obj_construct) &&
!callee->is<BoundFunctionObject>() && !cx->
realm()->debuggerObservesNativeCall()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(args.rval
() != ObjectValue(*callee))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.rval() != ObjectValue(*
callee)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("args.rval() != ObjectValue(*callee)", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 519); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.rval() != ObjectValue(*callee)"
")"); do { *((volatile int*)__null) = 519; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
517 !callee->is<BoundFunctionObject>() &&do { if (!JS_IsNativeFunction(callee, obj_construct) &&
!callee->is<BoundFunctionObject>() && !cx->
realm()->debuggerObservesNativeCall()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(args.rval
() != ObjectValue(*callee))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.rval() != ObjectValue(*
callee)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("args.rval() != ObjectValue(*callee)", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 519); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.rval() != ObjectValue(*callee)"
")"); do { *((volatile int*)__null) = 519; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
518 !cx->realm()->debuggerObservesNativeCall(),do { if (!JS_IsNativeFunction(callee, obj_construct) &&
!callee->is<BoundFunctionObject>() && !cx->
realm()->debuggerObservesNativeCall()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(args.rval
() != ObjectValue(*callee))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.rval() != ObjectValue(*
callee)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("args.rval() != ObjectValue(*callee)", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 519); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.rval() != ObjectValue(*callee)"
")"); do { *((volatile int*)__null) = 519; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
519 args.rval() != ObjectValue(*callee))do { if (!JS_IsNativeFunction(callee, obj_construct) &&
!callee->is<BoundFunctionObject>() && !cx->
realm()->debuggerObservesNativeCall()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(args.rval
() != ObjectValue(*callee))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.rval() != ObjectValue(*
callee)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("args.rval() != ObjectValue(*callee)", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 519); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.rval() != ObjectValue(*callee)"
")"); do { *((volatile int*)__null) = 519; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
520
521 return true;
522}
523
524/*
525 * Find a function reference and its 'this' value implicit first parameter
526 * under argc arguments on cx's stack, and call the function. Push missing
527 * required arguments, allocate declared local variables, and pop everything
528 * when done. Then push the return value.
529 *
530 * Note: This function DOES NOT call GetThisValue to munge |args.thisv()| if
531 * necessary. The caller (usually the interpreter) must have performed
532 * this step already!
533 */
534bool js::InternalCallOrConstruct(JSContext* cx, const CallArgs& args,
535 MaybeConstruct construct,
536 CallReason reason /* = CallReason::Call */) {
537 MOZ_ASSERT(args.length() <= ARGS_LENGTH_MAX)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.length() <= ARGS_LENGTH_MAX)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.length() <= ARGS_LENGTH_MAX
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"args.length() <= ARGS_LENGTH_MAX", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 537); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.length() <= ARGS_LENGTH_MAX"
")"); do { *((volatile int*)__null) = 537; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
538
539 unsigned skipForCallee = args.length() + 1 + (construct == CONSTRUCT);
540 if (args.calleev().isPrimitive()) {
541 return ReportIsNotFunction(cx, args.calleev(), skipForCallee, construct);
542 }
543
544 /* Invoke non-functions. */
545 if (MOZ_UNLIKELY(!args.callee().is<JSFunction>())(__builtin_expect(!!(!args.callee().is<JSFunction>()), 0
))
) {
546 MOZ_ASSERT_IF(construct, !args.callee().isConstructor())do { if (construct) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(!args.callee().isConstructor())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!args.callee().isConstructor
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!args.callee().isConstructor()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 546); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!args.callee().isConstructor()"
")"); do { *((volatile int*)__null) = 546; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
547
548 if (!args.callee().isCallable()) {
549 return ReportIsNotFunction(cx, args.calleev(), skipForCallee, construct);
550 }
551
552 if (args.callee().is<ProxyObject>()) {
553 RootedObject proxy(cx, &args.callee());
554 return Proxy::call(cx, proxy, args);
555 }
556
557 JSNative call = args.callee().callHook();
558 MOZ_ASSERT(call, "isCallable without a callHook?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(call)>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(call))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("call" " (" "isCallable without a callHook?"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 558); AnnotateMozCrashReason("MOZ_ASSERT" "(" "call" ") (" "isCallable without a callHook?"
")"); do { *((volatile int*)__null) = 558; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
559
560 return CallJSNative(cx, call, reason, args);
561 }
562
563 /* Invoke native functions. */
564 RootedFunction fun(cx, &args.callee().as<JSFunction>());
565 if (fun->isNativeFun()) {
566 MOZ_ASSERT_IF(construct, !fun->isConstructor())do { if (construct) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(!fun->isConstructor())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!fun->isConstructor()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!fun->isConstructor()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 566); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!fun->isConstructor()"
")"); do { *((volatile int*)__null) = 566; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
567 JSNative native = fun->native();
568 if (!construct && args.ignoresReturnValue() && fun->hasJitInfo()) {
569 const JSJitInfo* jitInfo = fun->jitInfo();
570 if (jitInfo->type() == JSJitInfo::IgnoresReturnValueNative) {
571 native = jitInfo->ignoresReturnValueMethod;
572 }
573 }
574 return CallJSNative(cx, native, reason, args);
575 }
576
577 // Self-hosted builtins are considered native by the onNativeCall hook.
578 if (fun->isSelfHostedBuiltin()) {
579 NativeResumeMode resumeMode = DebugAPI::onNativeCall(cx, args, reason);
580 if (resumeMode != NativeResumeMode::Continue) {
581 return resumeMode == NativeResumeMode::Override;
582 }
583 }
584
585 if (!JSFunction::getOrCreateScript(cx, fun)) {
586 return false;
587 }
588
589 /* Run function until JSOp::RetRval, JSOp::Return or error. */
590 InvokeState state(cx, args, construct);
591
592 // Create |this| if we're constructing. Switch to the callee's realm to
593 // ensure this object has the correct realm.
594 AutoRealm ar(cx, state.script());
595 if (construct && !MaybeCreateThisForConstructor(cx, args)) {
596 return false;
597 }
598
599 // Calling class constructors throws an error from the callee's realm.
600 if (construct != CONSTRUCT && fun->isClassConstructor()) {
601 JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
602 JSMSG_CANT_CALL_CLASS_CONSTRUCTOR);
603 return false;
604 }
605
606 bool ok = RunScript(cx, state);
607
608 MOZ_ASSERT_IF(ok && construct, args.rval().isObject())do { if (ok && construct) { do { static_assert( mozilla
::detail::AssertionConditionType<decltype(args.rval().isObject
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(args.rval().isObject()))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("args.rval().isObject()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 608); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.rval().isObject()"
")"); do { *((volatile int*)__null) = 608; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
609 return ok;
610}
611
612// Returns true if the callee needs an outerized |this| object. Outerization
613// means passing the WindowProxy instead of the Window (a GlobalObject) because
614// we must never expose the Window to script. This returns false only for DOM
615// getters or setters.
616static bool CalleeNeedsOuterizedThisObject(const Value& callee) {
617 if (!callee.isObject() || !callee.toObject().is<JSFunction>()) {
618 return true;
619 }
620 JSFunction& fun = callee.toObject().as<JSFunction>();
621 if (!fun.isNativeFun() || !fun.hasJitInfo()) {
622 return true;
623 }
624 return fun.jitInfo()->needsOuterizedThisObject();
625}
626
627static bool InternalCall(JSContext* cx, const AnyInvokeArgs& args,
628 CallReason reason) {
629 MOZ_ASSERT(args.array() + args.length() == args.end(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.array() + args.length() == args.end())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(args.array() + args.length() == args.end()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("args.array() + args.length() == args.end()"
" (" "must pass calling arguments to a calling attempt" ")",
"/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 630); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.array() + args.length() == args.end()"
") (" "must pass calling arguments to a calling attempt" ")"
); do { *((volatile int*)__null) = 630; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
630 "must pass calling arguments to a calling attempt")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.array() + args.length() == args.end())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(args.array() + args.length() == args.end()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("args.array() + args.length() == args.end()"
" (" "must pass calling arguments to a calling attempt" ")",
"/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 630); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.array() + args.length() == args.end()"
") (" "must pass calling arguments to a calling attempt" ")"
); do { *((volatile int*)__null) = 630; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
631
632#ifdef DEBUG1
633 // The caller is responsible for calling GetThisObject if needed.
634 if (args.thisv().isObject()) {
635 JSObject* thisObj = &args.thisv().toObject();
636 MOZ_ASSERT_IF(CalleeNeedsOuterizedThisObject(args.calleev()),do { if (CalleeNeedsOuterizedThisObject(args.calleev())) { do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(GetThisObject(thisObj) == thisObj)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(GetThisObject(thisObj) == thisObj
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"GetThisObject(thisObj) == thisObj", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 637); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetThisObject(thisObj) == thisObj"
")"); do { *((volatile int*)__null) = 637; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
637 GetThisObject(thisObj) == thisObj)do { if (CalleeNeedsOuterizedThisObject(args.calleev())) { do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(GetThisObject(thisObj) == thisObj)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(GetThisObject(thisObj) == thisObj
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"GetThisObject(thisObj) == thisObj", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 637); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetThisObject(thisObj) == thisObj"
")"); do { *((volatile int*)__null) = 637; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
638 }
639#endif
640
641 return InternalCallOrConstruct(cx, args, NO_CONSTRUCT, reason);
642}
643
644bool js::CallFromStack(JSContext* cx, const CallArgs& args,
645 CallReason reason /* = CallReason::Call */) {
646 return InternalCall(cx, static_cast<const AnyInvokeArgs&>(args), reason);
647}
648
649// ES7 rev 0c1bd3004329336774cbc90de727cd0cf5f11e93
650// 7.3.12 Call.
651bool js::Call(JSContext* cx, HandleValue fval, HandleValue thisv,
652 const AnyInvokeArgs& args, MutableHandleValue rval,
653 CallReason reason) {
654 // Explicitly qualify these methods to bypass AnyInvokeArgs's deliberate
655 // shadowing.
656 args.CallArgs::setCallee(fval);
657 args.CallArgs::setThis(thisv);
658
659 if (thisv.isObject()) {
660 // If |this| is a global object, it might be a Window and in that case we
661 // usually have to pass the WindowProxy instead.
662 JSObject* thisObj = &thisv.toObject();
663 if (thisObj->is<GlobalObject>()) {
664 if (CalleeNeedsOuterizedThisObject(fval)) {
665 args.mutableThisv().setObject(*GetThisObject(thisObj));
666 }
667 } else {
668 // Fast path: we don't have to do anything if the object isn't a global.
669 MOZ_ASSERT(GetThisObject(thisObj) == thisObj)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(GetThisObject(thisObj) == thisObj)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(GetThisObject(thisObj) == thisObj
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"GetThisObject(thisObj) == thisObj", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 669); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetThisObject(thisObj) == thisObj"
")"); do { *((volatile int*)__null) = 669; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
670 }
671 }
672
673 if (!InternalCall(cx, args, reason)) {
674 return false;
675 }
676
677 rval.set(args.rval());
678 return true;
679}
680
681static bool InternalConstruct(JSContext* cx, const AnyConstructArgs& args,
682 CallReason reason = CallReason::Call) {
683 MOZ_ASSERT(args.array() + args.length() + 1 == args.end(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.array() + args.length() + 1 == args.end())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(args.array() + args.length() + 1 == args.end()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("args.array() + args.length() + 1 == args.end()"
" (" "must pass constructing arguments to a construction attempt"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 684); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.array() + args.length() + 1 == args.end()"
") (" "must pass constructing arguments to a construction attempt"
")"); do { *((volatile int*)__null) = 684; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
684 "must pass constructing arguments to a construction attempt")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.array() + args.length() + 1 == args.end())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(args.array() + args.length() + 1 == args.end()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("args.array() + args.length() + 1 == args.end()"
" (" "must pass constructing arguments to a construction attempt"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 684); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.array() + args.length() + 1 == args.end()"
") (" "must pass constructing arguments to a construction attempt"
")"); do { *((volatile int*)__null) = 684; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
685 MOZ_ASSERT(!FunctionClass.getConstruct())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!FunctionClass.getConstruct())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!FunctionClass.getConstruct(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!FunctionClass.getConstruct()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 685); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!FunctionClass.getConstruct()"
")"); do { *((volatile int*)__null) = 685; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
686 MOZ_ASSERT(!ExtendedFunctionClass.getConstruct())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!ExtendedFunctionClass.getConstruct())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(!ExtendedFunctionClass.getConstruct()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("!ExtendedFunctionClass.getConstruct()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 686); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!ExtendedFunctionClass.getConstruct()"
")"); do { *((volatile int*)__null) = 686; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
687
688 // Callers are responsible for enforcing these preconditions.
689 MOZ_ASSERT(IsConstructor(args.calleev()),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsConstructor(args.calleev()))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsConstructor(args.calleev()
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsConstructor(args.calleev())" " (" "trying to construct a value that isn't a constructor"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 690); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsConstructor(args.calleev())"
") (" "trying to construct a value that isn't a constructor"
")"); do { *((volatile int*)__null) = 690; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
690 "trying to construct a value that isn't a constructor")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsConstructor(args.calleev()))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsConstructor(args.calleev()
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsConstructor(args.calleev())" " (" "trying to construct a value that isn't a constructor"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 690); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsConstructor(args.calleev())"
") (" "trying to construct a value that isn't a constructor"
")"); do { *((volatile int*)__null) = 690; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
691 MOZ_ASSERT(IsConstructor(args.CallArgs::newTarget()),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsConstructor(args.CallArgs::newTarget()))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsConstructor(args.CallArgs::newTarget())))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsConstructor(args.CallArgs::newTarget())"
" (" "provided new.target value must be a constructor" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 692); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsConstructor(args.CallArgs::newTarget())"
") (" "provided new.target value must be a constructor" ")")
; do { *((volatile int*)__null) = 692; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
692 "provided new.target value must be a constructor")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsConstructor(args.CallArgs::newTarget()))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsConstructor(args.CallArgs::newTarget())))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("IsConstructor(args.CallArgs::newTarget())"
" (" "provided new.target value must be a constructor" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 692); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsConstructor(args.CallArgs::newTarget())"
") (" "provided new.target value must be a constructor" ")")
; do { *((volatile int*)__null) = 692; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
693
694 MOZ_ASSERT(args.thisv().isMagic(JS_IS_CONSTRUCTING) ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.thisv().isMagic(JS_IS_CONSTRUCTING) || args.thisv
().isObject())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(args.thisv().isMagic(JS_IS_CONSTRUCTING
) || args.thisv().isObject()))), 0))) { do { } while (false);
MOZ_ReportAssertionFailure("args.thisv().isMagic(JS_IS_CONSTRUCTING) || args.thisv().isObject()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 695); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.thisv().isMagic(JS_IS_CONSTRUCTING) || args.thisv().isObject()"
")"); do { *((volatile int*)__null) = 695; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
695 args.thisv().isObject())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.thisv().isMagic(JS_IS_CONSTRUCTING) || args.thisv
().isObject())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(args.thisv().isMagic(JS_IS_CONSTRUCTING
) || args.thisv().isObject()))), 0))) { do { } while (false);
MOZ_ReportAssertionFailure("args.thisv().isMagic(JS_IS_CONSTRUCTING) || args.thisv().isObject()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 695); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.thisv().isMagic(JS_IS_CONSTRUCTING) || args.thisv().isObject()"
")"); do { *((volatile int*)__null) = 695; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
696
697 JSObject& callee = args.callee();
698 if (callee.is<JSFunction>()) {
699 RootedFunction fun(cx, &callee.as<JSFunction>());
700
701 if (fun->isNativeFun()) {
702 return CallJSNativeConstructor(cx, fun->native(), args);
703 }
704
705 if (!InternalCallOrConstruct(cx, args, CONSTRUCT, reason)) {
706 return false;
707 }
708
709 MOZ_ASSERT(args.CallArgs::rval().isObject())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.CallArgs::rval().isObject())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.CallArgs::rval().isObject
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("args.CallArgs::rval().isObject()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 709); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.CallArgs::rval().isObject()"
")"); do { *((volatile int*)__null) = 709; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
710 return true;
711 }
712
713 if (callee.is<ProxyObject>()) {
714 RootedObject proxy(cx, &callee);
715 return Proxy::construct(cx, proxy, args);
716 }
717
718 JSNative construct = callee.constructHook();
719 MOZ_ASSERT(construct != nullptr, "IsConstructor without a construct hook?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(construct != nullptr)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(construct != nullptr))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("construct != nullptr"
" (" "IsConstructor without a construct hook?" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 719); AnnotateMozCrashReason("MOZ_ASSERT" "(" "construct != nullptr"
") (" "IsConstructor without a construct hook?" ")"); do { *
((volatile int*)__null) = 719; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
720
721 return CallJSNativeConstructor(cx, construct, args);
722}
723
724// Check that |callee|, the callee in a |new| expression, is a constructor.
725static bool StackCheckIsConstructorCalleeNewTarget(JSContext* cx,
726 HandleValue callee,
727 HandleValue newTarget) {
728 // Calls from the stack could have any old non-constructor callee.
729 if (!IsConstructor(callee)) {
730 ReportValueError(cx, JSMSG_NOT_CONSTRUCTOR, JSDVG_SEARCH_STACK1, callee,
731 nullptr);
732 return false;
733 }
734
735 // The new.target has already been vetted by previous calls, or is the callee.
736 // We can just assert that it's a constructor.
737 MOZ_ASSERT(IsConstructor(newTarget))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsConstructor(newTarget))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsConstructor(newTarget)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("IsConstructor(newTarget)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 737); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsConstructor(newTarget)"
")"); do { *((volatile int*)__null) = 737; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
738
739 return true;
740}
741
742bool js::ConstructFromStack(JSContext* cx, const CallArgs& args,
743 CallReason reason /* CallReason::Call */) {
744 if (!StackCheckIsConstructorCalleeNewTarget(cx, args.calleev(),
745 args.newTarget())) {
746 return false;
747 }
748
749 return InternalConstruct(cx, static_cast<const AnyConstructArgs&>(args),
750 reason);
751}
752
753bool js::Construct(JSContext* cx, HandleValue fval,
754 const AnyConstructArgs& args, HandleValue newTarget,
755 MutableHandleObject objp) {
756 MOZ_ASSERT(args.thisv().isMagic(JS_IS_CONSTRUCTING))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.thisv().isMagic(JS_IS_CONSTRUCTING))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(args.thisv().isMagic(JS_IS_CONSTRUCTING)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("args.thisv().isMagic(JS_IS_CONSTRUCTING)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 756); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.thisv().isMagic(JS_IS_CONSTRUCTING)"
")"); do { *((volatile int*)__null) = 756; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
757
758 // Explicitly qualify to bypass AnyConstructArgs's deliberate shadowing.
759 args.CallArgs::setCallee(fval);
760 args.CallArgs::newTarget().set(newTarget);
761
762 if (!InternalConstruct(cx, args)) {
763 return false;
764 }
765
766 MOZ_ASSERT(args.CallArgs::rval().isObject())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.CallArgs::rval().isObject())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.CallArgs::rval().isObject
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("args.CallArgs::rval().isObject()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 766); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.CallArgs::rval().isObject()"
")"); do { *((volatile int*)__null) = 766; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
767 objp.set(&args.CallArgs::rval().toObject());
768 return true;
769}
770
771bool js::InternalConstructWithProvidedThis(JSContext* cx, HandleValue fval,
772 HandleValue thisv,
773 const AnyConstructArgs& args,
774 HandleValue newTarget,
775 MutableHandleValue rval) {
776 args.CallArgs::setCallee(fval);
777
778 MOZ_ASSERT(thisv.isObject())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(thisv.isObject())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(thisv.isObject()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("thisv.isObject()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 778); AnnotateMozCrashReason("MOZ_ASSERT" "(" "thisv.isObject()"
")"); do { *((volatile int*)__null) = 778; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
779 args.CallArgs::setThis(thisv);
780
781 args.CallArgs::newTarget().set(newTarget);
782
783 if (!InternalConstruct(cx, args)) {
784 return false;
785 }
786
787 rval.set(args.CallArgs::rval());
788 return true;
789}
790
791bool js::CallGetter(JSContext* cx, HandleValue thisv, HandleValue getter,
792 MutableHandleValue rval) {
793 FixedInvokeArgs<0> args(cx);
794
795 return Call(cx, getter, thisv, args, rval, CallReason::Getter);
796}
797
798bool js::CallSetter(JSContext* cx, HandleValue thisv, HandleValue setter,
799 HandleValue v) {
800 FixedInvokeArgs<1> args(cx);
801 args[0].set(v);
802
803 RootedValue ignored(cx);
804 return Call(cx, setter, thisv, args, &ignored, CallReason::Setter);
805}
806
807bool js::ExecuteKernel(JSContext* cx, HandleScript script,
808 HandleObject envChainArg, AbstractFramePtr evalInFrame,
809 MutableHandleValue result) {
810 MOZ_ASSERT_IF(script->isGlobalCode(),do { if (script->isGlobalCode()) { do { static_assert( mozilla
::detail::AssertionConditionType<decltype(IsGlobalLexicalEnvironment
(envChainArg) || !IsSyntacticEnvironment(envChainArg))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment
(envChainArg)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment(envChainArg)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 812); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment(envChainArg)"
")"); do { *((volatile int*)__null) = 812; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
811 IsGlobalLexicalEnvironment(envChainArg) ||do { if (script->isGlobalCode()) { do { static_assert( mozilla
::detail::AssertionConditionType<decltype(IsGlobalLexicalEnvironment
(envChainArg) || !IsSyntacticEnvironment(envChainArg))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment
(envChainArg)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment(envChainArg)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 812); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment(envChainArg)"
")"); do { *((volatile int*)__null) = 812; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
812 !IsSyntacticEnvironment(envChainArg))do { if (script->isGlobalCode()) { do { static_assert( mozilla
::detail::AssertionConditionType<decltype(IsGlobalLexicalEnvironment
(envChainArg) || !IsSyntacticEnvironment(envChainArg))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment
(envChainArg)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment(envChainArg)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 812); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsGlobalLexicalEnvironment(envChainArg) || !IsSyntacticEnvironment(envChainArg)"
")"); do { *((volatile int*)__null) = 812; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
813#ifdef DEBUG1
814 RootedObject terminatingEnv(cx, envChainArg);
815 while (IsSyntacticEnvironment(terminatingEnv)) {
816 terminatingEnv = terminatingEnv->enclosingEnvironment();
817 }
818 MOZ_ASSERT(terminatingEnv->is<GlobalObject>() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(terminatingEnv->is<GlobalObject>() || script
->hasNonSyntacticScope())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(terminatingEnv->is<GlobalObject
>() || script->hasNonSyntacticScope()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("terminatingEnv->is<GlobalObject>() || script->hasNonSyntacticScope()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 819); AnnotateMozCrashReason("MOZ_ASSERT" "(" "terminatingEnv->is<GlobalObject>() || script->hasNonSyntacticScope()"
")"); do { *((volatile int*)__null) = 819; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
819 script->hasNonSyntacticScope())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(terminatingEnv->is<GlobalObject>() || script
->hasNonSyntacticScope())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(terminatingEnv->is<GlobalObject
>() || script->hasNonSyntacticScope()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("terminatingEnv->is<GlobalObject>() || script->hasNonSyntacticScope()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 819); AnnotateMozCrashReason("MOZ_ASSERT" "(" "terminatingEnv->is<GlobalObject>() || script->hasNonSyntacticScope()"
")"); do { *((volatile int*)__null) = 819; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
820#endif
821
822 if (script->treatAsRunOnce()) {
823 if (script->hasRunOnce()) {
824 JS_ReportErrorASCII(cx,
825 "Trying to execute a run-once script multiple times");
826 return false;
827 }
828
829 script->setHasRunOnce();
830 }
831
832 if (script->isEmpty()) {
833 result.setUndefined();
834 return true;
835 }
836
837 probes::StartExecution(script);
838 ExecuteState state(cx, script, envChainArg, evalInFrame, result);
839 bool ok = RunScript(cx, state);
840 probes::StopExecution(script);
841
842 return ok;
843}
844
845bool js::Execute(JSContext* cx, HandleScript script, HandleObject envChain,
846 MutableHandleValue rval) {
847 /* The env chain is something we control, so we know it can't
848 have any outer objects on it. */
849 MOZ_ASSERT(!IsWindowProxy(envChain))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!IsWindowProxy(envChain))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!IsWindowProxy(envChain)))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!IsWindowProxy(envChain)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 849); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!IsWindowProxy(envChain)"
")"); do { *((volatile int*)__null) = 849; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
850
851 if (script->isModule()) {
852 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(envChain == script->module()->environment())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(envChain == script->module()->environment())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("envChain == script->module()->environment()"
" (" "Module scripts can only be executed in the module's environment"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 854); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "envChain == script->module()->environment()"
") (" "Module scripts can only be executed in the module's environment"
")"); do { *((volatile int*)__null) = 854; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
853 envChain == script->module()->environment(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(envChain == script->module()->environment())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(envChain == script->module()->environment())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("envChain == script->module()->environment()"
" (" "Module scripts can only be executed in the module's environment"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 854); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "envChain == script->module()->environment()"
") (" "Module scripts can only be executed in the module's environment"
")"); do { *((volatile int*)__null) = 854; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
854 "Module scripts can only be executed in the module's environment")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(envChain == script->module()->environment())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(envChain == script->module()->environment())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("envChain == script->module()->environment()"
" (" "Module scripts can only be executed in the module's environment"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 854); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "envChain == script->module()->environment()"
") (" "Module scripts can only be executed in the module's environment"
")"); do { *((volatile int*)__null) = 854; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
855 } else {
856 MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
" (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 859); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
") (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")"); do { *((volatile int*)__null) =
859; __attribute__((nomerge)) ::abort(); } while (false); } }
while (false)
857 IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
" (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 859); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
") (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")"); do { *((volatile int*)__null) =
859; __attribute__((nomerge)) ::abort(); } while (false); } }
while (false)
858 "Only global scripts with non-syntactic envs can be executed with "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
" (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 859); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
") (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")"); do { *((volatile int*)__null) =
859; __attribute__((nomerge)) ::abort(); } while (false); } }
while (false)
859 "interesting envchains")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
" (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 859); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsGlobalLexicalEnvironment(envChain) || script->hasNonSyntacticScope()"
") (" "Only global scripts with non-syntactic envs can be executed with "
"interesting envchains" ")"); do { *((volatile int*)__null) =
859; __attribute__((nomerge)) ::abort(); } while (false); } }
while (false)
;
860 }
861
862 /* Ensure the env chain is all same-compartment and terminates in a global. */
863#ifdef DEBUG1
864 JSObject* s = envChain;
865 do {
866 cx->check(s);
867 MOZ_ASSERT_IF(!s->enclosingEnvironment(), s->is<GlobalObject>())do { if (!s->enclosingEnvironment()) { do { static_assert(
mozilla::detail::AssertionConditionType<decltype(s->is
<GlobalObject>())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s->is<GlobalObject>
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("s->is<GlobalObject>()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 867); AnnotateMozCrashReason("MOZ_ASSERT" "(" "s->is<GlobalObject>()"
")"); do { *((volatile int*)__null) = 867; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
868 } while ((s = s->enclosingEnvironment()));
869#endif
870
871 return ExecuteKernel(cx, script, envChain, NullFramePtr() /* evalInFrame */,
872 rval);
873}
874
875/*
876 * ES6 (4-25-16) 12.10.4 InstanceofOperator
877 */
878bool js::InstanceofOperator(JSContext* cx, HandleObject obj, HandleValue v,
879 bool* bp) {
880 /* Step 1. is handled by caller. */
881
882 /* Step 2. */
883 RootedValue hasInstance(cx);
884 RootedId id(cx, PropertyKey::Symbol(cx->wellKnownSymbols().hasInstance));
885 if (!GetProperty(cx, obj, obj, id, &hasInstance)) {
886 return false;
887 }
888
889 if (!hasInstance.isNullOrUndefined()) {
890 if (!IsCallable(hasInstance)) {
891 return ReportIsNotFunction(cx, hasInstance);
892 }
893
894 /* Step 3. */
895 RootedValue rval(cx);
896 if (!Call(cx, hasInstance, obj, v, &rval)) {
897 return false;
898 }
899 *bp = ToBoolean(rval);
900 return true;
901 }
902
903 /* Step 4. */
904 if (!obj->isCallable()) {
905 RootedValue val(cx, ObjectValue(*obj));
906 return ReportIsNotFunction(cx, val);
907 }
908
909 /* Step 5. */
910 return OrdinaryHasInstance(cx, obj, v, bp);
911}
912
913JSType js::TypeOfObject(JSObject* obj) {
914#ifdef ENABLE_RECORD_TUPLE
915 MOZ_ASSERT(!js::IsExtendedPrimitive(*obj))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsExtendedPrimitive(*obj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsExtendedPrimitive(*obj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsExtendedPrimitive(*obj)", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 915); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!js::IsExtendedPrimitive(*obj)"
")"); do { *((volatile int*)__null) = 915; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
916#endif
917
918 AutoUnsafeCallWithABI unsafe;
919 if (EmulatesUndefined(obj)) {
920 return JSTYPE_UNDEFINED;
921 }
922 if (obj->isCallable()) {
923 return JSTYPE_FUNCTION;
924 }
925 return JSTYPE_OBJECT;
926}
927
928#ifdef ENABLE_RECORD_TUPLE
929JSType TypeOfExtendedPrimitive(JSObject* obj) {
930 MOZ_ASSERT(js::IsExtendedPrimitive(*obj))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(js::IsExtendedPrimitive(*obj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(js::IsExtendedPrimitive(*obj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("js::IsExtendedPrimitive(*obj)", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 930); AnnotateMozCrashReason("MOZ_ASSERT" "(" "js::IsExtendedPrimitive(*obj)"
")"); do { *((volatile int*)__null) = 930; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
931
932 if (obj->is<RecordType>()) {
933 return JSTYPE_RECORD;
934 }
935 if (obj->is<TupleType>()) {
936 return JSTYPE_TUPLE;
937 }
938 MOZ_CRASH("Unknown ExtendedPrimitive")do { do { } while (false); MOZ_ReportCrash("" "Unknown ExtendedPrimitive"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 938); AnnotateMozCrashReason("MOZ_CRASH(" "Unknown ExtendedPrimitive"
")"); do { *((volatile int*)__null) = 938; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
939}
940#endif
941
942JSType js::TypeOfValue(const Value& v) {
943 switch (v.type()) {
944 case ValueType::Double:
945 case ValueType::Int32:
946 return JSTYPE_NUMBER;
947 case ValueType::String:
948 return JSTYPE_STRING;
949 case ValueType::Null:
950 return JSTYPE_OBJECT;
951 case ValueType::Undefined:
952 return JSTYPE_UNDEFINED;
953 case ValueType::Object:
954 return TypeOfObject(&v.toObject());
955#ifdef ENABLE_RECORD_TUPLE
956 case ValueType::ExtendedPrimitive:
957 return TypeOfExtendedPrimitive(&v.toExtendedPrimitive());
958#endif
959 case ValueType::Boolean:
960 return JSTYPE_BOOLEAN;
961 case ValueType::BigInt:
962 return JSTYPE_BIGINT;
963 case ValueType::Symbol:
964 return JSTYPE_SYMBOL;
965 case ValueType::Magic:
966 case ValueType::PrivateGCThing:
967 break;
968 }
969
970 ReportBadValueTypeAndCrash(v);
971}
972
973bool js::CheckClassHeritageOperation(JSContext* cx, HandleValue heritage) {
974 if (IsConstructor(heritage)) {
975 return true;
976 }
977
978 if (heritage.isNull()) {
979 return true;
980 }
981
982 if (heritage.isObject()) {
983 ReportIsNotFunction(cx, heritage, 0, CONSTRUCT);
984 return false;
985 }
986
987 ReportValueError(cx, JSMSG_BAD_HERITAGE, -1, heritage, nullptr,
988 "not an object or null");
989 return false;
990}
991
992PlainObject* js::ObjectWithProtoOperation(JSContext* cx, HandleValue val) {
993 if (!val.isObjectOrNull()) {
994 ReportValueError(cx, JSMSG_NOT_OBJORNULL, -1, val, nullptr);
995 return nullptr;
996 }
997
998 RootedObject proto(cx, val.toObjectOrNull());
999 return NewPlainObjectWithProto(cx, proto);
1000}
1001
1002JSObject* js::FunWithProtoOperation(JSContext* cx, HandleFunction fun,
1003 HandleObject parent, HandleObject proto) {
1004 return CloneFunctionReuseScript(cx, fun, parent, proto);
1005}
1006
1007/*
1008 * Enter the new with environment using an object at sp[-1] and associate the
1009 * depth of the with block with sp + stackIndex.
1010 */
1011bool js::EnterWithOperation(JSContext* cx, AbstractFramePtr frame,
1012 HandleValue val, Handle<WithScope*> scope) {
1013 RootedObject obj(cx);
1014 if (val.isObject()) {
1015 obj = &val.toObject();
1016 } else {
1017 obj = ToObject(cx, val);
1018 if (!obj) {
1019 return false;
1020 }
1021 }
1022
1023 RootedObject envChain(cx, frame.environmentChain());
1024 WithEnvironmentObject* withobj =
1025 WithEnvironmentObject::create(cx, obj, envChain, scope);
1026 if (!withobj) {
1027 return false;
1028 }
1029
1030 frame.pushOnEnvironmentChain(*withobj);
1031 return true;
1032}
1033
1034static void PopEnvironment(JSContext* cx, EnvironmentIter& ei) {
1035 switch (ei.scope().kind()) {
1036 case ScopeKind::Lexical:
1037 case ScopeKind::SimpleCatch:
1038 case ScopeKind::Catch:
1039 case ScopeKind::NamedLambda:
1040 case ScopeKind::StrictNamedLambda:
1041 case ScopeKind::FunctionLexical:
1042 case ScopeKind::ClassBody:
1043 if (MOZ_UNLIKELY(cx->realm()->isDebuggee())(__builtin_expect(!!(cx->realm()->isDebuggee()), 0))) {
1044 DebugEnvironments::onPopLexical(cx, ei);
1045 }
1046 if (ei.scope().hasEnvironment()) {
1047 ei.initialFrame()
1048 .popOffEnvironmentChain<ScopedLexicalEnvironmentObject>();
1049 }
1050 break;
1051 case ScopeKind::With:
1052 if (MOZ_UNLIKELY(cx->realm()->isDebuggee())(__builtin_expect(!!(cx->realm()->isDebuggee()), 0))) {
1053 DebugEnvironments::onPopWith(ei.initialFrame());
1054 }
1055 ei.initialFrame().popOffEnvironmentChain<WithEnvironmentObject>();
1056 break;
1057 case ScopeKind::Function:
1058 if (MOZ_UNLIKELY(cx->realm()->isDebuggee())(__builtin_expect(!!(cx->realm()->isDebuggee()), 0))) {
1059 DebugEnvironments::onPopCall(cx, ei.initialFrame());
1060 }
1061 if (ei.scope().hasEnvironment()) {
1062 ei.initialFrame().popOffEnvironmentChain<CallObject>();
1063 }
1064 break;
1065 case ScopeKind::FunctionBodyVar:
1066 case ScopeKind::StrictEval:
1067 if (MOZ_UNLIKELY(cx->realm()->isDebuggee())(__builtin_expect(!!(cx->realm()->isDebuggee()), 0))) {
1068 DebugEnvironments::onPopVar(cx, ei);
1069 }
1070 if (ei.scope().hasEnvironment()) {
1071 ei.initialFrame().popOffEnvironmentChain<VarEnvironmentObject>();
1072 }
1073 break;
1074 case ScopeKind::Module:
1075 if (MOZ_UNLIKELY(cx->realm()->isDebuggee())(__builtin_expect(!!(cx->realm()->isDebuggee()), 0))) {
1076 DebugEnvironments::onPopModule(cx, ei);
1077 }
1078 break;
1079 case ScopeKind::Eval:
1080 case ScopeKind::Global:
1081 case ScopeKind::NonSyntactic:
1082 break;
1083 case ScopeKind::WasmInstance:
1084 case ScopeKind::WasmFunction:
1085 MOZ_CRASH("wasm is not interpreted")do { do { } while (false); MOZ_ReportCrash("" "wasm is not interpreted"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1085); AnnotateMozCrashReason("MOZ_CRASH(" "wasm is not interpreted"
")"); do { *((volatile int*)__null) = 1085; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
1086 break;
1087 }
1088}
1089
1090// Unwind environment chain and iterator to match the env corresponding to
1091// the given bytecode position.
1092void js::UnwindEnvironment(JSContext* cx, EnvironmentIter& ei, jsbytecode* pc) {
1093 if (!ei.withinInitialFrame()) {
1094 return;
1095 }
1096
1097 Rooted<Scope*> scope(cx, ei.initialFrame().script()->innermostScope(pc));
1098
1099#ifdef DEBUG1
1100 // A frame's environment chain cannot be unwound to anything enclosing the
1101 // body scope of a script. This includes the parameter defaults
1102 // environment and the decl env object. These environments, once pushed
1103 // onto the environment chain, are expected to be there for the duration
1104 // of the frame.
1105 //
1106 // Attempting to unwind to the parameter defaults code in a script is a
1107 // bug; that section of code has no try-catch blocks.
1108 JSScript* script = ei.initialFrame().script();
1109 for (uint32_t i = 0; i < script->bodyScopeIndex(); i++) {
1110 MOZ_ASSERT(scope != script->getScope(GCThingIndex(i)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(scope != script->getScope(GCThingIndex(i)))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(scope != script->getScope(GCThingIndex(i))))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("scope != script->getScope(GCThingIndex(i))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1110); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope != script->getScope(GCThingIndex(i))"
")"); do { *((volatile int*)__null) = 1110; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1111 }
1112#endif
1113
1114 for (; ei.maybeScope() != scope; ei++) {
1115 PopEnvironment(cx, ei);
1116 }
1117}
1118
1119// Unwind all environments. This is needed because block scopes may cover the
1120// first bytecode at a script's main(). e.g.,
1121//
1122// function f() { { let i = 0; } }
1123//
1124// will have no pc location distinguishing the first block scope from the
1125// outermost function scope.
1126void js::UnwindAllEnvironmentsInFrame(JSContext* cx, EnvironmentIter& ei) {
1127 for (; ei.withinInitialFrame(); ei++) {
1128 PopEnvironment(cx, ei);
1129 }
1130}
1131
1132// Compute the pc needed to unwind the environment to the beginning of a try
1133// block. We cannot unwind to *after* the JSOp::Try, because that might be the
1134// first opcode of an inner scope, with the same problem as above. e.g.,
1135//
1136// try { { let x; } }
1137//
1138// will have no pc location distinguishing the try block scope from the inner
1139// let block scope.
1140jsbytecode* js::UnwindEnvironmentToTryPc(JSScript* script, const TryNote* tn) {
1141 jsbytecode* pc = script->offsetToPC(tn->start);
1142 if (tn->kind() == TryNoteKind::Catch || tn->kind() == TryNoteKind::Finally) {
1143 pc -= JSOpLength_Try;
1144 MOZ_ASSERT(JSOp(*pc) == JSOp::Try)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JSOp(*pc) == JSOp::Try)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JSOp(*pc) == JSOp::Try))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("JSOp(*pc) == JSOp::Try"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1144); AnnotateMozCrashReason("MOZ_ASSERT" "(" "JSOp(*pc) == JSOp::Try"
")"); do { *((volatile int*)__null) = 1144; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1145 } else if (tn->kind() == TryNoteKind::Destructuring) {
1146 pc -= JSOpLength_TryDestructuring;
1147 MOZ_ASSERT(JSOp(*pc) == JSOp::TryDestructuring)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JSOp(*pc) == JSOp::TryDestructuring)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JSOp(*pc) == JSOp::TryDestructuring
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"JSOp(*pc) == JSOp::TryDestructuring", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1147); AnnotateMozCrashReason("MOZ_ASSERT" "(" "JSOp(*pc) == JSOp::TryDestructuring"
")"); do { *((volatile int*)__null) = 1147; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1148 }
1149 return pc;
1150}
1151
1152static void SettleOnTryNote(JSContext* cx, const TryNote* tn,
1153 EnvironmentIter& ei, InterpreterRegs& regs) {
1154 // Unwind the environment to the beginning of the JSOp::Try.
1155 UnwindEnvironment(cx, ei, UnwindEnvironmentToTryPc(regs.fp()->script(), tn));
1156
1157 // Set pc to the first bytecode after the the try note to point
1158 // to the beginning of catch or finally.
1159 regs.pc = regs.fp()->script()->offsetToPC(tn->start + tn->length);
1160 regs.sp = regs.spForStackDepth(tn->stackDepth);
1161}
1162
1163class InterpreterTryNoteFilter {
1164 const InterpreterRegs& regs_;
1165
1166 public:
1167 explicit InterpreterTryNoteFilter(const InterpreterRegs& regs)
1168 : regs_(regs) {}
1169 bool operator()(const TryNote* note) {
1170 return note->stackDepth <= regs_.stackDepth();
1171 }
1172};
1173
1174class TryNoteIterInterpreter : public TryNoteIter<InterpreterTryNoteFilter> {
1175 public:
1176 TryNoteIterInterpreter(JSContext* cx, const InterpreterRegs& regs)
1177 : TryNoteIter(cx, regs.fp()->script(), regs.pc,
1178 InterpreterTryNoteFilter(regs)) {}
1179};
1180
1181static void UnwindIteratorsForUncatchableException(
1182 JSContext* cx, const InterpreterRegs& regs) {
1183 // c.f. the regular (catchable) TryNoteIterInterpreter loop in
1184 // ProcessTryNotes.
1185 for (TryNoteIterInterpreter tni(cx, regs); !tni.done(); ++tni) {
1186 const TryNote* tn = *tni;
1187 switch (tn->kind()) {
1188 case TryNoteKind::ForIn: {
1189 Value* sp = regs.spForStackDepth(tn->stackDepth);
1190 UnwindIteratorForUncatchableException(&sp[-1].toObject());
1191 break;
1192 }
1193 default:
1194 break;
1195 }
1196 }
1197}
1198
1199enum HandleErrorContinuation {
1200 SuccessfulReturnContinuation,
1201 ErrorReturnContinuation,
1202 CatchContinuation,
1203 FinallyContinuation
1204};
1205
1206static HandleErrorContinuation ProcessTryNotes(JSContext* cx,
1207 EnvironmentIter& ei,
1208 InterpreterRegs& regs) {
1209 for (TryNoteIterInterpreter tni(cx, regs); !tni.done(); ++tni) {
1210 const TryNote* tn = *tni;
1211
1212 switch (tn->kind()) {
1213 case TryNoteKind::Catch:
1214 /* Catch cannot intercept the closing of a generator. */
1215 if (cx->isClosingGenerator()) {
1216 break;
1217 }
1218
1219 SettleOnTryNote(cx, tn, ei, regs);
1220 return CatchContinuation;
1221
1222 case TryNoteKind::Finally:
1223 SettleOnTryNote(cx, tn, ei, regs);
1224 return FinallyContinuation;
1225
1226 case TryNoteKind::ForIn: {
1227 /* This is similar to JSOp::EndIter in the interpreter loop. */
1228 MOZ_ASSERT(tn->stackDepth <= regs.stackDepth())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tn->stackDepth <= regs.stackDepth())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(tn->stackDepth <= regs.stackDepth()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("tn->stackDepth <= regs.stackDepth()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1228); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tn->stackDepth <= regs.stackDepth()"
")"); do { *((volatile int*)__null) = 1228; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1229 Value* sp = regs.spForStackDepth(tn->stackDepth);
1230 JSObject* obj = &sp[-1].toObject();
1231 CloseIterator(obj);
1232 break;
1233 }
1234
1235 case TryNoteKind::Destructuring: {
1236 // Whether the destructuring iterator is done is at the top of the
1237 // stack. The iterator object is second from the top.
1238 MOZ_ASSERT(tn->stackDepth > 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tn->stackDepth > 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tn->stackDepth > 1))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("tn->stackDepth > 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1238); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tn->stackDepth > 1"
")"); do { *((volatile int*)__null) = 1238; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1239 Value* sp = regs.spForStackDepth(tn->stackDepth);
1240 RootedValue doneValue(cx, sp[-1]);
1241 MOZ_RELEASE_ASSERT(!doneValue.isMagic())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!doneValue.isMagic())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!doneValue.isMagic()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("!doneValue.isMagic()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1241); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!doneValue.isMagic()"
")"); do { *((volatile int*)__null) = 1241; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1242 bool done = ToBoolean(doneValue);
1243 if (!done) {
1244 RootedObject iterObject(cx, &sp[-2].toObject());
1245 if (!IteratorCloseForException(cx, iterObject)) {
1246 SettleOnTryNote(cx, tn, ei, regs);
1247 return ErrorReturnContinuation;
1248 }
1249 }
1250 break;
1251 }
1252
1253 case TryNoteKind::ForOf:
1254 case TryNoteKind::Loop:
1255 break;
1256
1257 // TryNoteKind::ForOfIterClose is handled internally by the try note
1258 // iterator.
1259 default:
1260 MOZ_CRASH("Invalid try note")do { do { } while (false); MOZ_ReportCrash("" "Invalid try note"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1260); AnnotateMozCrashReason("MOZ_CRASH(" "Invalid try note"
")"); do { *((volatile int*)__null) = 1260; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
1261 }
1262 }
1263
1264 return SuccessfulReturnContinuation;
1265}
1266
1267bool js::HandleClosingGeneratorReturn(JSContext* cx, AbstractFramePtr frame,
1268 bool ok) {
1269 /*
1270 * Propagate the exception or error to the caller unless the exception
1271 * is an asynchronous return from a generator.
1272 */
1273 if (cx->isClosingGenerator()) {
1274 cx->clearPendingException();
1275 ok = true;
1276 auto* genObj = GetGeneratorObjectForFrame(cx, frame);
1277 genObj->setClosed(cx);
1278 }
1279 return ok;
1280}
1281
1282static HandleErrorContinuation HandleError(JSContext* cx,
1283 InterpreterRegs& regs) {
1284 MOZ_ASSERT(regs.fp()->script()->containsPC(regs.pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(regs.fp()->script()->containsPC(regs.pc))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(regs.fp()->script()->containsPC(regs.pc)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("regs.fp()->script()->containsPC(regs.pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1284); AnnotateMozCrashReason("MOZ_ASSERT" "(" "regs.fp()->script()->containsPC(regs.pc)"
")"); do { *((volatile int*)__null) = 1284; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1285 MOZ_ASSERT(cx->realm() == regs.fp()->script()->realm())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->realm() == regs.fp()->script()->realm()
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(cx->realm() == regs.fp()->script()->realm()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"cx->realm() == regs.fp()->script()->realm()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1285); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == regs.fp()->script()->realm()"
")"); do { *((volatile int*)__null) = 1285; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1286
1287 if (regs.fp()->script()->hasScriptCounts()) {
1288 PCCounts* counts = regs.fp()->script()->getThrowCounts(regs.pc);
1289 // If we failed to allocate, then skip the increment and continue to
1290 // handle the exception.
1291 if (counts) {
1292 counts->numExec()++;
1293 }
1294 }
1295
1296 EnvironmentIter ei(cx, regs.fp(), regs.pc);
1297 bool ok = false;
1298
1299again:
1300 if (cx->isExceptionPending()) {
1301 /* Call debugger throw hooks. */
1302 if (!cx->isClosingGenerator()) {
1303 if (!DebugAPI::onExceptionUnwind(cx, regs.fp())) {
1304 if (!cx->isExceptionPending()) {
1305 goto again;
1306 }
1307 }
1308 // Ensure that the debugger hasn't returned 'true' while clearing the
1309 // exception state.
1310 MOZ_ASSERT(cx->isExceptionPending())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->isExceptionPending())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->isExceptionPending())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("cx->isExceptionPending()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1310); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 1310; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1311 }
1312
1313 HandleErrorContinuation res = ProcessTryNotes(cx, ei, regs);
1314 switch (res) {
1315 case SuccessfulReturnContinuation:
1316 break;
1317 case ErrorReturnContinuation:
1318 goto again;
1319 case CatchContinuation:
1320 case FinallyContinuation:
1321 // No need to increment the PCCounts number of execution here, as
1322 // the interpreter increments any PCCounts if present.
1323 MOZ_ASSERT_IF(regs.fp()->script()->hasScriptCounts(),do { if (regs.fp()->script()->hasScriptCounts()) { do {
static_assert( mozilla::detail::AssertionConditionType<decltype
(regs.fp()->script()->maybeGetPCCounts(regs.pc))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(regs.fp()->script()->maybeGetPCCounts(regs.pc)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("regs.fp()->script()->maybeGetPCCounts(regs.pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1324); AnnotateMozCrashReason("MOZ_ASSERT" "(" "regs.fp()->script()->maybeGetPCCounts(regs.pc)"
")"); do { *((volatile int*)__null) = 1324; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
1324 regs.fp()->script()->maybeGetPCCounts(regs.pc))do { if (regs.fp()->script()->hasScriptCounts()) { do {
static_assert( mozilla::detail::AssertionConditionType<decltype
(regs.fp()->script()->maybeGetPCCounts(regs.pc))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(regs.fp()->script()->maybeGetPCCounts(regs.pc)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("regs.fp()->script()->maybeGetPCCounts(regs.pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1324); AnnotateMozCrashReason("MOZ_ASSERT" "(" "regs.fp()->script()->maybeGetPCCounts(regs.pc)"
")"); do { *((volatile int*)__null) = 1324; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
1325 return res;
1326 }
1327
1328 ok = HandleClosingGeneratorReturn(cx, regs.fp(), ok);
1329 } else {
1330 UnwindIteratorsForUncatchableException(cx, regs);
1331
1332 // We may be propagating a forced return from a debugger hook function.
1333 if (MOZ_UNLIKELY(cx->isPropagatingForcedReturn())(__builtin_expect(!!(cx->isPropagatingForcedReturn()), 0))) {
1334 cx->clearPropagatingForcedReturn();
1335 ok = true;
1336 }
1337 }
1338
1339 ok = DebugAPI::onLeaveFrame(cx, regs.fp(), regs.pc, ok);
1340
1341 // After this point, we will pop the frame regardless. Settle the frame on
1342 // the end of the script.
1343 regs.setToEndOfScript();
1344
1345 return ok ? SuccessfulReturnContinuation : ErrorReturnContinuation;
1346}
1347
1348#define REGS(activation.regs()) (activation.regs())
1349#define PUSH_COPY(v)do { *(activation.regs()).sp++ = (v); cx->debugOnlyCheck((
activation.regs()).sp[-1]); } while (0)
\
1350 do { \
1351 *REGS(activation.regs()).sp++ = (v); \
1352 cx->debugOnlyCheck(REGS(activation.regs()).sp[-1]); \
1353 } while (0)
1354#define PUSH_COPY_SKIP_CHECK(v)*(activation.regs()).sp++ = (v) *REGS(activation.regs()).sp++ = (v)
1355#define PUSH_NULL()(activation.regs()).sp++->setNull() REGS(activation.regs()).sp++->setNull()
1356#define PUSH_UNDEFINED()(activation.regs()).sp++->setUndefined() REGS(activation.regs()).sp++->setUndefined()
1357#define PUSH_BOOLEAN(b)(activation.regs()).sp++->setBoolean(b) REGS(activation.regs()).sp++->setBoolean(b)
1358#define PUSH_DOUBLE(d)(activation.regs()).sp++->setDouble(d) REGS(activation.regs()).sp++->setDouble(d)
1359#define PUSH_INT32(i)(activation.regs()).sp++->setInt32(i) REGS(activation.regs()).sp++->setInt32(i)
1360#define PUSH_SYMBOL(s)(activation.regs()).sp++->setSymbol(s) REGS(activation.regs()).sp++->setSymbol(s)
1361#define PUSH_BIGINT(b)(activation.regs()).sp++->setBigInt(b) REGS(activation.regs()).sp++->setBigInt(b)
1362#define PUSH_STRING(s)do { (activation.regs()).sp++->setString(s); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
\
1363 do { \
1364 REGS(activation.regs()).sp++->setString(s); \
1365 cx->debugOnlyCheck(REGS(activation.regs()).sp[-1]); \
1366 } while (0)
1367#define PUSH_OBJECT(obj)do { (activation.regs()).sp++->setObject(obj); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
\
1368 do { \
1369 REGS(activation.regs()).sp++->setObject(obj); \
1370 cx->debugOnlyCheck(REGS(activation.regs()).sp[-1]); \
1371 } while (0)
1372#define PUSH_OBJECT_OR_NULL(obj)do { (activation.regs()).sp++->setObjectOrNull(obj); cx->
debugOnlyCheck((activation.regs()).sp[-1]); } while (0)
\
1373 do { \
1374 REGS(activation.regs()).sp++->setObjectOrNull(obj); \
1375 cx->debugOnlyCheck(REGS(activation.regs()).sp[-1]); \
1376 } while (0)
1377#ifdef ENABLE_RECORD_TUPLE
1378# define PUSH_EXTENDED_PRIMITIVE(obj) \
1379 do { \
1380 REGS(activation.regs()).sp++->setExtendedPrimitive(obj); \
1381 cx->debugOnlyCheck(REGS(activation.regs()).sp[-1]); \
1382 } while (0)
1383#endif
1384#define PUSH_MAGIC(magic)(activation.regs()).sp++->setMagic(magic) REGS(activation.regs()).sp++->setMagic(magic)
1385#define POP_COPY_TO(v)(v) = *--(activation.regs()).sp (v) = *--REGS(activation.regs()).sp
1386#define POP_RETURN_VALUE()(activation.regs()).fp()->setReturnValue(*--(activation.regs
()).sp)
REGS(activation.regs()).fp()->setReturnValue(*--REGS(activation.regs()).sp)
1387
1388/*
1389 * Same for JSOp::SetName and JSOp::SetProp, which differ only slightly but
1390 * remain distinct for the decompiler.
1391 */
1392static_assert(JSOpLength_SetName == JSOpLength_SetProp);
1393
1394/* See TRY_BRANCH_AFTER_COND. */
1395static_assert(JSOpLength_JumpIfTrue == JSOpLength_JumpIfFalse);
1396static_assert(uint8_t(JSOp::JumpIfTrue) == uint8_t(JSOp::JumpIfFalse) + 1);
1397
1398/*
1399 * Compute the implicit |this| value used by a call expression with an
1400 * unqualified name reference. The environment the binding was found on is
1401 * passed as argument, env.
1402 *
1403 * The implicit |this| is |undefined| for all environment types except
1404 * WithEnvironmentObject. This is the case for |with(...) {...}| expressions or
1405 * if the embedding uses a non-syntactic WithEnvironmentObject.
1406 *
1407 * NOTE: A non-syntactic WithEnvironmentObject may have a corresponding
1408 * extensible LexicalEnviornmentObject, but it will not be considered as an
1409 * implicit |this|. This is for compatibility with the Gecko subscript loader.
1410 */
1411static inline Value ComputeImplicitThis(JSObject* env) {
1412 // Fast-path for GlobalObject
1413 if (env->is<GlobalObject>()) {
1414 return UndefinedValue();
1415 }
1416
1417 // WithEnvironmentObjects have an actual implicit |this|
1418 if (env->is<WithEnvironmentObject>()) {
1419 return ObjectValue(*GetThisObjectOfWith(env));
1420 }
1421
1422 // Debugger environments need special casing, as despite being
1423 // non-syntactic, they wrap syntactic environments and should not be
1424 // treated like other embedding-specific non-syntactic environments.
1425 if (env->is<DebugEnvironmentProxy>()) {
1426 return ComputeImplicitThis(&env->as<DebugEnvironmentProxy>().environment());
1427 }
1428
1429 MOZ_ASSERT(env->is<EnvironmentObject>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(env->is<EnvironmentObject>())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!(env->is<EnvironmentObject>()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("env->is<EnvironmentObject>()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1429); AnnotateMozCrashReason("MOZ_ASSERT" "(" "env->is<EnvironmentObject>()"
")"); do { *((volatile int*)__null) = 1429; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1430 return UndefinedValue();
1431}
1432
1433// BigInt proposal 3.2.4 Abstract Relational Comparison
1434// Returns Nothing when at least one operand is a NaN, or when
1435// ToNumeric or StringToBigInt can't interpret a string as a numeric
1436// value. (These cases correspond to a NaN result in the spec.)
1437// Otherwise, return a boolean to indicate whether lhs is less than
1438// rhs. The operands must be primitives; the caller is responsible for
1439// evaluating them in the correct order.
1440static MOZ_ALWAYS_INLINEinline bool LessThanImpl(JSContext* cx,
1441 MutableHandleValue lhs,
1442 MutableHandleValue rhs,
1443 mozilla::Maybe<bool>& res) {
1444 // Steps 1 and 2 are performed by the caller.
1445
1446 // Step 3.
1447 if (lhs.isString() && rhs.isString()) {
1448 JSString* l = lhs.toString();
1449 JSString* r = rhs.toString();
1450 int32_t result;
1451 if (!CompareStrings(cx, l, r, &result)) {
1452 return false;
1453 }
1454 res = mozilla::Some(result < 0);
1455 return true;
1456 }
1457
1458 // Step 4a.
1459 if (lhs.isBigInt() && rhs.isString()) {
1460 return BigInt::lessThan(cx, lhs, rhs, res);
1461 }
1462
1463 // Step 4b.
1464 if (lhs.isString() && rhs.isBigInt()) {
1465 return BigInt::lessThan(cx, lhs, rhs, res);
1466 }
1467
1468 // Steps 4c and 4d.
1469 if (!ToNumeric(cx, lhs) || !ToNumeric(cx, rhs)) {
1470 return false;
1471 }
1472
1473 // Steps 4e-j.
1474 if (lhs.isBigInt() || rhs.isBigInt()) {
1475 return BigInt::lessThan(cx, lhs, rhs, res);
1476 }
1477
1478 // Step 4e for Number operands.
1479 MOZ_ASSERT(lhs.isNumber() && rhs.isNumber())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(lhs.isNumber() && rhs.isNumber())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(lhs.isNumber() && rhs.isNumber()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("lhs.isNumber() && rhs.isNumber()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1479); AnnotateMozCrashReason("MOZ_ASSERT" "(" "lhs.isNumber() && rhs.isNumber()"
")"); do { *((volatile int*)__null) = 1479; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1480 double lhsNum = lhs.toNumber();
1481 double rhsNum = rhs.toNumber();
1482
1483 if (std::isnan(lhsNum) || std::isnan(rhsNum)) {
1484 res = mozilla::Maybe<bool>(mozilla::Nothing());
1485 return true;
1486 }
1487
1488 res = mozilla::Some(lhsNum < rhsNum);
1489 return true;
1490}
1491
1492static MOZ_ALWAYS_INLINEinline bool LessThanOperation(JSContext* cx,
1493 MutableHandleValue lhs,
1494 MutableHandleValue rhs,
1495 bool* res) {
1496 if (lhs.isInt32() && rhs.isInt32()) {
1497 *res = lhs.toInt32() < rhs.toInt32();
1498 return true;
1499 }
1500
1501 if (!ToPrimitive(cx, JSTYPE_NUMBER, lhs)) {
1502 return false;
1503 }
1504
1505 if (!ToPrimitive(cx, JSTYPE_NUMBER, rhs)) {
1506 return false;
1507 }
1508
1509 mozilla::Maybe<bool> tmpResult;
1510 if (!LessThanImpl(cx, lhs, rhs, tmpResult)) {
1511 return false;
1512 }
1513 *res = tmpResult.valueOr(false);
1514 return true;
1515}
1516
1517static MOZ_ALWAYS_INLINEinline bool LessThanOrEqualOperation(JSContext* cx,
1518 MutableHandleValue lhs,
1519 MutableHandleValue rhs,
1520 bool* res) {
1521 if (lhs.isInt32() && rhs.isInt32()) {
1522 *res = lhs.toInt32() <= rhs.toInt32();
1523 return true;
1524 }
1525
1526 if (!ToPrimitive(cx, JSTYPE_NUMBER, lhs)) {
1527 return false;
1528 }
1529
1530 if (!ToPrimitive(cx, JSTYPE_NUMBER, rhs)) {
1531 return false;
1532 }
1533
1534 mozilla::Maybe<bool> tmpResult;
1535 if (!LessThanImpl(cx, rhs, lhs, tmpResult)) {
1536 return false;
1537 }
1538 *res = !tmpResult.valueOr(true);
1539 return true;
1540}
1541
1542static MOZ_ALWAYS_INLINEinline bool GreaterThanOperation(JSContext* cx,
1543 MutableHandleValue lhs,
1544 MutableHandleValue rhs,
1545 bool* res) {
1546 if (lhs.isInt32() && rhs.isInt32()) {
1547 *res = lhs.toInt32() > rhs.toInt32();
1548 return true;
1549 }
1550
1551 if (!ToPrimitive(cx, JSTYPE_NUMBER, lhs)) {
1552 return false;
1553 }
1554
1555 if (!ToPrimitive(cx, JSTYPE_NUMBER, rhs)) {
1556 return false;
1557 }
1558
1559 mozilla::Maybe<bool> tmpResult;
1560 if (!LessThanImpl(cx, rhs, lhs, tmpResult)) {
1561 return false;
1562 }
1563 *res = tmpResult.valueOr(false);
1564 return true;
1565}
1566
1567static MOZ_ALWAYS_INLINEinline bool GreaterThanOrEqualOperation(
1568 JSContext* cx, MutableHandleValue lhs, MutableHandleValue rhs, bool* res) {
1569 if (lhs.isInt32() && rhs.isInt32()) {
1570 *res = lhs.toInt32() >= rhs.toInt32();
1571 return true;
1572 }
1573
1574 if (!ToPrimitive(cx, JSTYPE_NUMBER, lhs)) {
1575 return false;
1576 }
1577
1578 if (!ToPrimitive(cx, JSTYPE_NUMBER, rhs)) {
1579 return false;
1580 }
1581
1582 mozilla::Maybe<bool> tmpResult;
1583 if (!LessThanImpl(cx, lhs, rhs, tmpResult)) {
1584 return false;
1585 }
1586 *res = !tmpResult.valueOr(true);
1587 return true;
1588}
1589
1590static MOZ_ALWAYS_INLINEinline bool SetObjectElementOperation(
1591 JSContext* cx, HandleObject obj, HandleId id, HandleValue value,
1592 HandleValue receiver, bool strict) {
1593 ObjectOpResult result;
1594 return SetProperty(cx, obj, id, value, receiver, result) &&
1595 result.checkStrictModeError(cx, obj, id, strict);
1596}
1597
1598void js::ReportInNotObjectError(JSContext* cx, HandleValue lref,
1599 HandleValue rref) {
1600 auto uniqueCharsFromString = [](JSContext* cx,
1601 HandleValue ref) -> UniqueChars {
1602 static const size_t MaxStringLength = 16;
1603 RootedString str(cx, ref.toString());
1604 if (str->length() > MaxStringLength) {
1605 JSStringBuilder buf(cx);
1606 if (!buf.appendSubstring(str, 0, MaxStringLength)) {
1607 return nullptr;
1608 }
1609 if (!buf.append("...")) {
1610 return nullptr;
1611 }
1612 str = buf.finishString();
1613 if (!str) {
1614 return nullptr;
1615 }
1616 }
1617 return QuoteString(cx, str, '"');
1618 };
1619
1620 if (lref.isString() && rref.isString()) {
1621 UniqueChars lbytes = uniqueCharsFromString(cx, lref);
1622 if (!lbytes) {
1623 return;
1624 }
1625 UniqueChars rbytes = uniqueCharsFromString(cx, rref);
1626 if (!rbytes) {
1627 return;
1628 }
1629 JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr, JSMSG_IN_STRING,
1630 lbytes.get(), rbytes.get());
1631 return;
1632 }
1633
1634 JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_IN_NOT_OBJECT,
1635 InformalValueTypeName(rref));
1636}
1637
1638bool MOZ_NEVER_INLINE__attribute__((noinline)) JS_HAZ_JSNATIVE_CALLER js::Interpret(JSContext* cx,
1639 RunState& state) {
1640/*
1641 * Define macros for an interpreter loop. Opcode dispatch is done by
1642 * indirect goto (aka a threaded interpreter), which is technically
1643 * non-standard but is supported by all of our supported compilers.
1644 */
1645#define INTERPRETER_LOOP()
1646#define CASE(OP)label_OP: label_##OP:
1647#define DEFAULT()label_default: \
1648 label_default:
1649#define DISPATCH_TO(OP)goto* addresses[(OP)] goto* addresses[(OP)]
1650
1651#define LABEL(X)(&&label_X) (&&label_##X)
1652
1653 // Use addresses instead of offsets to optimize for runtime speed over
1654 // load-time relocation overhead.
1655 static const void* const addresses[EnableInterruptsPseudoOpcode + 1] = {
1656#define OPCODE_LABEL(op, ...) LABEL(op)(&&label_op),
1657 FOR_EACH_OPCODE(OPCODE_LABEL)OPCODE_LABEL(Undefined, undefined, "", 1, 0, 1, JOF_BYTE) OPCODE_LABEL
(Null, null, "null", 1, 0, 1, JOF_BYTE) OPCODE_LABEL(False, false_
, "false", 1, 0, 1, JOF_BYTE) OPCODE_LABEL(True, true_, "true"
, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(Int32, int32, __null, 5, 0,
1, JOF_INT32) OPCODE_LABEL(Zero, zero, "0", 1, 0, 1, JOF_BYTE
) OPCODE_LABEL(One, one, "1", 1, 0, 1, JOF_BYTE) OPCODE_LABEL
(Int8, int8, __null, 2, 0, 1, JOF_INT8) OPCODE_LABEL(Uint16, uint16
, __null, 3, 0, 1, JOF_UINT16) OPCODE_LABEL(Uint24, uint24, __null
, 4, 0, 1, JOF_UINT24) OPCODE_LABEL(Double, double_, __null, 9
, 0, 1, JOF_DOUBLE) OPCODE_LABEL(BigInt, big_int, __null, 5, 0
, 1, JOF_BIGINT) OPCODE_LABEL(String, string, __null, 5, 0, 1
, JOF_STRING) OPCODE_LABEL(Symbol, symbol, __null, 2, 0, 1, JOF_UINT8
) OPCODE_LABEL(Void, void_, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL
(Typeof, typeof_, __null, 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(TypeofExpr, typeof_expr, __null, 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(TypeofEq, typeof_eq, __null, 2, 1, 1, JOF_UINT8|JOF_IC) OPCODE_LABEL
(Pos, pos, "+ ", 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Neg, neg
, "- ", 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(BitNot, bit_not
, "~", 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Not, not_, "!",
1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(BitOr, bit_or, "|", 1
, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(BitXor, bit_xor, "^", 1
, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(BitAnd, bit_and, "&"
, 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Eq, eq, "==", 1, 2, 1
, JOF_BYTE|JOF_IC) OPCODE_LABEL(Ne, ne, "!=", 1, 2, 1, JOF_BYTE
|JOF_IC) OPCODE_LABEL(StrictEq, strict_eq, "===", 1, 2, 1, JOF_BYTE
|JOF_IC) OPCODE_LABEL(StrictNe, strict_ne, "!==", 1, 2, 1, JOF_BYTE
|JOF_IC) OPCODE_LABEL(Lt, lt, "<", 1, 2, 1, JOF_BYTE|JOF_IC
) OPCODE_LABEL(Gt, gt, ">", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(Le, le, "<=", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Ge, ge
, ">=", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Instanceof,
instanceof, "instanceof", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(In, in_, "in", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Lsh, lsh
, "<<", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Rsh, rsh
, ">>", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Ursh, ursh
, ">>>", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Add,
add, "+", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Sub, sub, "-"
, 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Inc, inc, __null, 1,
1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Dec, dec, __null, 1, 1, 1
, JOF_BYTE|JOF_IC) OPCODE_LABEL(Mul, mul, "*", 1, 2, 1, JOF_BYTE
|JOF_IC) OPCODE_LABEL(Div, div, "/", 1, 2, 1, JOF_BYTE|JOF_IC
) OPCODE_LABEL(Mod, mod, "%", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(Pow, pow, "**", 1, 2, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(NopIsAssignOp
, nop_is_assign_op, __null, 1, 0, 0, JOF_BYTE) OPCODE_LABEL(ToPropertyKey
, to_property_key, __null, 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(ToNumeric, to_numeric, __null, 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(ToString, to_string, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL
(IsNullOrUndefined, is_null_or_undefined, __null, 1, 1, 2, JOF_BYTE
) OPCODE_LABEL(GlobalThis, global_this, __null, 1, 0, 1, JOF_BYTE
) OPCODE_LABEL(NonSyntacticGlobalThis, non_syntactic_global_this
, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(NewTarget, new_target
, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(DynamicImport, dynamic_import
, __null, 1, 2, 1, JOF_BYTE) OPCODE_LABEL(ImportMeta, import_meta
, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(NewInit, new_init, __null
, 1, 0, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(NewObject, new_object
, __null, 5, 0, 1, JOF_SHAPE|JOF_IC) OPCODE_LABEL(Object, object
, __null, 5, 0, 1, JOF_OBJECT) OPCODE_LABEL(ObjWithProto, obj_with_proto
, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL(InitProp, init_prop
, __null, 5, 2, 1, JOF_ATOM|JOF_PROPINIT|JOF_IC) OPCODE_LABEL
(InitHiddenProp, init_hidden_prop, __null, 5, 2, 1, JOF_ATOM|
JOF_PROPINIT|JOF_IC) OPCODE_LABEL(InitLockedProp, init_locked_prop
, __null, 5, 2, 1, JOF_ATOM|JOF_PROPINIT|JOF_IC) OPCODE_LABEL
(InitElem, init_elem, __null, 1, 3, 1, JOF_BYTE|JOF_PROPINIT|
JOF_IC) OPCODE_LABEL(InitHiddenElem, init_hidden_elem, __null
, 1, 3, 1, JOF_BYTE|JOF_PROPINIT|JOF_IC) OPCODE_LABEL(InitLockedElem
, init_locked_elem, __null, 1, 3, 1, JOF_BYTE|JOF_PROPINIT|JOF_IC
) OPCODE_LABEL(InitPropGetter, init_prop_getter, __null, 5, 2
, 1, JOF_ATOM|JOF_PROPINIT) OPCODE_LABEL(InitHiddenPropGetter
, init_hidden_prop_getter, __null, 5, 2, 1, JOF_ATOM|JOF_PROPINIT
) OPCODE_LABEL(InitElemGetter, init_elem_getter, __null, 1, 3
, 1, JOF_BYTE|JOF_PROPINIT) OPCODE_LABEL(InitHiddenElemGetter
, init_hidden_elem_getter, __null, 1, 3, 1, JOF_BYTE|JOF_PROPINIT
) OPCODE_LABEL(InitPropSetter, init_prop_setter, __null, 5, 2
, 1, JOF_ATOM|JOF_PROPINIT) OPCODE_LABEL(InitHiddenPropSetter
, init_hidden_prop_setter, __null, 5, 2, 1, JOF_ATOM|JOF_PROPINIT
) OPCODE_LABEL(InitElemSetter, init_elem_setter, __null, 1, 3
, 1, JOF_BYTE|JOF_PROPINIT) OPCODE_LABEL(InitHiddenElemSetter
, init_hidden_elem_setter, __null, 1, 3, 1, JOF_BYTE|JOF_PROPINIT
) OPCODE_LABEL(GetProp, get_prop, __null, 5, 1, 1, JOF_ATOM|JOF_IC
) OPCODE_LABEL(GetElem, get_elem, __null, 1, 2, 1, JOF_BYTE|JOF_IC
) OPCODE_LABEL(SetProp, set_prop, __null, 5, 2, 1, JOF_ATOM|JOF_PROPSET
|JOF_CHECKSLOPPY|JOF_IC) OPCODE_LABEL(StrictSetProp, strict_set_prop
, __null, 5, 2, 1, JOF_ATOM|JOF_PROPSET|JOF_CHECKSTRICT|JOF_IC
) OPCODE_LABEL(SetElem, set_elem, __null, 1, 3, 1, JOF_BYTE|JOF_PROPSET
|JOF_CHECKSLOPPY|JOF_IC) OPCODE_LABEL(StrictSetElem, strict_set_elem
, __null, 1, 3, 1, JOF_BYTE|JOF_PROPSET|JOF_CHECKSTRICT|JOF_IC
) OPCODE_LABEL(DelProp, del_prop, __null, 5, 1, 1, JOF_ATOM|JOF_CHECKSLOPPY
) OPCODE_LABEL(StrictDelProp, strict_del_prop, __null, 5, 1, 1
, JOF_ATOM|JOF_CHECKSTRICT) OPCODE_LABEL(DelElem, del_elem, __null
, 1, 2, 1, JOF_BYTE|JOF_CHECKSLOPPY) OPCODE_LABEL(StrictDelElem
, strict_del_elem, __null, 1, 2, 1, JOF_BYTE|JOF_CHECKSTRICT)
OPCODE_LABEL(HasOwn, has_own, __null, 1, 2, 1, JOF_BYTE|JOF_IC
) OPCODE_LABEL(CheckPrivateField, check_private_field, __null
, 3, 2, 3, JOF_TWO_UINT8|JOF_CHECKSTRICT|JOF_IC) OPCODE_LABEL
(NewPrivateName, new_private_name, __null, 5, 0, 1, JOF_ATOM)
OPCODE_LABEL(SuperBase, super_base, __null, 1, 1, 1, JOF_BYTE
) OPCODE_LABEL(GetPropSuper, get_prop_super, __null, 5, 2, 1,
JOF_ATOM|JOF_IC) OPCODE_LABEL(GetElemSuper, get_elem_super, __null
, 1, 3, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(SetPropSuper, set_prop_super
, __null, 5, 3, 1, JOF_ATOM|JOF_PROPSET|JOF_CHECKSLOPPY) OPCODE_LABEL
(StrictSetPropSuper, strict_set_prop_super, __null, 5, 3, 1, JOF_ATOM
|JOF_PROPSET|JOF_CHECKSTRICT) OPCODE_LABEL(SetElemSuper, set_elem_super
, __null, 1, 4, 1, JOF_BYTE|JOF_PROPSET|JOF_CHECKSLOPPY) OPCODE_LABEL
(StrictSetElemSuper, strict_set_elem_super, __null, 1, 4, 1, JOF_BYTE
|JOF_PROPSET|JOF_CHECKSTRICT) OPCODE_LABEL(Iter, iter, __null
, 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(MoreIter, more_iter,
__null, 1, 1, 2, JOF_BYTE) OPCODE_LABEL(IsNoIter, is_no_iter
, __null, 1, 1, 2, JOF_BYTE) OPCODE_LABEL(EndIter, end_iter, __null
, 1, 2, 0, JOF_BYTE) OPCODE_LABEL(CloseIter, close_iter, __null
, 2, 1, 0, JOF_UINT8|JOF_IC) OPCODE_LABEL(OptimizeGetIterator
, optimize_get_iterator, __null, 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL
(CheckIsObj, check_is_obj, __null, 2, 1, 1, JOF_UINT8) OPCODE_LABEL
(CheckObjCoercible, check_obj_coercible, __null, 1, 1, 1, JOF_BYTE
) OPCODE_LABEL(ToAsyncIter, to_async_iter, __null, 1, 2, 1, JOF_BYTE
) OPCODE_LABEL(MutateProto, mutate_proto, __null, 1, 2, 1, JOF_BYTE
) OPCODE_LABEL(NewArray, new_array, __null, 5, 0, 1, JOF_UINT32
|JOF_IC) OPCODE_LABEL(InitElemArray, init_elem_array, __null,
5, 2, 1, JOF_UINT32|JOF_PROPINIT) OPCODE_LABEL(InitElemInc, init_elem_inc
, __null, 1, 3, 2, JOF_BYTE|JOF_PROPINIT|JOF_IC) OPCODE_LABEL
(Hole, hole, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(RegExp, reg_exp
, __null, 5, 0, 1, JOF_REGEXP) OPCODE_LABEL(Lambda, lambda, __null
, 5, 0, 1, JOF_OBJECT|JOF_USES_ENV) OPCODE_LABEL(SetFunName, set_fun_name
, __null, 2, 2, 1, JOF_UINT8) OPCODE_LABEL(InitHomeObject, init_home_object
, __null, 1, 2, 1, JOF_BYTE) OPCODE_LABEL(CheckClassHeritage,
check_class_heritage, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL
(FunWithProto, fun_with_proto, __null, 5, 1, 1, JOF_OBJECT|JOF_USES_ENV
) OPCODE_LABEL(BuiltinObject, builtin_object, __null, 2, 0, 1
, JOF_UINT8) OPCODE_LABEL(Call, call, __null, 3, -1, 1, JOF_ARGC
|JOF_INVOKE|JOF_IC) OPCODE_LABEL(CallContent, call_content, __null
, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC) OPCODE_LABEL(CallIter
, call_iter, __null, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC) OPCODE_LABEL
(CallContentIter, call_content_iter, __null, 3, -1, 1, JOF_ARGC
|JOF_INVOKE|JOF_IC) OPCODE_LABEL(CallIgnoresRv, call_ignores_rv
, __null, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_IC) OPCODE_LABEL(
SpreadCall, spread_call, __null, 1, 3, 1, JOF_BYTE|JOF_INVOKE
|JOF_SPREAD|JOF_IC) OPCODE_LABEL(OptimizeSpreadCall, optimize_spread_call
, __null, 1, 1, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(Eval, eval, __null
, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CHECKSLOPPY|JOF_IC) OPCODE_LABEL
(SpreadEval, spread_eval, __null, 1, 3, 1, JOF_BYTE|JOF_INVOKE
|JOF_SPREAD|JOF_CHECKSLOPPY|JOF_IC) OPCODE_LABEL(StrictEval, strict_eval
, __null, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CHECKSTRICT|JOF_IC
) OPCODE_LABEL(StrictSpreadEval, strict_spread_eval, __null, 1
, 3, 1, JOF_BYTE|JOF_INVOKE|JOF_SPREAD|JOF_CHECKSTRICT|JOF_IC
) OPCODE_LABEL(ImplicitThis, implicit_this, "", 5, 0, 1, JOF_ATOM
|JOF_USES_ENV) OPCODE_LABEL(CallSiteObj, call_site_obj, __null
, 5, 0, 1, JOF_OBJECT) OPCODE_LABEL(IsConstructing, is_constructing
, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(New, new_, __null, 3
, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CONSTRUCT|JOF_IC) OPCODE_LABEL
(NewContent, new_content, __null, 3, -1, 1, JOF_ARGC|JOF_INVOKE
|JOF_CONSTRUCT|JOF_IC) OPCODE_LABEL(SuperCall, super_call, __null
, 3, -1, 1, JOF_ARGC|JOF_INVOKE|JOF_CONSTRUCT|JOF_IC) OPCODE_LABEL
(SpreadNew, spread_new, __null, 1, 4, 1, JOF_BYTE|JOF_INVOKE|
JOF_CONSTRUCT|JOF_SPREAD|JOF_IC) OPCODE_LABEL(SpreadSuperCall
, spread_super_call, __null, 1, 4, 1, JOF_BYTE|JOF_INVOKE|JOF_CONSTRUCT
|JOF_SPREAD|JOF_IC) OPCODE_LABEL(SuperFun, super_fun, __null,
1, 1, 1, JOF_BYTE) OPCODE_LABEL(CheckThisReinit, check_this_reinit
, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL(Generator, generator
, __null, 1, 0, 1, JOF_BYTE|JOF_USES_ENV) OPCODE_LABEL(InitialYield
, initial_yield, __null, 4, 1, 3, JOF_RESUMEINDEX) OPCODE_LABEL
(AfterYield, after_yield, __null, 5, 0, 0, JOF_ICINDEX) OPCODE_LABEL
(FinalYieldRval, final_yield_rval, __null, 1, 1, 0, JOF_BYTE)
OPCODE_LABEL(Yield, yield, __null, 4, 2, 3, JOF_RESUMEINDEX)
OPCODE_LABEL(IsGenClosing, is_gen_closing, __null, 1, 1, 2, JOF_BYTE
) OPCODE_LABEL(AsyncAwait, async_await, __null, 1, 2, 1, JOF_BYTE
) OPCODE_LABEL(AsyncResolve, async_resolve, __null, 1, 2, 1, JOF_BYTE
) OPCODE_LABEL(AsyncReject, async_reject, __null, 1, 3, 1, JOF_BYTE
) OPCODE_LABEL(Await, await, __null, 4, 2, 3, JOF_RESUMEINDEX
) OPCODE_LABEL(CanSkipAwait, can_skip_await, __null, 1, 1, 2,
JOF_BYTE) OPCODE_LABEL(MaybeExtractAwaitValue, maybe_extract_await_value
, __null, 1, 2, 2, JOF_BYTE) OPCODE_LABEL(ResumeKind, resume_kind
, __null, 2, 0, 1, JOF_UINT8) OPCODE_LABEL(CheckResumeKind, check_resume_kind
, __null, 1, 3, 1, JOF_BYTE) OPCODE_LABEL(Resume, resume, __null
, 1, 3, 1, JOF_BYTE|JOF_INVOKE) OPCODE_LABEL(JumpTarget, jump_target
, __null, 5, 0, 0, JOF_ICINDEX) OPCODE_LABEL(LoopHead, loop_head
, __null, 6, 0, 0, JOF_LOOPHEAD) OPCODE_LABEL(Goto, goto_, __null
, 5, 0, 0, JOF_JUMP) OPCODE_LABEL(JumpIfFalse, jump_if_false,
__null, 5, 1, 0, JOF_JUMP|JOF_IC) OPCODE_LABEL(JumpIfTrue, jump_if_true
, __null, 5, 1, 0, JOF_JUMP|JOF_IC) OPCODE_LABEL(And, and_, __null
, 5, 1, 1, JOF_JUMP|JOF_IC) OPCODE_LABEL(Or, or_, __null, 5, 1
, 1, JOF_JUMP|JOF_IC) OPCODE_LABEL(Coalesce, coalesce, __null
, 5, 1, 1, JOF_JUMP) OPCODE_LABEL(Case, case_, __null, 5, 2, 1
, JOF_JUMP) OPCODE_LABEL(Default, default_, __null, 5, 1, 0, JOF_JUMP
) OPCODE_LABEL(TableSwitch, table_switch, __null, 16, 1, 0, JOF_TABLESWITCH
) OPCODE_LABEL(Return, return_, __null, 1, 1, 0, JOF_BYTE) OPCODE_LABEL
(GetRval, get_rval, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(SetRval
, set_rval, __null, 1, 1, 0, JOF_BYTE) OPCODE_LABEL(RetRval, ret_rval
, __null, 1, 0, 0, JOF_BYTE) OPCODE_LABEL(CheckReturn, check_return
, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL(Throw, throw_, __null
, 1, 1, 0, JOF_BYTE) OPCODE_LABEL(ThrowWithStack, throw_with_stack
, __null, 1, 2, 0, JOF_BYTE) OPCODE_LABEL(ThrowMsg, throw_msg
, __null, 2, 0, 0, JOF_UINT8) OPCODE_LABEL(ThrowSetConst, throw_set_const
, __null, 5, 0, 0, JOF_ATOM) OPCODE_LABEL(Try, try_, __null, 1
, 0, 0, JOF_BYTE) OPCODE_LABEL(TryDestructuring, try_destructuring
, __null, 1, 0, 0, JOF_BYTE) OPCODE_LABEL(Exception, exception
, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(ExceptionAndStack, exception_and_stack
, __null, 1, 0, 2, JOF_BYTE) OPCODE_LABEL(Finally, finally, __null
, 1, 0, 0, JOF_BYTE) OPCODE_LABEL(Uninitialized, uninitialized
, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(InitLexical, init_lexical
, __null, 4, 1, 1, JOF_LOCAL) OPCODE_LABEL(InitGLexical, init_g_lexical
, __null, 5, 1, 1, JOF_ATOM|JOF_PROPINIT|JOF_GNAME|JOF_IC) OPCODE_LABEL
(InitAliasedLexical, init_aliased_lexical, __null, 5, 1, 1, JOF_ENVCOORD
|JOF_PROPINIT) OPCODE_LABEL(CheckLexical, check_lexical, __null
, 4, 1, 1, JOF_LOCAL) OPCODE_LABEL(CheckAliasedLexical, check_aliased_lexical
, __null, 5, 1, 1, JOF_ENVCOORD) OPCODE_LABEL(CheckThis, check_this
, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL(BindGName, bind_g_name
, __null, 5, 0, 1, JOF_ATOM|JOF_GNAME|JOF_IC) OPCODE_LABEL(BindName
, bind_name, __null, 5, 0, 1, JOF_ATOM|JOF_IC|JOF_USES_ENV) OPCODE_LABEL
(GetName, get_name, __null, 5, 0, 1, JOF_ATOM|JOF_IC|JOF_USES_ENV
) OPCODE_LABEL(GetGName, get_g_name, __null, 5, 0, 1, JOF_ATOM
|JOF_GNAME|JOF_IC) OPCODE_LABEL(GetArg, get_arg, __null, 3, 0
, 1, JOF_QARG) OPCODE_LABEL(GetFrameArg, get_frame_arg, __null
, 3, 0, 1, JOF_QARG) OPCODE_LABEL(GetLocal, get_local, __null
, 4, 0, 1, JOF_LOCAL) OPCODE_LABEL(ArgumentsLength, arguments_length
, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(GetActualArg, get_actual_arg
, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL(GetAliasedVar, get_aliased_var
, __null, 5, 0, 1, JOF_ENVCOORD|JOF_USES_ENV) OPCODE_LABEL(GetAliasedDebugVar
, get_aliased_debug_var, __null, 5, 0, 1, JOF_DEBUGCOORD) OPCODE_LABEL
(GetImport, get_import, __null, 5, 0, 1, JOF_ATOM) OPCODE_LABEL
(GetBoundName, get_bound_name, __null, 5, 1, 1, JOF_ATOM|JOF_IC
) OPCODE_LABEL(GetIntrinsic, get_intrinsic, __null, 5, 0, 1, JOF_ATOM
|JOF_IC) OPCODE_LABEL(Callee, callee, __null, 1, 0, 1, JOF_BYTE
) OPCODE_LABEL(EnvCallee, env_callee, __null, 2, 0, 1, JOF_UINT8
) OPCODE_LABEL(SetName, set_name, __null, 5, 2, 1, JOF_ATOM|JOF_PROPSET
|JOF_CHECKSLOPPY|JOF_IC|JOF_USES_ENV) OPCODE_LABEL(StrictSetName
, strict_set_name, __null, 5, 2, 1, JOF_ATOM|JOF_PROPSET|JOF_CHECKSTRICT
|JOF_IC|JOF_USES_ENV) OPCODE_LABEL(SetGName, set_g_name, __null
, 5, 2, 1, JOF_ATOM|JOF_PROPSET|JOF_GNAME|JOF_CHECKSLOPPY|JOF_IC
) OPCODE_LABEL(StrictSetGName, strict_set_g_name, __null, 5, 2
, 1, JOF_ATOM|JOF_PROPSET|JOF_GNAME|JOF_CHECKSTRICT|JOF_IC) OPCODE_LABEL
(SetArg, set_arg, __null, 3, 1, 1, JOF_QARG) OPCODE_LABEL(SetLocal
, set_local, __null, 4, 1, 1, JOF_LOCAL) OPCODE_LABEL(SetAliasedVar
, set_aliased_var, __null, 5, 1, 1, JOF_ENVCOORD|JOF_PROPSET|
JOF_USES_ENV) OPCODE_LABEL(SetIntrinsic, set_intrinsic, __null
, 5, 1, 1, JOF_ATOM) OPCODE_LABEL(PushLexicalEnv, push_lexical_env
, __null, 5, 0, 0, JOF_SCOPE|JOF_USES_ENV) OPCODE_LABEL(PopLexicalEnv
, pop_lexical_env, __null, 1, 0, 0, JOF_BYTE|JOF_USES_ENV) OPCODE_LABEL
(DebugLeaveLexicalEnv, debug_leave_lexical_env, __null, 1, 0,
0, JOF_BYTE) OPCODE_LABEL(RecreateLexicalEnv, recreate_lexical_env
, __null, 5, 0, 0, JOF_SCOPE) OPCODE_LABEL(FreshenLexicalEnv,
freshen_lexical_env, __null, 5, 0, 0, JOF_SCOPE) OPCODE_LABEL
(PushClassBodyEnv, push_class_body_env, __null, 5, 0, 0, JOF_SCOPE
) OPCODE_LABEL(PushVarEnv, push_var_env, __null, 5, 0, 0, JOF_SCOPE
|JOF_USES_ENV) OPCODE_LABEL(EnterWith, enter_with, __null, 5,
1, 0, JOF_SCOPE) OPCODE_LABEL(LeaveWith, leave_with, __null,
1, 0, 0, JOF_BYTE) OPCODE_LABEL(BindVar, bind_var, __null, 1
, 0, 1, JOF_BYTE|JOF_USES_ENV) OPCODE_LABEL(GlobalOrEvalDeclInstantiation
, global_or_eval_decl_instantiation, __null, 5, 0, 0, JOF_GCTHING
|JOF_USES_ENV) OPCODE_LABEL(DelName, del_name, __null, 5, 0, 1
, JOF_ATOM|JOF_CHECKSLOPPY|JOF_USES_ENV) OPCODE_LABEL(Arguments
, arguments, __null, 1, 0, 1, JOF_BYTE|JOF_USES_ENV) OPCODE_LABEL
(Rest, rest, __null, 1, 0, 1, JOF_BYTE|JOF_IC) OPCODE_LABEL(FunctionThis
, function_this, __null, 1, 0, 1, JOF_BYTE) OPCODE_LABEL(Pop,
pop, __null, 1, 1, 0, JOF_BYTE) OPCODE_LABEL(PopN, pop_n, __null
, 3, -1, 0, JOF_UINT16) OPCODE_LABEL(Dup, dup, __null, 1, 1, 2
, JOF_BYTE) OPCODE_LABEL(Dup2, dup2, __null, 1, 2, 4, JOF_BYTE
) OPCODE_LABEL(DupAt, dup_at, __null, 4, 0, 1, JOF_UINT24) OPCODE_LABEL
(Swap, swap, __null, 1, 2, 2, JOF_BYTE) OPCODE_LABEL(Pick, pick
, __null, 2, 0, 0, JOF_UINT8) OPCODE_LABEL(Unpick, unpick, __null
, 2, 0, 0, JOF_UINT8) OPCODE_LABEL(Nop, nop, __null, 1, 0, 0,
JOF_BYTE) OPCODE_LABEL(Lineno, lineno, __null, 5, 0, 0, JOF_UINT32
) OPCODE_LABEL(NopDestructuring, nop_destructuring, __null, 1
, 0, 0, JOF_BYTE) OPCODE_LABEL(ForceInterpreter, force_interpreter
, __null, 1, 0, 0, JOF_BYTE) OPCODE_LABEL(DebugCheckSelfHosted
, debug_check_self_hosted, __null, 1, 1, 1, JOF_BYTE) OPCODE_LABEL
(Debugger, debugger, __null, 1, 0, 0, JOF_BYTE)
1658#undef OPCODE_LABEL
1659#define TRAILING_LABEL(v) \
1660 ((v) == EnableInterruptsPseudoOpcode ? LABEL(EnableInterruptsPseudoOpcode)(&&label_EnableInterruptsPseudoOpcode) \
1661 : LABEL(default)(&&label_default)),
1662 FOR_EACH_TRAILING_UNUSED_OPCODE(TRAILING_LABEL)TRAILING_LABEL(236) TRAILING_LABEL(237) TRAILING_LABEL(238) TRAILING_LABEL
(239) TRAILING_LABEL(240) TRAILING_LABEL(241) TRAILING_LABEL(
242) TRAILING_LABEL(243) TRAILING_LABEL(244) TRAILING_LABEL(245
) TRAILING_LABEL(246) TRAILING_LABEL(247) TRAILING_LABEL(248)
TRAILING_LABEL(249) TRAILING_LABEL(250) TRAILING_LABEL(251) TRAILING_LABEL
(252) TRAILING_LABEL(253) TRAILING_LABEL(254) TRAILING_LABEL(
255)
1663#undef TRAILING_LABEL
1664 };
1665
1666 /*
1667 * Increment REGS.pc by N, load the opcode at that position,
1668 * and jump to the code to execute it.
1669 *
1670 * When Debugger puts a script in single-step mode, all js::Interpret
1671 * invocations that might be presently running that script must have
1672 * interrupts enabled. It's not practical to simply check
1673 * script->stepModeEnabled() at each point some callee could have changed
1674 * it, because there are so many places js::Interpret could possibly cause
1675 * JavaScript to run: each place an object might be coerced to a primitive
1676 * or a number, for example. So instead, we expose a simple mechanism to
1677 * let Debugger tweak the affected js::Interpret frames when an onStep
1678 * handler is added: calling activation.enableInterruptsUnconditionally()
1679 * will enable interrupts, and activation.opMask() is or'd with the opcode
1680 * to implement a simple alternate dispatch.
1681 */
1682#define ADVANCE_AND_DISPATCH(N)do { (activation.regs()).pc += (N); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
\
1683 JS_BEGIN_MACROdo { \
1684 REGS(activation.regs()).pc += (N); \
1685 SANITY_CHECKS()do { js::gc::MaybeVerifyBarriers(cx); } while (0); \
1686 DISPATCH_TO(*REGS.pc | activation.opMask())goto* addresses[(*(activation.regs()).pc | activation.opMask(
))]
; \
1687 JS_END_MACRO} while (0)
1688
1689 /*
1690 * Shorthand for the common sequence at the end of a fixed-size opcode.
1691 */
1692#define END_CASE(OP)do { (activation.regs()).pc += (JSOpLength_OP); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
ADVANCE_AND_DISPATCH(JSOpLength_##OP)do { (activation.regs()).pc += (JSOpLength_##OP); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0)
;
1693
1694 /*
1695 * Prepare to call a user-supplied branch handler, and abort the script
1696 * if it returns false.
1697 */
1698#define CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0) \
1699 JS_BEGIN_MACROdo { \
1700 if (!CheckForInterrupt(cx)) goto error; \
1701 JS_END_MACRO} while (0)
1702
1703 /*
1704 * This is a simple wrapper around ADVANCE_AND_DISPATCH which also does
1705 * a CHECK_BRANCH() if n is not positive, which possibly indicates that it
1706 * is the backedge of a loop.
1707 */
1708#define BRANCH(n)do { int32_t nlen = (n); if (nlen <= 0) do { if (!CheckForInterrupt
(cx)) goto error; } while (0); do { (activation.regs()).pc +=
(nlen); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto
* addresses[(*(activation.regs()).pc | activation.opMask())];
} while (0); } while (0)
\
1709 JS_BEGIN_MACROdo { \
1710 int32_t nlen = (n); \
1711 if (nlen <= 0) CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0); \
1712 ADVANCE_AND_DISPATCH(nlen)do { (activation.regs()).pc += (nlen); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
; \
1713 JS_END_MACRO} while (0)
1714
1715 /*
1716 * Initialize code coverage vectors.
1717 */
1718#define INIT_COVERAGE()do { if (!script->hasScriptCounts()) { if (cx->realm()->
collectCoverageForDebug()) { if (!script->initScriptCounts
(cx)) goto error; } } } while (0)
\
1719 JS_BEGIN_MACROdo { \
1720 if (!script->hasScriptCounts()) { \
1721 if (cx->realm()->collectCoverageForDebug()) { \
1722 if (!script->initScriptCounts(cx)) goto error; \
1723 } \
1724 } \
1725 JS_END_MACRO} while (0)
1726
1727 /*
1728 * Increment the code coverage counter associated with the given pc.
1729 */
1730#define COUNT_COVERAGE_PC(PC)do { if (script->hasScriptCounts()) { PCCounts* counts = script
->maybeGetPCCounts(PC); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(counts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(counts))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1730); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1730; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0)
\
1731 JS_BEGIN_MACROdo { \
1732 if (script->hasScriptCounts()) { \
1733 PCCounts* counts = script->maybeGetPCCounts(PC); \
1734 MOZ_ASSERT(counts)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(counts)>::isValid, "invalid assertion condition")
; if ((__builtin_expect(!!(!(!!(counts))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1734); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1734; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
1735 counts->numExec()++; \
1736 } \
1737 JS_END_MACRO} while (0)
1738
1739#define COUNT_COVERAGE_MAIN()do { jsbytecode* main = script->main(); if (!BytecodeIsJumpTarget
(JSOp(*main))) do { if (script->hasScriptCounts()) { PCCounts
* counts = script->maybeGetPCCounts(main); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(counts)
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(counts))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1739); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1739; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0); } while (0)
\
1740 JS_BEGIN_MACROdo { \
1741 jsbytecode* main = script->main(); \
1742 if (!BytecodeIsJumpTarget(JSOp(*main))) COUNT_COVERAGE_PC(main)do { if (script->hasScriptCounts()) { PCCounts* counts = script
->maybeGetPCCounts(main); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(counts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(counts))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1742); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1742; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0)
; \
1743 JS_END_MACRO} while (0)
1744
1745#define COUNT_COVERAGE()do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc)))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1745); AnnotateMozCrashReason("MOZ_ASSERT" "(" "BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
")"); do { *((volatile int*)__null) = 1745; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { if (script
->hasScriptCounts()) { PCCounts* counts = script->maybeGetPCCounts
((activation.regs()).pc); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(counts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(counts))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1745); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1745; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0); } while (0)
\
1746 JS_BEGIN_MACROdo { \
1747 MOZ_ASSERT(BytecodeIsJumpTarget(JSOp(*REGS.pc)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc)))
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc)))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1747); AnnotateMozCrashReason("MOZ_ASSERT" "(" "BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
")"); do { *((volatile int*)__null) = 1747; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
1748 COUNT_COVERAGE_PC(REGS.pc)do { if (script->hasScriptCounts()) { PCCounts* counts = script
->maybeGetPCCounts((activation.regs()).pc); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(counts)
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(counts))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1748); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1748; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0)
; \
1749 JS_END_MACRO} while (0)
1750
1751#define SET_SCRIPT(s)do { script = (s); do { static_assert( mozilla::detail::AssertionConditionType
<decltype(cx->realm() == script->realm())>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(cx->realm() == script->realm()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("cx->realm() == script->realm()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1751); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == script->realm()"
")"); do { *((volatile int*)__null) = 1751; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); if (DebugAPI
::hasAnyBreakpointsOrStepMode(script) || script->hasScriptCounts
()) activation.enableInterruptsUnconditionally(); } while (0)
\
1752 JS_BEGIN_MACROdo { \
1753 script = (s); \
1754 MOZ_ASSERT(cx->realm() == script->realm())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->realm() == script->realm())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->realm() == script->
realm()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cx->realm() == script->realm()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1754); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == script->realm()"
")"); do { *((volatile int*)__null) = 1754; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
1755 if (DebugAPI::hasAnyBreakpointsOrStepMode(script) || \
1756 script->hasScriptCounts()) \
1757 activation.enableInterruptsUnconditionally(); \
1758 JS_END_MACRO} while (0)
1759
1760#define SANITY_CHECKS()do { js::gc::MaybeVerifyBarriers(cx); } while (0) \
1761 JS_BEGIN_MACROdo { \
1762 js::gc::MaybeVerifyBarriers(cx); \
1763 JS_END_MACRO} while (0)
1764
1765// Verify that an uninitialized lexical is followed by a correct check op.
1766#ifdef DEBUG1
1767# define ASSERT_UNINITIALIZED_ALIASED_LEXICAL(val)do { if (IsUninitializedLexical(val)) { JSOp next = JSOp(*GetNextPc
((activation.regs()).pc)); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(next == JSOp::CheckThis ||
next == JSOp::CheckReturn || next == JSOp::CheckThisReinit ||
next == JSOp::CheckAliasedLexical)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(next == JSOp::CheckThis || next
== JSOp::CheckReturn || next == JSOp::CheckThisReinit || next
== JSOp::CheckAliasedLexical))), 0))) { do { } while (false)
; MOZ_ReportAssertionFailure("next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1767); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
")"); do { *((volatile int*)__null) = 1767; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
0)
\
1768 JS_BEGIN_MACROdo { \
1769 if (IsUninitializedLexical(val)) { \
1770 JSOp next = JSOp(*GetNextPc(REGS(activation.regs()).pc)); \
1771 MOZ_ASSERT(next == JSOp::CheckThis || next == JSOp::CheckReturn || \do { static_assert( mozilla::detail::AssertionConditionType<
decltype(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1773); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
")"); do { *((volatile int*)__null) = 1773; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1772 next == JSOp::CheckThisReinit || \do { static_assert( mozilla::detail::AssertionConditionType<
decltype(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1773); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
")"); do { *((volatile int*)__null) = 1773; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
1773 next == JSOp::CheckAliasedLexical)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1773); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
")"); do { *((volatile int*)__null) = 1773; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
1774 } \
1775 JS_END_MACRO} while (0)
1776#else
1777# define ASSERT_UNINITIALIZED_ALIASED_LEXICAL(val)do { if (IsUninitializedLexical(val)) { JSOp next = JSOp(*GetNextPc
((activation.regs()).pc)); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(next == JSOp::CheckThis ||
next == JSOp::CheckReturn || next == JSOp::CheckThisReinit ||
next == JSOp::CheckAliasedLexical)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(next == JSOp::CheckThis || next
== JSOp::CheckReturn || next == JSOp::CheckThisReinit || next
== JSOp::CheckAliasedLexical))), 0))) { do { } while (false)
; MOZ_ReportAssertionFailure("next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1777); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
")"); do { *((volatile int*)__null) = 1777; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
0)
\
1778 JS_BEGIN_MACROdo { \
1779 /* nothing */ \
1780 JS_END_MACRO} while (0)
1781#endif
1782
1783 gc::MaybeVerifyBarriers(cx, true);
1784
1785 InterpreterFrame* entryFrame = state.pushInterpreterFrame(cx);
1786 if (!entryFrame) {
1787 return false;
1788 }
1789
1790 ActivationEntryMonitor entryMonitor(cx, entryFrame);
1791 InterpreterActivation activation(state, cx, entryFrame);
1792
1793 /* The script is used frequently, so keep a local copy. */
1794 RootedScript script(cx);
1795 SET_SCRIPT(REGS.fp()->script())do { script = ((activation.regs()).fp()->script()); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(cx->
realm() == script->realm())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->realm() == script->
realm()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cx->realm() == script->realm()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1795); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == script->realm()"
")"); do { *((volatile int*)__null) = 1795; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); if (DebugAPI
::hasAnyBreakpointsOrStepMode(script) || script->hasScriptCounts
()) activation.enableInterruptsUnconditionally(); } while (0)
;
1796
1797 /*
1798 * Pool of rooters for use in this interpreter frame. References to these
1799 * are used for local variables within interpreter cases. This avoids
1800 * creating new rooters each time an interpreter case is entered, and also
1801 * correctness pitfalls due to incorrect compilation of destructor calls
1802 * around computed gotos.
1803 */
1804 RootedValue rootValue0(cx), rootValue1(cx);
1805 RootedObject rootObject0(cx), rootObject1(cx);
1806 RootedFunction rootFunction0(cx);
1807 Rooted<JSAtom*> rootAtom0(cx);
1808 Rooted<PropertyName*> rootName0(cx);
1809 RootedId rootId0(cx);
1810 RootedScript rootScript0(cx);
1811 Rooted<Scope*> rootScope0(cx);
1812 DebugOnly<uint32_t> blockDepth;
1813
1814 /* State communicated between non-local jumps: */
1815 bool interpReturnOK;
1816 bool frameHalfInitialized;
1817
1818 if (!activation.entryFrame()->prologue(cx)) {
1819 goto prologue_error;
1820 }
1821
1822 if (!DebugAPI::onEnterFrame(cx, activation.entryFrame())) {
1823 goto error;
1824 }
1825
1826 // Increment the coverage for the main entry point.
1827 INIT_COVERAGE()do { if (!script->hasScriptCounts()) { if (cx->realm()->
collectCoverageForDebug()) { if (!script->initScriptCounts
(cx)) goto error; } } } while (0)
;
1828 COUNT_COVERAGE_MAIN()do { jsbytecode* main = script->main(); if (!BytecodeIsJumpTarget
(JSOp(*main))) do { if (script->hasScriptCounts()) { PCCounts
* counts = script->maybeGetPCCounts(main); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(counts)
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(counts))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1828); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1828; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0); } while (0)
;
1829
1830 // Enter the interpreter loop starting at the current pc.
1831 ADVANCE_AND_DISPATCH(0)do { (activation.regs()).pc += (0); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
1832
1833 INTERPRETER_LOOP() {
1834 CASE(EnableInterruptsPseudoOpcode)label_EnableInterruptsPseudoOpcode: {
1835 bool moreInterrupts = false;
1836 jsbytecode op = *REGS(activation.regs()).pc;
1837
1838 if (!script->hasScriptCounts() &&
1839 cx->realm()->collectCoverageForDebug()) {
1840 if (!script->initScriptCounts(cx)) {
1841 goto error;
1842 }
1843 }
1844
1845 if (script->isDebuggee()) {
1846 if (DebugAPI::stepModeEnabled(script)) {
1847 if (!DebugAPI::onSingleStep(cx)) {
1848 goto error;
1849 }
1850 moreInterrupts = true;
1851 }
1852
1853 if (DebugAPI::hasAnyBreakpointsOrStepMode(script)) {
1854 moreInterrupts = true;
1855 }
1856
1857 if (DebugAPI::hasBreakpointsAt(script, REGS(activation.regs()).pc)) {
1858 if (!DebugAPI::onTrap(cx)) {
1859 goto error;
1860 }
1861 }
1862 }
1863
1864 MOZ_ASSERT(activation.opMask() == EnableInterruptsPseudoOpcode)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(activation.opMask() == EnableInterruptsPseudoOpcode)
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(activation.opMask() == EnableInterruptsPseudoOpcode)
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("activation.opMask() == EnableInterruptsPseudoOpcode"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1864); AnnotateMozCrashReason("MOZ_ASSERT" "(" "activation.opMask() == EnableInterruptsPseudoOpcode"
")"); do { *((volatile int*)__null) = 1864; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1865 if (!moreInterrupts) {
1866 activation.clearInterruptsMask();
1867 }
1868
1869 /* Commence executing the actual opcode. */
1870 SANITY_CHECKS()do { js::gc::MaybeVerifyBarriers(cx); } while (0);
1871 DISPATCH_TO(op)goto* addresses[(op)];
1872 }
1873
1874 /* Various 1-byte no-ops. */
1875 CASE(Nop)label_Nop:
1876 CASE(Try)label_Try:
1877 CASE(NopDestructuring)label_NopDestructuring:
1878 CASE(NopIsAssignOp)label_NopIsAssignOp:
1879 CASE(TryDestructuring)label_TryDestructuring: {
1880 MOZ_ASSERT(GetBytecodeLength(REGS.pc) == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(GetBytecodeLength((activation.regs()).pc) == 1)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1880); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 1880; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1881 ADVANCE_AND_DISPATCH(1)do { (activation.regs()).pc += (1); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
1882 }
1883
1884 CASE(JumpTarget)label_JumpTarget:
1885 COUNT_COVERAGE()do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc)))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1885); AnnotateMozCrashReason("MOZ_ASSERT" "(" "BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
")"); do { *((volatile int*)__null) = 1885; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { if (script
->hasScriptCounts()) { PCCounts* counts = script->maybeGetPCCounts
((activation.regs()).pc); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(counts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(counts))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1885); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1885; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0); } while (0)
;
1886 END_CASE(JumpTarget)do { (activation.regs()).pc += (JSOpLength_JumpTarget); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
1887
1888 CASE(LoopHead)label_LoopHead: {
1889 COUNT_COVERAGE()do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc)))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1889); AnnotateMozCrashReason("MOZ_ASSERT" "(" "BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
")"); do { *((volatile int*)__null) = 1889; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { if (script
->hasScriptCounts()) { PCCounts* counts = script->maybeGetPCCounts
((activation.regs()).pc); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(counts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(counts))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1889); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 1889; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0); } while (0)
;
1890
1891 // Attempt on-stack replacement into the Baseline Interpreter.
1892 if (jit::IsBaselineInterpreterEnabled()) {
1893 script->incWarmUpCounter();
1894
1895 jit::MethodStatus status =
1896 jit::CanEnterBaselineInterpreterAtBranch(cx, REGS(activation.regs()).fp());
1897 if (status == jit::Method_Error) {
1898 goto error;
1899 }
1900 if (status == jit::Method_Compiled) {
1901 bool wasProfiler = REGS(activation.regs()).fp()->hasPushedGeckoProfilerFrame();
1902
1903 jit::JitExecStatus maybeOsr;
1904 {
1905 GeckoProfilerBaselineOSRMarker osr(cx, wasProfiler);
1906 maybeOsr =
1907 jit::EnterBaselineInterpreterAtBranch(cx, REGS(activation.regs()).fp(), REGS(activation.regs()).pc);
1908 }
1909
1910 // We failed to call into baseline at all, so treat as an error.
1911 if (maybeOsr == jit::JitExec_Aborted) {
1912 goto error;
1913 }
1914
1915 interpReturnOK = (maybeOsr == jit::JitExec_Ok);
1916
1917 // Pop the profiler frame pushed by the interpreter. (The compiled
1918 // version of the function popped a copy of the frame pushed by the
1919 // OSR trampoline.)
1920 if (wasProfiler) {
1921 cx->geckoProfiler().exit(cx, script);
1922 }
1923
1924 if (activation.entryFrame() != REGS(activation.regs()).fp()) {
1925 goto jit_return_pop_frame;
1926 }
1927 goto leave_on_safe_point;
1928 }
1929 }
1930 }
1931 END_CASE(LoopHead)do { (activation.regs()).pc += (JSOpLength_LoopHead); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
1932
1933 CASE(Lineno)label_Lineno:
1934 END_CASE(Lineno)do { (activation.regs()).pc += (JSOpLength_Lineno); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
1935
1936 CASE(ForceInterpreter)label_ForceInterpreter: {
1937 // Ensure pattern matching still works.
1938 MOZ_ASSERT(script->hasForceInterpreterOp())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(script->hasForceInterpreterOp())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(script->hasForceInterpreterOp
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("script->hasForceInterpreterOp()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1938); AnnotateMozCrashReason("MOZ_ASSERT" "(" "script->hasForceInterpreterOp()"
")"); do { *((volatile int*)__null) = 1938; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1939 }
1940 END_CASE(ForceInterpreter)do { (activation.regs()).pc += (JSOpLength_ForceInterpreter);
do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
1941
1942 CASE(Undefined)label_Undefined: { PUSH_UNDEFINED()(activation.regs()).sp++->setUndefined(); }
1943 END_CASE(Undefined)do { (activation.regs()).pc += (JSOpLength_Undefined); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
1944
1945 CASE(Pop)label_Pop: { REGS(activation.regs()).sp--; }
1946 END_CASE(Pop)do { (activation.regs()).pc += (JSOpLength_Pop); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
1947
1948 CASE(PopN)label_PopN: {
1949 MOZ_ASSERT(GET_UINT16(REGS.pc) <= REGS.stackDepth())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(GET_UINT16((activation.regs()).pc) <= (activation
.regs()).stackDepth())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(GET_UINT16((activation.regs(
)).pc) <= (activation.regs()).stackDepth()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("GET_UINT16((activation.regs()).pc) <= (activation.regs()).stackDepth()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1949); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GET_UINT16((activation.regs()).pc) <= (activation.regs()).stackDepth()"
")"); do { *((volatile int*)__null) = 1949; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1950 REGS(activation.regs()).sp -= GET_UINT16(REGS(activation.regs()).pc);
1951 }
1952 END_CASE(PopN)do { (activation.regs()).pc += (JSOpLength_PopN); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
1953
1954 CASE(DupAt)label_DupAt: {
1955 MOZ_ASSERT(GET_UINT24(REGS.pc) < REGS.stackDepth())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(GET_UINT24((activation.regs()).pc) < (activation.
regs()).stackDepth())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(GET_UINT24((activation.regs(
)).pc) < (activation.regs()).stackDepth()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("GET_UINT24((activation.regs()).pc) < (activation.regs()).stackDepth()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 1955); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GET_UINT24((activation.regs()).pc) < (activation.regs()).stackDepth()"
")"); do { *((volatile int*)__null) = 1955; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
1956 unsigned i = GET_UINT24(REGS(activation.regs()).pc);
1957 const Value& rref = REGS(activation.regs()).sp[-int(i + 1)];
1958 PUSH_COPY(rref)do { *(activation.regs()).sp++ = (rref); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
1959 }
1960 END_CASE(DupAt)do { (activation.regs()).pc += (JSOpLength_DupAt); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
1961
1962 CASE(SetRval)label_SetRval: { POP_RETURN_VALUE()(activation.regs()).fp()->setReturnValue(*--(activation.regs
()).sp)
; }
1963 END_CASE(SetRval)do { (activation.regs()).pc += (JSOpLength_SetRval); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
1964
1965 CASE(GetRval)label_GetRval: { PUSH_COPY(REGS.fp()->returnValue())do { *(activation.regs()).sp++ = ((activation.regs()).fp()->
returnValue()); cx->debugOnlyCheck((activation.regs()).sp[
-1]); } while (0)
; }
1966 END_CASE(GetRval)do { (activation.regs()).pc += (JSOpLength_GetRval); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
1967
1968 CASE(EnterWith)label_EnterWith: {
1969 ReservedRooted<Value> val(&rootValue0, REGS(activation.regs()).sp[-1]);
1970 REGS(activation.regs()).sp--;
1971 ReservedRooted<Scope*> scope(&rootScope0, script->getScope(REGS(activation.regs()).pc));
1972
1973 if (!EnterWithOperation(cx, REGS(activation.regs()).fp(), val, scope.as<WithScope>())) {
1974 goto error;
1975 }
1976 }
1977 END_CASE(EnterWith)do { (activation.regs()).pc += (JSOpLength_EnterWith); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
1978
1979 CASE(LeaveWith)label_LeaveWith: {
1980 REGS(activation.regs()).fp()->popOffEnvironmentChain<WithEnvironmentObject>();
1981 }
1982 END_CASE(LeaveWith)do { (activation.regs()).pc += (JSOpLength_LeaveWith); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
1983
1984 CASE(Return)label_Return: {
1985 POP_RETURN_VALUE()(activation.regs()).fp()->setReturnValue(*--(activation.regs
()).sp)
;
1986 /* FALL THROUGH */
1987 }
1988 CASE(RetRval)label_RetRval: {
1989 /*
1990 * When the inlined frame exits with an exception or an error, ok will be
1991 * false after the inline_return label.
1992 */
1993 CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0);
1994
1995 successful_return_continuation:
1996 interpReturnOK = true;
1997
1998 return_continuation:
1999 frameHalfInitialized = false;
2000
2001 prologue_return_continuation:
2002
2003 if (activation.entryFrame() != REGS(activation.regs()).fp()) {
2004 // Stop the engine. (No details about which engine exactly, could be
2005 // interpreter, Baseline or IonMonkey.)
2006 if (MOZ_LIKELY(!frameHalfInitialized)(__builtin_expect(!!(!frameHalfInitialized), 1))) {
2007 interpReturnOK =
2008 DebugAPI::onLeaveFrame(cx, REGS(activation.regs()).fp(), REGS(activation.regs()).pc, interpReturnOK);
2009
2010 REGS(activation.regs()).fp()->epilogue(cx, REGS(activation.regs()).pc);
2011 }
2012
2013 jit_return_pop_frame:
2014
2015 activation.popInlineFrame(REGS(activation.regs()).fp());
2016 {
2017 JSScript* callerScript = REGS(activation.regs()).fp()->script();
2018 if (cx->realm() != callerScript->realm()) {
2019 cx->leaveRealm(callerScript->realm());
2020 }
2021 SET_SCRIPT(callerScript)do { script = (callerScript); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(cx->realm() == script
->realm())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(cx->realm() == script->realm
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cx->realm() == script->realm()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2021); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == script->realm()"
")"); do { *((volatile int*)__null) = 2021; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); if (DebugAPI
::hasAnyBreakpointsOrStepMode(script) || script->hasScriptCounts
()) activation.enableInterruptsUnconditionally(); } while (0)
;
2022 }
2023
2024 jit_return:
2025
2026 MOZ_ASSERT(IsInvokePC(REGS.pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(IsInvokePC((activation.regs()).pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(IsInvokePC((activation.regs(
)).pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("IsInvokePC((activation.regs()).pc)", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2026); AnnotateMozCrashReason("MOZ_ASSERT" "(" "IsInvokePC((activation.regs()).pc)"
")"); do { *((volatile int*)__null) = 2026; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2027 MOZ_ASSERT(cx->realm() == script->realm())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->realm() == script->realm())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->realm() == script->
realm()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cx->realm() == script->realm()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2027); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == script->realm()"
")"); do { *((volatile int*)__null) = 2027; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2028
2029 /* Resume execution in the calling frame. */
2030 if (MOZ_LIKELY(interpReturnOK)(__builtin_expect(!!(interpReturnOK), 1))) {
2031 if (JSOp(*REGS(activation.regs()).pc) == JSOp::Resume) {
2032 ADVANCE_AND_DISPATCH(JSOpLength_Resume)do { (activation.regs()).pc += (JSOpLength_Resume); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0)
;
2033 }
2034
2035 MOZ_ASSERT(GetBytecodeLength(REGS.pc) == JSOpLength_Call)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(GetBytecodeLength((activation.regs()).pc) == JSOpLength_Call
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == JSOpLength_Call
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"GetBytecodeLength((activation.regs()).pc) == JSOpLength_Call"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2035); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == JSOpLength_Call"
")"); do { *((volatile int*)__null) = 2035; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2036 ADVANCE_AND_DISPATCH(JSOpLength_Call)do { (activation.regs()).pc += (JSOpLength_Call); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0)
;
2037 }
2038
2039 goto error;
2040 } else {
2041 // Stack should be empty for the outer frame, unless we executed the
2042 // first |await| expression in an async function.
2043 MOZ_ASSERT(REGS.stackDepth() == 0 ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() == 0 || (JSOp(*(activation
.regs()).pc) == JSOp::Await && !(activation.regs()).fp
()->isResumedGenerator()))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!((activation.regs()).stackDepth
() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await &&
!(activation.regs()).fp()->isResumedGenerator())))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await && !(activation.regs()).fp()->isResumedGenerator())"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2045); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await && !(activation.regs()).fp()->isResumedGenerator())"
")"); do { *((volatile int*)__null) = 2045; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2044 (JSOp(*REGS.pc) == JSOp::Await &&do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() == 0 || (JSOp(*(activation
.regs()).pc) == JSOp::Await && !(activation.regs()).fp
()->isResumedGenerator()))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!((activation.regs()).stackDepth
() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await &&
!(activation.regs()).fp()->isResumedGenerator())))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await && !(activation.regs()).fp()->isResumedGenerator())"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2045); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await && !(activation.regs()).fp()->isResumedGenerator())"
")"); do { *((volatile int*)__null) = 2045; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
2045 !REGS.fp()->isResumedGenerator()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() == 0 || (JSOp(*(activation
.regs()).pc) == JSOp::Await && !(activation.regs()).fp
()->isResumedGenerator()))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!((activation.regs()).stackDepth
() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await &&
!(activation.regs()).fp()->isResumedGenerator())))), 0)))
{ do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await && !(activation.regs()).fp()->isResumedGenerator())"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2045); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() == 0 || (JSOp(*(activation.regs()).pc) == JSOp::Await && !(activation.regs()).fp()->isResumedGenerator())"
")"); do { *((volatile int*)__null) = 2045; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2046 }
2047 goto exit;
2048 }
2049
2050 CASE(Default)label_Default: {
2051 REGS(activation.regs()).sp--;
2052 /* FALL THROUGH */
2053 }
2054 CASE(Goto)label_Goto: { BRANCH(GET_JUMP_OFFSET(REGS.pc))do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc))
; if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0)
; }
2055
2056 CASE(JumpIfFalse)label_JumpIfFalse: {
2057 bool cond = ToBoolean(REGS(activation.regs()).stackHandleAt(-1));
2058 REGS(activation.regs()).sp--;
2059 if (!cond) {
2060 BRANCH(GET_JUMP_OFFSET(REGS.pc))do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc))
; if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0)
;
2061 }
2062 }
2063 END_CASE(JumpIfFalse)do { (activation.regs()).pc += (JSOpLength_JumpIfFalse); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2064
2065 CASE(JumpIfTrue)label_JumpIfTrue: {
2066 bool cond = ToBoolean(REGS(activation.regs()).stackHandleAt(-1));
2067 REGS(activation.regs()).sp--;
2068 if (cond) {
2069 BRANCH(GET_JUMP_OFFSET(REGS.pc))do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc))
; if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0)
;
2070 }
2071 }
2072 END_CASE(JumpIfTrue)do { (activation.regs()).pc += (JSOpLength_JumpIfTrue); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2073
2074 CASE(Or)label_Or: {
2075 bool cond = ToBoolean(REGS(activation.regs()).stackHandleAt(-1));
2076 if (cond) {
2077 ADVANCE_AND_DISPATCH(GET_JUMP_OFFSET(REGS.pc))do { (activation.regs()).pc += (GET_JUMP_OFFSET((activation.regs
()).pc)); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto
* addresses[(*(activation.regs()).pc | activation.opMask())];
} while (0)
;
2078 }
2079 }
2080 END_CASE(Or)do { (activation.regs()).pc += (JSOpLength_Or); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2081
2082 CASE(Coalesce)label_Coalesce: {
2083 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-1);
2084 bool cond = !res.isNullOrUndefined();
2085 if (cond) {
2086 ADVANCE_AND_DISPATCH(GET_JUMP_OFFSET(REGS.pc))do { (activation.regs()).pc += (GET_JUMP_OFFSET((activation.regs
()).pc)); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto
* addresses[(*(activation.regs()).pc | activation.opMask())];
} while (0)
;
2087 }
2088 }
2089 END_CASE(Coalesce)do { (activation.regs()).pc += (JSOpLength_Coalesce); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2090
2091 CASE(And)label_And: {
2092 bool cond = ToBoolean(REGS(activation.regs()).stackHandleAt(-1));
2093 if (!cond) {
2094 ADVANCE_AND_DISPATCH(GET_JUMP_OFFSET(REGS.pc))do { (activation.regs()).pc += (GET_JUMP_OFFSET((activation.regs
()).pc)); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto
* addresses[(*(activation.regs()).pc | activation.opMask())];
} while (0)
;
2095 }
2096 }
2097 END_CASE(And)do { (activation.regs()).pc += (JSOpLength_And); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2098
2099#define FETCH_ELEMENT_ID(n, id)do { if (!ToPropertyKey(cx, (activation.regs()).stackHandleAt
(n), &(id))) goto error; } while (0)
\
2100 JS_BEGIN_MACROdo { \
2101 if (!ToPropertyKey(cx, REGS(activation.regs()).stackHandleAt(n), &(id))) goto error; \
2102 JS_END_MACRO} while (0)
2103
2104#define TRY_BRANCH_AFTER_COND(cond, spdec)do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(GetBytecodeLength((activation.regs()).pc) == 1)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2104); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 2104; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); unsigned diff_
= (unsigned)GET_UINT8((activation.regs()).pc) - (unsigned)JSOp
::JumpIfFalse; if (diff_ <= 1) { (activation.regs()).sp -=
(spdec); if ((cond) == (diff_ != 0)) { ++(activation.regs())
.pc; do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs())
.pc)); if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto
error; } while (0); do { (activation.regs()).pc += (nlen); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
); } while (0); } do { (activation.regs()).pc += (1 + JSOpLength_JumpIfFalse
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
); } } while (0)
\
2105 JS_BEGIN_MACROdo { \
2106 MOZ_ASSERT(GetBytecodeLength(REGS.pc) == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(GetBytecodeLength((activation.regs()).pc) == 1)>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2106); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 2106; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
; \
2107 unsigned diff_ = \
2108 (unsigned)GET_UINT8(REGS(activation.regs()).pc) - (unsigned)JSOp::JumpIfFalse; \
2109 if (diff_ <= 1) { \
2110 REGS(activation.regs()).sp -= (spdec); \
2111 if ((cond) == (diff_ != 0)) { \
2112 ++REGS(activation.regs()).pc; \
2113 BRANCH(GET_JUMP_OFFSET(REGS.pc))do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc))
; if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0)
; \
2114 } \
2115 ADVANCE_AND_DISPATCH(1 + JSOpLength_JumpIfFalse)do { (activation.regs()).pc += (1 + JSOpLength_JumpIfFalse); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
)
; \
2116 } \
2117 JS_END_MACRO} while (0)
2118
2119 CASE(In)label_In: {
2120 HandleValue rref = REGS(activation.regs()).stackHandleAt(-1);
2121 if (!rref.isObject()) {
2122 HandleValue lref = REGS(activation.regs()).stackHandleAt(-2);
2123 ReportInNotObjectError(cx, lref, rref);
2124 goto error;
2125 }
2126 bool found;
2127 {
2128 ReservedRooted<JSObject*> obj(&rootObject0, &rref.toObject());
2129 ReservedRooted<jsid> id(&rootId0);
2130 FETCH_ELEMENT_ID(-2, id)do { if (!ToPropertyKey(cx, (activation.regs()).stackHandleAt
(-2), &(id))) goto error; } while (0)
;
2131 if (!HasProperty(cx, obj, id, &found)) {
2132 goto error;
2133 }
2134 }
2135 TRY_BRANCH_AFTER_COND(found, 2)do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(GetBytecodeLength((activation.regs()).pc) == 1)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2135); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 2135; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); unsigned diff_
= (unsigned)GET_UINT8((activation.regs()).pc) - (unsigned)JSOp
::JumpIfFalse; if (diff_ <= 1) { (activation.regs()).sp -=
(2); if ((found) == (diff_ != 0)) { ++(activation.regs()).pc
; do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc
)); if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0); } do { (activation.regs()).pc += (1 + JSOpLength_JumpIfFalse
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
); } } while (0)
;
2136 REGS(activation.regs()).sp--;
2137 REGS(activation.regs()).sp[-1].setBoolean(found);
2138 }
2139 END_CASE(In)do { (activation.regs()).pc += (JSOpLength_In); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2140
2141 CASE(HasOwn)label_HasOwn: {
2142 HandleValue val = REGS(activation.regs()).stackHandleAt(-1);
2143 HandleValue idval = REGS(activation.regs()).stackHandleAt(-2);
2144
2145 bool found;
2146 if (!HasOwnProperty(cx, val, idval, &found)) {
2147 goto error;
2148 }
2149
2150 REGS(activation.regs()).sp--;
2151 REGS(activation.regs()).sp[-1].setBoolean(found);
2152 }
2153 END_CASE(HasOwn)do { (activation.regs()).pc += (JSOpLength_HasOwn); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2154
2155 CASE(CheckPrivateField)label_CheckPrivateField: {
2156 /* Load the object being initialized into lval/val. */
2157 HandleValue val = REGS(activation.regs()).stackHandleAt(-2);
2158 HandleValue idval = REGS(activation.regs()).stackHandleAt(-1);
2159
2160 bool result = false;
2161 if (!CheckPrivateFieldOperation(cx, REGS(activation.regs()).pc, val, idval, &result)) {
2162 goto error;
2163 }
2164
2165 PUSH_BOOLEAN(result)(activation.regs()).sp++->setBoolean(result);
2166 }
2167 END_CASE(CheckPrivateField)do { (activation.regs()).pc += (JSOpLength_CheckPrivateField)
; do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2168
2169 CASE(NewPrivateName)label_NewPrivateName: {
2170 ReservedRooted<JSAtom*> name(&rootAtom0, script->getAtom(REGS(activation.regs()).pc));
2171
2172 auto* symbol = NewPrivateName(cx, name);
2173 if (!symbol) {
2174 goto error;
2175 }
2176
2177 PUSH_SYMBOL(symbol)(activation.regs()).sp++->setSymbol(symbol);
2178 }
2179 END_CASE(NewPrivateName)do { (activation.regs()).pc += (JSOpLength_NewPrivateName); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2180
2181 CASE(IsNullOrUndefined)label_IsNullOrUndefined: {
2182 bool b = REGS(activation.regs()).sp[-1].isNullOrUndefined();
2183 PUSH_BOOLEAN(b)(activation.regs()).sp++->setBoolean(b);
2184 }
2185 END_CASE(IsNullOrUndefined)do { (activation.regs()).pc += (JSOpLength_IsNullOrUndefined)
; do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2186
2187 CASE(Iter)label_Iter: {
2188 MOZ_ASSERT(REGS.stackDepth() >= 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 1))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2188); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 1"
")"); do { *((volatile int*)__null) = 2188; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2189 HandleValue val = REGS(activation.regs()).stackHandleAt(-1);
2190 JSObject* iter = ValueToIterator(cx, val);
2191 if (!iter) {
2192 goto error;
2193 }
2194 REGS(activation.regs()).sp[-1].setObject(*iter);
2195 }
2196 END_CASE(Iter)do { (activation.regs()).pc += (JSOpLength_Iter); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2197
2198 CASE(MoreIter)label_MoreIter: {
2199 MOZ_ASSERT(REGS.stackDepth() >= 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 1))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2199); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 1"
")"); do { *((volatile int*)__null) = 2199; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2200 MOZ_ASSERT(REGS.sp[-1].isObject())do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).sp[-1].isObject())>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!((activation.regs()).sp[-1].isObject()))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("(activation.regs()).sp[-1].isObject()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2200); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).sp[-1].isObject()"
")"); do { *((volatile int*)__null) = 2200; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2201 Value v = IteratorMore(&REGS(activation.regs()).sp[-1].toObject());
2202 PUSH_COPY(v)do { *(activation.regs()).sp++ = (v); cx->debugOnlyCheck((
activation.regs()).sp[-1]); } while (0)
;
2203 }
2204 END_CASE(MoreIter)do { (activation.regs()).pc += (JSOpLength_MoreIter); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2205
2206 CASE(IsNoIter)label_IsNoIter: {
2207 bool b = REGS(activation.regs()).sp[-1].isMagic(JS_NO_ITER_VALUE);
2208 PUSH_BOOLEAN(b)(activation.regs()).sp++->setBoolean(b);
2209 }
2210 END_CASE(IsNoIter)do { (activation.regs()).pc += (JSOpLength_IsNoIter); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2211
2212 CASE(EndIter)label_EndIter: {
2213 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2213); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 2213; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2214 CloseIterator(&REGS(activation.regs()).sp[-2].toObject());
2215 REGS(activation.regs()).sp -= 2;
2216 }
2217 END_CASE(EndIter)do { (activation.regs()).pc += (JSOpLength_EndIter); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2218
2219 CASE(CloseIter)label_CloseIter: {
2220 ReservedRooted<JSObject*> iter(&rootObject0, &REGS(activation.regs()).sp[-1].toObject());
2221 CompletionKind kind = CompletionKind(GET_UINT8(REGS(activation.regs()).pc));
2222 if (!CloseIterOperation(cx, iter, kind)) {
2223 goto error;
2224 }
2225 REGS(activation.regs()).sp--;
2226 }
2227 END_CASE(CloseIter)do { (activation.regs()).pc += (JSOpLength_CloseIter); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2228
2229 CASE(OptimizeGetIterator)label_OptimizeGetIterator: {
2230 ReservedRooted<Value> val(&rootValue0, REGS(activation.regs()).sp[-1]);
2231 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2232 bool result;
2233 if (!OptimizeGetIterator(cx, val, &result)) {
2234 goto error;
2235 }
2236 rval.setBoolean(result);
2237 }
2238 END_CASE(OptimizeGetIterator)do { (activation.regs()).pc += (JSOpLength_OptimizeGetIterator
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2239
2240 CASE(IsGenClosing)label_IsGenClosing: {
2241 bool b = REGS(activation.regs()).sp[-1].isMagic(JS_GENERATOR_CLOSING);
2242 PUSH_BOOLEAN(b)(activation.regs()).sp++->setBoolean(b);
2243 }
2244 END_CASE(IsGenClosing)do { (activation.regs()).pc += (JSOpLength_IsGenClosing); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2245
2246 CASE(Dup)label_Dup: {
2247 MOZ_ASSERT(REGS.stackDepth() >= 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 1))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2247); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 1"
")"); do { *((volatile int*)__null) = 2247; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2248 const Value& rref = REGS(activation.regs()).sp[-1];
2249 PUSH_COPY(rref)do { *(activation.regs()).sp++ = (rref); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
2250 }
2251 END_CASE(Dup)do { (activation.regs()).pc += (JSOpLength_Dup); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2252
2253 CASE(Dup2)label_Dup2: {
2254 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2254); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 2254; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2255 const Value& lref = REGS(activation.regs()).sp[-2];
2256 const Value& rref = REGS(activation.regs()).sp[-1];
2257 PUSH_COPY(lref)do { *(activation.regs()).sp++ = (lref); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
2258 PUSH_COPY(rref)do { *(activation.regs()).sp++ = (rref); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
2259 }
2260 END_CASE(Dup2)do { (activation.regs()).pc += (JSOpLength_Dup2); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2261
2262 CASE(Swap)label_Swap: {
2263 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2263); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 2263; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2264 Value& lref = REGS(activation.regs()).sp[-2];
2265 Value& rref = REGS(activation.regs()).sp[-1];
2266 lref.swap(rref);
2267 }
2268 END_CASE(Swap)do { (activation.regs()).pc += (JSOpLength_Swap); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2269
2270 CASE(Pick)label_Pick: {
2271 unsigned i = GET_UINT8(REGS(activation.regs()).pc);
2272 MOZ_ASSERT(REGS.stackDepth() >= i + 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= i + 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= i + 1))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= i + 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2272); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= i + 1"
")"); do { *((volatile int*)__null) = 2272; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2273 Value lval = REGS(activation.regs()).sp[-int(i + 1)];
2274 memmove(REGS(activation.regs()).sp - (i + 1), REGS(activation.regs()).sp - i, sizeof(Value) * i);
2275 REGS(activation.regs()).sp[-1] = lval;
2276 }
2277 END_CASE(Pick)do { (activation.regs()).pc += (JSOpLength_Pick); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2278
2279 CASE(Unpick)label_Unpick: {
2280 int i = GET_UINT8(REGS(activation.regs()).pc);
2281 MOZ_ASSERT(REGS.stackDepth() >= unsigned(i) + 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= unsigned(i) +
1)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).stackDepth() >= unsigned(i) +
1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("(activation.regs()).stackDepth() >= unsigned(i) + 1", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2281); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= unsigned(i) + 1"
")"); do { *((volatile int*)__null) = 2281; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2282 Value lval = REGS(activation.regs()).sp[-1];
2283 memmove(REGS(activation.regs()).sp - i, REGS(activation.regs()).sp - (i + 1), sizeof(Value) * i);
2284 REGS(activation.regs()).sp[-(i + 1)] = lval;
2285 }
2286 END_CASE(Unpick)do { (activation.regs()).pc += (JSOpLength_Unpick); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2287
2288 CASE(BindGName)label_BindGName:
2289 CASE(BindName)label_BindName: {
2290 JSOp op = JSOp(*REGS(activation.regs()).pc);
2291 ReservedRooted<JSObject*> envChain(&rootObject0);
2292 if (op == JSOp::BindName) {
2293 envChain.set(REGS(activation.regs()).fp()->environmentChain());
2294 } else {
2295 MOZ_ASSERT(!script->hasNonSyntacticScope())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!script->hasNonSyntacticScope())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!script->hasNonSyntacticScope
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!script->hasNonSyntacticScope()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2295); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!script->hasNonSyntacticScope()"
")"); do { *((volatile int*)__null) = 2295; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2296 envChain.set(&REGS(activation.regs()).fp()->global().lexicalEnvironment());
2297 }
2298 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
2299
2300 // Assigning to an undeclared name adds a property to the global object.
2301 ReservedRooted<JSObject*> env(&rootObject1);
2302 if (!LookupNameUnqualified(cx, name, envChain, &env)) {
2303 goto error;
2304 }
2305
2306 PUSH_OBJECT(*env)do { (activation.regs()).sp++->setObject(*env); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
2307
2308 static_assert(JSOpLength_BindName == JSOpLength_BindGName,
2309 "We're sharing the END_CASE so the lengths better match");
2310 }
2311 END_CASE(BindName)do { (activation.regs()).pc += (JSOpLength_BindName); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2312
2313 CASE(BindVar)label_BindVar: {
2314 JSObject* varObj = BindVarOperation(cx, REGS(activation.regs()).fp()->environmentChain());
2315 PUSH_OBJECT(*varObj)do { (activation.regs()).sp++->setObject(*varObj); cx->
debugOnlyCheck((activation.regs()).sp[-1]); } while (0)
;
2316 }
2317 END_CASE(BindVar)do { (activation.regs()).pc += (JSOpLength_BindVar); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2318
2319 CASE(BitOr)label_BitOr: {
2320 MutableHandleValue lhs = REGS(activation.regs()).stackHandleAt(-2);
2321 MutableHandleValue rhs = REGS(activation.regs()).stackHandleAt(-1);
2322 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2323 if (!BitOrOperation(cx, lhs, rhs, res)) {
2324 goto error;
2325 }
2326 REGS(activation.regs()).sp--;
2327 }
2328 END_CASE(BitOr)do { (activation.regs()).pc += (JSOpLength_BitOr); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2329
2330 CASE(BitXor)label_BitXor: {
2331 MutableHandleValue lhs = REGS(activation.regs()).stackHandleAt(-2);
2332 MutableHandleValue rhs = REGS(activation.regs()).stackHandleAt(-1);
2333 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2334 if (!BitXorOperation(cx, lhs, rhs, res)) {
2335 goto error;
2336 }
2337 REGS(activation.regs()).sp--;
2338 }
2339 END_CASE(BitXor)do { (activation.regs()).pc += (JSOpLength_BitXor); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2340
2341 CASE(BitAnd)label_BitAnd: {
2342 MutableHandleValue lhs = REGS(activation.regs()).stackHandleAt(-2);
2343 MutableHandleValue rhs = REGS(activation.regs()).stackHandleAt(-1);
2344 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2345 if (!BitAndOperation(cx, lhs, rhs, res)) {
2346 goto error;
2347 }
2348 REGS(activation.regs()).sp--;
2349 }
2350 END_CASE(BitAnd)do { (activation.regs()).pc += (JSOpLength_BitAnd); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2351
2352 CASE(Eq)label_Eq: {
2353 if (!LooseEqualityOp<true>(cx, REGS(activation.regs()))) {
2354 goto error;
2355 }
2356 }
2357 END_CASE(Eq)do { (activation.regs()).pc += (JSOpLength_Eq); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2358
2359 CASE(Ne)label_Ne: {
2360 if (!LooseEqualityOp<false>(cx, REGS(activation.regs()))) {
2361 goto error;
2362 }
2363 }
2364 END_CASE(Ne)do { (activation.regs()).pc += (JSOpLength_Ne); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2365
2366#define STRICT_EQUALITY_OP(OP, COND) \
2367 JS_BEGIN_MACROdo { \
2368 HandleValue lval = REGS(activation.regs()).stackHandleAt(-2); \
2369 HandleValue rval = REGS(activation.regs()).stackHandleAt(-1); \
2370 bool equal; \
2371 if (!js::StrictlyEqual(cx, lval, rval, &equal)) { \
2372 goto error; \
2373 } \
2374 (COND) = equal OP true; \
2375 REGS(activation.regs()).sp--; \
2376 JS_END_MACRO} while (0)
2377
2378 CASE(StrictEq)label_StrictEq: {
2379 bool cond;
2380 STRICT_EQUALITY_OP(==, cond);
2381 REGS(activation.regs()).sp[-1].setBoolean(cond);
2382 }
2383 END_CASE(StrictEq)do { (activation.regs()).pc += (JSOpLength_StrictEq); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2384
2385 CASE(StrictNe)label_StrictNe: {
2386 bool cond;
2387 STRICT_EQUALITY_OP(!=, cond);
2388 REGS(activation.regs()).sp[-1].setBoolean(cond);
2389 }
2390 END_CASE(StrictNe)do { (activation.regs()).pc += (JSOpLength_StrictNe); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2391
2392#undef STRICT_EQUALITY_OP
2393
2394 CASE(Case)label_Case: {
2395 bool cond = REGS(activation.regs()).sp[-1].toBoolean();
2396 REGS(activation.regs()).sp--;
2397 if (cond) {
2398 REGS(activation.regs()).sp--;
2399 BRANCH(GET_JUMP_OFFSET(REGS.pc))do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc))
; if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0)
;
2400 }
2401 }
2402 END_CASE(Case)do { (activation.regs()).pc += (JSOpLength_Case); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2403
2404 CASE(Lt)label_Lt: {
2405 bool cond;
2406 MutableHandleValue lval = REGS(activation.regs()).stackHandleAt(-2);
2407 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2408 if (!LessThanOperation(cx, lval, rval, &cond)) {
2409 goto error;
2410 }
2411 TRY_BRANCH_AFTER_COND(cond, 2)do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(GetBytecodeLength((activation.regs()).pc) == 1)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2411); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 2411; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); unsigned diff_
= (unsigned)GET_UINT8((activation.regs()).pc) - (unsigned)JSOp
::JumpIfFalse; if (diff_ <= 1) { (activation.regs()).sp -=
(2); if ((cond) == (diff_ != 0)) { ++(activation.regs()).pc;
do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc)
); if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0); } do { (activation.regs()).pc += (1 + JSOpLength_JumpIfFalse
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
); } } while (0)
;
2412 REGS(activation.regs()).sp[-2].setBoolean(cond);
2413 REGS(activation.regs()).sp--;
2414 }
2415 END_CASE(Lt)do { (activation.regs()).pc += (JSOpLength_Lt); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2416
2417 CASE(Le)label_Le: {
2418 bool cond;
2419 MutableHandleValue lval = REGS(activation.regs()).stackHandleAt(-2);
2420 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2421 if (!LessThanOrEqualOperation(cx, lval, rval, &cond)) {
2422 goto error;
2423 }
2424 TRY_BRANCH_AFTER_COND(cond, 2)do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(GetBytecodeLength((activation.regs()).pc) == 1)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2424); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 2424; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); unsigned diff_
= (unsigned)GET_UINT8((activation.regs()).pc) - (unsigned)JSOp
::JumpIfFalse; if (diff_ <= 1) { (activation.regs()).sp -=
(2); if ((cond) == (diff_ != 0)) { ++(activation.regs()).pc;
do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc)
); if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0); } do { (activation.regs()).pc += (1 + JSOpLength_JumpIfFalse
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
); } } while (0)
;
2425 REGS(activation.regs()).sp[-2].setBoolean(cond);
2426 REGS(activation.regs()).sp--;
2427 }
2428 END_CASE(Le)do { (activation.regs()).pc += (JSOpLength_Le); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2429
2430 CASE(Gt)label_Gt: {
2431 bool cond;
2432 MutableHandleValue lval = REGS(activation.regs()).stackHandleAt(-2);
2433 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2434 if (!GreaterThanOperation(cx, lval, rval, &cond)) {
2435 goto error;
2436 }
2437 TRY_BRANCH_AFTER_COND(cond, 2)do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(GetBytecodeLength((activation.regs()).pc) == 1)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2437); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 2437; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); unsigned diff_
= (unsigned)GET_UINT8((activation.regs()).pc) - (unsigned)JSOp
::JumpIfFalse; if (diff_ <= 1) { (activation.regs()).sp -=
(2); if ((cond) == (diff_ != 0)) { ++(activation.regs()).pc;
do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc)
); if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0); } do { (activation.regs()).pc += (1 + JSOpLength_JumpIfFalse
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
); } } while (0)
;
2438 REGS(activation.regs()).sp[-2].setBoolean(cond);
2439 REGS(activation.regs()).sp--;
2440 }
2441 END_CASE(Gt)do { (activation.regs()).pc += (JSOpLength_Gt); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2442
2443 CASE(Ge)label_Ge: {
2444 bool cond;
2445 MutableHandleValue lval = REGS(activation.regs()).stackHandleAt(-2);
2446 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2447 if (!GreaterThanOrEqualOperation(cx, lval, rval, &cond)) {
2448 goto error;
2449 }
2450 TRY_BRANCH_AFTER_COND(cond, 2)do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(GetBytecodeLength((activation.regs()).pc) == 1)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(GetBytecodeLength((activation.regs()).pc) == 1))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("GetBytecodeLength((activation.regs()).pc) == 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2450); AnnotateMozCrashReason("MOZ_ASSERT" "(" "GetBytecodeLength((activation.regs()).pc) == 1"
")"); do { *((volatile int*)__null) = 2450; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); unsigned diff_
= (unsigned)GET_UINT8((activation.regs()).pc) - (unsigned)JSOp
::JumpIfFalse; if (diff_ <= 1) { (activation.regs()).sp -=
(2); if ((cond) == (diff_ != 0)) { ++(activation.regs()).pc;
do { int32_t nlen = (GET_JUMP_OFFSET((activation.regs()).pc)
); if (nlen <= 0) do { if (!CheckForInterrupt(cx)) goto error
; } while (0); do { (activation.regs()).pc += (nlen); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
} while (0); } do { (activation.regs()).pc += (1 + JSOpLength_JumpIfFalse
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
); } } while (0)
;
2451 REGS(activation.regs()).sp[-2].setBoolean(cond);
2452 REGS(activation.regs()).sp--;
2453 }
2454 END_CASE(Ge)do { (activation.regs()).pc += (JSOpLength_Ge); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2455
2456 CASE(Lsh)label_Lsh: {
2457 MutableHandleValue lhs = REGS(activation.regs()).stackHandleAt(-2);
2458 MutableHandleValue rhs = REGS(activation.regs()).stackHandleAt(-1);
2459 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2460 if (!BitLshOperation(cx, lhs, rhs, res)) {
2461 goto error;
2462 }
2463 REGS(activation.regs()).sp--;
2464 }
2465 END_CASE(Lsh)do { (activation.regs()).pc += (JSOpLength_Lsh); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2466
2467 CASE(Rsh)label_Rsh: {
2468 MutableHandleValue lhs = REGS(activation.regs()).stackHandleAt(-2);
2469 MutableHandleValue rhs = REGS(activation.regs()).stackHandleAt(-1);
2470 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2471 if (!BitRshOperation(cx, lhs, rhs, res)) {
2472 goto error;
2473 }
2474 REGS(activation.regs()).sp--;
2475 }
2476 END_CASE(Rsh)do { (activation.regs()).pc += (JSOpLength_Rsh); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2477
2478 CASE(Ursh)label_Ursh: {
2479 MutableHandleValue lhs = REGS(activation.regs()).stackHandleAt(-2);
2480 MutableHandleValue rhs = REGS(activation.regs()).stackHandleAt(-1);
2481 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2482 if (!UrshOperation(cx, lhs, rhs, res)) {
2483 goto error;
2484 }
2485 REGS(activation.regs()).sp--;
2486 }
2487 END_CASE(Ursh)do { (activation.regs()).pc += (JSOpLength_Ursh); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2488
2489 CASE(Add)label_Add: {
2490 MutableHandleValue lval = REGS(activation.regs()).stackHandleAt(-2);
2491 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2492 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2493 if (!AddOperation(cx, lval, rval, res)) {
2494 goto error;
2495 }
2496 REGS(activation.regs()).sp--;
2497 }
2498 END_CASE(Add)do { (activation.regs()).pc += (JSOpLength_Add); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2499
2500 CASE(Sub)label_Sub: {
2501 ReservedRooted<Value> lval(&rootValue0, REGS(activation.regs()).sp[-2]);
2502 ReservedRooted<Value> rval(&rootValue1, REGS(activation.regs()).sp[-1]);
2503 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2504 if (!SubOperation(cx, &lval, &rval, res)) {
2505 goto error;
2506 }
2507 REGS(activation.regs()).sp--;
2508 }
2509 END_CASE(Sub)do { (activation.regs()).pc += (JSOpLength_Sub); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2510
2511 CASE(Mul)label_Mul: {
2512 ReservedRooted<Value> lval(&rootValue0, REGS(activation.regs()).sp[-2]);
2513 ReservedRooted<Value> rval(&rootValue1, REGS(activation.regs()).sp[-1]);
2514 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2515 if (!MulOperation(cx, &lval, &rval, res)) {
2516 goto error;
2517 }
2518 REGS(activation.regs()).sp--;
2519 }
2520 END_CASE(Mul)do { (activation.regs()).pc += (JSOpLength_Mul); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2521
2522 CASE(Div)label_Div: {
2523 ReservedRooted<Value> lval(&rootValue0, REGS(activation.regs()).sp[-2]);
2524 ReservedRooted<Value> rval(&rootValue1, REGS(activation.regs()).sp[-1]);
2525 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2526 if (!DivOperation(cx, &lval, &rval, res)) {
2527 goto error;
2528 }
2529 REGS(activation.regs()).sp--;
2530 }
2531 END_CASE(Div)do { (activation.regs()).pc += (JSOpLength_Div); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2532
2533 CASE(Mod)label_Mod: {
2534 ReservedRooted<Value> lval(&rootValue0, REGS(activation.regs()).sp[-2]);
2535 ReservedRooted<Value> rval(&rootValue1, REGS(activation.regs()).sp[-1]);
2536 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2537 if (!ModOperation(cx, &lval, &rval, res)) {
2538 goto error;
2539 }
2540 REGS(activation.regs()).sp--;
2541 }
2542 END_CASE(Mod)do { (activation.regs()).pc += (JSOpLength_Mod); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2543
2544 CASE(Pow)label_Pow: {
2545 ReservedRooted<Value> lval(&rootValue0, REGS(activation.regs()).sp[-2]);
2546 ReservedRooted<Value> rval(&rootValue1, REGS(activation.regs()).sp[-1]);
2547 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2548 if (!PowOperation(cx, &lval, &rval, res)) {
2549 goto error;
2550 }
2551 REGS(activation.regs()).sp--;
2552 }
2553 END_CASE(Pow)do { (activation.regs()).pc += (JSOpLength_Pow); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2554
2555 CASE(Not)label_Not: {
2556 bool cond = ToBoolean(REGS(activation.regs()).stackHandleAt(-1));
2557 REGS(activation.regs()).sp--;
2558 PUSH_BOOLEAN(!cond)(activation.regs()).sp++->setBoolean(!cond);
2559 }
2560 END_CASE(Not)do { (activation.regs()).pc += (JSOpLength_Not); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2561
2562 CASE(BitNot)label_BitNot: {
2563 MutableHandleValue val = REGS(activation.regs()).stackHandleAt(-1);
2564 if (!BitNotOperation(cx, val, val)) {
2565 goto error;
2566 }
2567 }
2568 END_CASE(BitNot)do { (activation.regs()).pc += (JSOpLength_BitNot); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2569
2570 CASE(Neg)label_Neg: {
2571 MutableHandleValue val = REGS(activation.regs()).stackHandleAt(-1);
2572 if (!NegOperation(cx, val, val)) {
2573 goto error;
2574 }
2575 }
2576 END_CASE(Neg)do { (activation.regs()).pc += (JSOpLength_Neg); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2577
2578 CASE(Pos)label_Pos: {
2579 if (!ToNumber(cx, REGS(activation.regs()).stackHandleAt(-1))) {
2580 goto error;
2581 }
2582 }
2583 END_CASE(Pos)do { (activation.regs()).pc += (JSOpLength_Pos); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2584
2585 CASE(DelName)label_DelName: {
2586 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
2587 ReservedRooted<JSObject*> envObj(&rootObject0,
2588 REGS(activation.regs()).fp()->environmentChain());
2589
2590 PUSH_BOOLEAN(true)(activation.regs()).sp++->setBoolean(true);
2591 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-1);
2592 if (!DeleteNameOperation(cx, name, envObj, res)) {
2593 goto error;
2594 }
2595 }
2596 END_CASE(DelName)do { (activation.regs()).pc += (JSOpLength_DelName); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2597
2598 CASE(DelProp)label_DelProp:
2599 CASE(StrictDelProp)label_StrictDelProp: {
2600 static_assert(JSOpLength_DelProp == JSOpLength_StrictDelProp,
2601 "delprop and strictdelprop must be the same size");
2602 HandleValue val = REGS(activation.regs()).stackHandleAt(-1);
2603 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
2604 bool res = false;
2605 if (JSOp(*REGS(activation.regs()).pc) == JSOp::StrictDelProp) {
2606 if (!DelPropOperation<true>(cx, val, name, &res)) {
2607 goto error;
2608 }
2609 } else {
2610 if (!DelPropOperation<false>(cx, val, name, &res)) {
2611 goto error;
2612 }
2613 }
2614 REGS(activation.regs()).sp[-1].setBoolean(res);
2615 }
2616 END_CASE(DelProp)do { (activation.regs()).pc += (JSOpLength_DelProp); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2617
2618 CASE(DelElem)label_DelElem:
2619 CASE(StrictDelElem)label_StrictDelElem: {
2620 static_assert(JSOpLength_DelElem == JSOpLength_StrictDelElem,
2621 "delelem and strictdelelem must be the same size");
2622 HandleValue val = REGS(activation.regs()).stackHandleAt(-2);
2623 HandleValue propval = REGS(activation.regs()).stackHandleAt(-1);
2624 bool res = false;
2625 if (JSOp(*REGS(activation.regs()).pc) == JSOp::StrictDelElem) {
2626 if (!DelElemOperation<true>(cx, val, propval, &res)) {
2627 goto error;
2628 }
2629 } else {
2630 if (!DelElemOperation<false>(cx, val, propval, &res)) {
2631 goto error;
2632 }
2633 }
2634 REGS(activation.regs()).sp[-2].setBoolean(res);
2635 REGS(activation.regs()).sp--;
2636 }
2637 END_CASE(DelElem)do { (activation.regs()).pc += (JSOpLength_DelElem); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2638
2639 CASE(ToPropertyKey)label_ToPropertyKey: {
2640 ReservedRooted<Value> idval(&rootValue1, REGS(activation.regs()).sp[-1]);
2641 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-1);
2642 if (!ToPropertyKeyOperation(cx, idval, res)) {
2643 goto error;
2644 }
2645 }
2646 END_CASE(ToPropertyKey)do { (activation.regs()).pc += (JSOpLength_ToPropertyKey); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2647
2648 CASE(TypeofExpr)label_TypeofExpr:
2649 CASE(Typeof)label_Typeof: {
2650 REGS(activation.regs()).sp[-1].setString(TypeOfOperation(REGS(activation.regs()).sp[-1], cx->runtime()));
2651 }
2652 END_CASE(Typeof)do { (activation.regs()).pc += (JSOpLength_Typeof); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2653
2654 CASE(TypeofEq)label_TypeofEq: {
2655 auto operand = TypeofEqOperand::fromRawValue(GET_UINT8(REGS(activation.regs()).pc));
2656 bool result = js::TypeOfValue(REGS(activation.regs()).sp[-1]) == operand.type();
2657 if (operand.compareOp() == JSOp::Ne) {
2658 result = !result;
2659 }
2660 REGS(activation.regs()).sp[-1].setBoolean(result);
2661 }
2662 END_CASE(TypeofEq)do { (activation.regs()).pc += (JSOpLength_TypeofEq); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2663
2664 CASE(Void)label_Void: { REGS(activation.regs()).sp[-1].setUndefined(); }
2665 END_CASE(Void)do { (activation.regs()).pc += (JSOpLength_Void); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2666
2667 CASE(FunctionThis)label_FunctionThis: {
2668 PUSH_NULL()(activation.regs()).sp++->setNull();
2669 if (!GetFunctionThis(cx, REGS(activation.regs()).fp(), REGS(activation.regs()).stackHandleAt(-1))) {
2670 goto error;
2671 }
2672 }
2673 END_CASE(FunctionThis)do { (activation.regs()).pc += (JSOpLength_FunctionThis); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2674
2675 CASE(GlobalThis)label_GlobalThis: {
2676 MOZ_ASSERT(!script->hasNonSyntacticScope())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!script->hasNonSyntacticScope())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!script->hasNonSyntacticScope
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!script->hasNonSyntacticScope()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2676); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!script->hasNonSyntacticScope()"
")"); do { *((volatile int*)__null) = 2676; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2677 PUSH_OBJECT(*cx->global()->lexicalEnvironment().thisObject())do { (activation.regs()).sp++->setObject(*cx->global()->
lexicalEnvironment().thisObject()); cx->debugOnlyCheck((activation
.regs()).sp[-1]); } while (0)
;
2678 }
2679 END_CASE(GlobalThis)do { (activation.regs()).pc += (JSOpLength_GlobalThis); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2680
2681 CASE(NonSyntacticGlobalThis)label_NonSyntacticGlobalThis: {
2682 PUSH_NULL()(activation.regs()).sp++->setNull();
2683 GetNonSyntacticGlobalThis(cx, REGS(activation.regs()).fp()->environmentChain(),
2684 REGS(activation.regs()).stackHandleAt(-1));
2685 }
2686 END_CASE(NonSyntacticGlobalThis)do { (activation.regs()).pc += (JSOpLength_NonSyntacticGlobalThis
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2687
2688 CASE(CheckIsObj)label_CheckIsObj: {
2689 if (!REGS(activation.regs()).sp[-1].isObject()) {
2690 MOZ_ALWAYS_FALSE(do { if ((__builtin_expect(!!(!(ThrowCheckIsObject(cx, CheckIsObjectKind
(GET_UINT8((activation.regs()).pc))))), 1))) { } else { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(false)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(false))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("false" " (" "!(ThrowCheckIsObject(cx, CheckIsObjectKind(GET_UINT8((activation.regs()).pc))))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2691); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowCheckIsObject(cx, CheckIsObjectKind(GET_UINT8((activation.regs()).pc))))"
")"); do { *((volatile int*)__null) = 2691; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
2691 ThrowCheckIsObject(cx, CheckIsObjectKind(GET_UINT8(REGS.pc))))do { if ((__builtin_expect(!!(!(ThrowCheckIsObject(cx, CheckIsObjectKind
(GET_UINT8((activation.regs()).pc))))), 1))) { } else { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(false)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(false))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("false" " (" "!(ThrowCheckIsObject(cx, CheckIsObjectKind(GET_UINT8((activation.regs()).pc))))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2691); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowCheckIsObject(cx, CheckIsObjectKind(GET_UINT8((activation.regs()).pc))))"
")"); do { *((volatile int*)__null) = 2691; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
2692 goto error;
2693 }
2694 }
2695 END_CASE(CheckIsObj)do { (activation.regs()).pc += (JSOpLength_CheckIsObj); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2696
2697 CASE(CheckThis)label_CheckThis: {
2698 if (REGS(activation.regs()).sp[-1].isMagic(JS_UNINITIALIZED_LEXICAL)) {
2699 MOZ_ALWAYS_FALSE(ThrowUninitializedThis(cx))do { if ((__builtin_expect(!!(!(ThrowUninitializedThis(cx))),
1))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "!(ThrowUninitializedThis(cx))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2699); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowUninitializedThis(cx))" ")"); do { *((volatile
int*)__null) = 2699; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false); } } while (false)
;
2700 goto error;
2701 }
2702 }
2703 END_CASE(CheckThis)do { (activation.regs()).pc += (JSOpLength_CheckThis); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
2704
2705 CASE(CheckThisReinit)label_CheckThisReinit: {
2706 if (!REGS(activation.regs()).sp[-1].isMagic(JS_UNINITIALIZED_LEXICAL)) {
2707 MOZ_ALWAYS_FALSE(ThrowInitializedThis(cx))do { if ((__builtin_expect(!!(!(ThrowInitializedThis(cx))), 1
))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "!(ThrowInitializedThis(cx))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2707); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowInitializedThis(cx))" ")"); do { *((volatile int
*)__null) = 2707; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false); } } while (false)
;
2708 goto error;
2709 }
2710 }
2711 END_CASE(CheckThisReinit)do { (activation.regs()).pc += (JSOpLength_CheckThisReinit); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2712
2713 CASE(CheckReturn)label_CheckReturn: {
2714 ReservedRooted<Value> thisv(&rootValue0, REGS(activation.regs()).sp[-1]);
2715 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2716 if (!REGS(activation.regs()).fp()->checkReturn(cx, thisv, rval)) {
2717 goto error;
2718 }
2719 }
2720 END_CASE(CheckReturn)do { (activation.regs()).pc += (JSOpLength_CheckReturn); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2721
2722 CASE(GetProp)label_GetProp: {
2723 ReservedRooted<Value> lval(&rootValue0, REGS(activation.regs()).sp[-1]);
2724 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-1);
2725 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
2726 if (!GetPropertyOperation(cx, name, lval, res)) {
2727 goto error;
2728 }
2729 cx->debugOnlyCheck(res);
2730 }
2731 END_CASE(GetProp)do { (activation.regs()).pc += (JSOpLength_GetProp); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2732
2733 CASE(GetPropSuper)label_GetPropSuper: {
2734 ReservedRooted<Value> receiver(&rootValue0, REGS(activation.regs()).sp[-2]);
2735 HandleValue lval = REGS(activation.regs()).stackHandleAt(-1);
2736 MOZ_ASSERT(lval.isObjectOrNull())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(lval.isObjectOrNull())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(lval.isObjectOrNull()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("lval.isObjectOrNull()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2736); AnnotateMozCrashReason("MOZ_ASSERT" "(" "lval.isObjectOrNull()"
")"); do { *((volatile int*)__null) = 2736; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2737 MutableHandleValue rref = REGS(activation.regs()).stackHandleAt(-2);
2738 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
2739
2740 ReservedRooted<JSObject*> obj(&rootObject0);
2741 obj = ToObjectFromStackForPropertyAccess(cx, lval, -1, name);
2742 if (!obj) {
2743 goto error;
2744 }
2745
2746 if (!GetProperty(cx, obj, receiver, name, rref)) {
2747 goto error;
2748 }
2749
2750 cx->debugOnlyCheck(rref);
2751
2752 REGS(activation.regs()).sp--;
2753 }
2754 END_CASE(GetPropSuper)do { (activation.regs()).pc += (JSOpLength_GetPropSuper); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2755
2756 CASE(GetBoundName)label_GetBoundName: {
2757 ReservedRooted<JSObject*> env(&rootObject0, &REGS(activation.regs()).sp[-1].toObject());
2758 ReservedRooted<jsid> id(&rootId0, NameToId(script->getName(REGS(activation.regs()).pc)));
2759 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2760 if (!GetNameBoundInEnvironment(cx, env, id, rval)) {
2761 goto error;
2762 }
2763 cx->debugOnlyCheck(rval);
2764 }
2765 END_CASE(GetBoundName)do { (activation.regs()).pc += (JSOpLength_GetBoundName); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2766
2767 CASE(SetIntrinsic)label_SetIntrinsic: {
2768 HandleValue value = REGS(activation.regs()).stackHandleAt(-1);
2769
2770 if (!SetIntrinsicOperation(cx, script, REGS(activation.regs()).pc, value)) {
2771 goto error;
2772 }
2773 }
2774 END_CASE(SetIntrinsic)do { (activation.regs()).pc += (JSOpLength_SetIntrinsic); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2775
2776 CASE(SetGName)label_SetGName:
2777 CASE(StrictSetGName)label_StrictSetGName:
2778 CASE(SetName)label_SetName:
2779 CASE(StrictSetName)label_StrictSetName: {
2780 static_assert(JSOpLength_SetName == JSOpLength_StrictSetName,
2781 "setname and strictsetname must be the same size");
2782 static_assert(JSOpLength_SetGName == JSOpLength_StrictSetGName,
2783 "setgname and strictsetgname must be the same size");
2784 static_assert(JSOpLength_SetName == JSOpLength_SetGName,
2785 "We're sharing the END_CASE so the lengths better match");
2786
2787 ReservedRooted<JSObject*> env(&rootObject0, &REGS(activation.regs()).sp[-2].toObject());
2788 HandleValue value = REGS(activation.regs()).stackHandleAt(-1);
2789
2790 if (!SetNameOperation(cx, script, REGS(activation.regs()).pc, env, value)) {
2791 goto error;
2792 }
2793
2794 REGS(activation.regs()).sp[-2] = REGS(activation.regs()).sp[-1];
2795 REGS(activation.regs()).sp--;
2796 }
2797 END_CASE(SetName)do { (activation.regs()).pc += (JSOpLength_SetName); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2798
2799 CASE(SetProp)label_SetProp:
2800 CASE(StrictSetProp)label_StrictSetProp: {
2801 static_assert(JSOpLength_SetProp == JSOpLength_StrictSetProp,
2802 "setprop and strictsetprop must be the same size");
2803 int lvalIndex = -2;
2804 HandleValue lval = REGS(activation.regs()).stackHandleAt(lvalIndex);
2805 HandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2806
2807 ReservedRooted<jsid> id(&rootId0, NameToId(script->getName(REGS(activation.regs()).pc)));
2808
2809 bool strict = JSOp(*REGS(activation.regs()).pc) == JSOp::StrictSetProp;
2810
2811 ReservedRooted<JSObject*> obj(&rootObject0);
2812 obj = ToObjectFromStackForPropertyAccess(cx, lval, lvalIndex, id);
2813 if (!obj) {
2814 goto error;
2815 }
2816
2817 if (!SetObjectElementOperation(cx, obj, id, rval, lval, strict)) {
2818 goto error;
2819 }
2820
2821 REGS(activation.regs()).sp[-2] = REGS(activation.regs()).sp[-1];
2822 REGS(activation.regs()).sp--;
2823 }
2824 END_CASE(SetProp)do { (activation.regs()).pc += (JSOpLength_SetProp); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2825
2826 CASE(SetPropSuper)label_SetPropSuper:
2827 CASE(StrictSetPropSuper)label_StrictSetPropSuper: {
2828 static_assert(
2829 JSOpLength_SetPropSuper == JSOpLength_StrictSetPropSuper,
2830 "setprop-super and strictsetprop-super must be the same size");
2831
2832 HandleValue receiver = REGS(activation.regs()).stackHandleAt(-3);
2833 HandleValue lval = REGS(activation.regs()).stackHandleAt(-2);
2834 MOZ_ASSERT(lval.isObjectOrNull())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(lval.isObjectOrNull())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(lval.isObjectOrNull()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("lval.isObjectOrNull()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2834); AnnotateMozCrashReason("MOZ_ASSERT" "(" "lval.isObjectOrNull()"
")"); do { *((volatile int*)__null) = 2834; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2835 HandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2836 ReservedRooted<jsid> id(&rootId0, NameToId(script->getName(REGS(activation.regs()).pc)));
2837
2838 bool strict = JSOp(*REGS(activation.regs()).pc) == JSOp::StrictSetPropSuper;
2839
2840 ReservedRooted<JSObject*> obj(&rootObject0);
2841 obj = ToObjectFromStackForPropertyAccess(cx, lval, -2, id);
2842 if (!obj) {
2843 goto error;
2844 }
2845
2846 if (!SetObjectElementOperation(cx, obj, id, rval, receiver, strict)) {
2847 goto error;
2848 }
2849
2850 REGS(activation.regs()).sp[-3] = REGS(activation.regs()).sp[-1];
2851 REGS(activation.regs()).sp -= 2;
2852 }
2853 END_CASE(SetPropSuper)do { (activation.regs()).pc += (JSOpLength_SetPropSuper); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2854
2855 CASE(GetElem)label_GetElem: {
2856 int lvalIndex = -2;
2857 ReservedRooted<Value> lval(&rootValue0, REGS(activation.regs()).sp[lvalIndex]);
2858 HandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
2859 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-2);
2860
2861 if (!GetElementOperationWithStackIndex(cx, lval, lvalIndex, rval, res)) {
2862 goto error;
2863 }
2864
2865 REGS(activation.regs()).sp--;
2866 }
2867 END_CASE(GetElem)do { (activation.regs()).pc += (JSOpLength_GetElem); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2868
2869 CASE(GetElemSuper)label_GetElemSuper: {
2870 ReservedRooted<Value> receiver(&rootValue0, REGS(activation.regs()).sp[-3]);
2871 HandleValue index = REGS(activation.regs()).stackHandleAt(-2);
2872 HandleValue lval = REGS(activation.regs()).stackHandleAt(-1);
2873 MOZ_ASSERT(lval.isObjectOrNull())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(lval.isObjectOrNull())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(lval.isObjectOrNull()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("lval.isObjectOrNull()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2873); AnnotateMozCrashReason("MOZ_ASSERT" "(" "lval.isObjectOrNull()"
")"); do { *((volatile int*)__null) = 2873; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2874
2875 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-3);
2876
2877 ReservedRooted<JSObject*> obj(&rootObject0);
2878 obj = ToObjectFromStackForPropertyAccess(cx, lval, -1, index);
2879 if (!obj) {
2880 goto error;
2881 }
2882
2883 if (!GetObjectElementOperation(cx, JSOp(*REGS(activation.regs()).pc), obj, receiver, index,
2884 res)) {
2885 goto error;
2886 }
2887
2888 REGS(activation.regs()).sp -= 2;
2889 }
2890 END_CASE(GetElemSuper)do { (activation.regs()).pc += (JSOpLength_GetElemSuper); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2891
2892 CASE(SetElem)label_SetElem:
2893 CASE(StrictSetElem)label_StrictSetElem: {
2894 static_assert(JSOpLength_SetElem == JSOpLength_StrictSetElem,
2895 "setelem and strictsetelem must be the same size");
2896 int receiverIndex = -3;
2897 HandleValue receiver = REGS(activation.regs()).stackHandleAt(receiverIndex);
2898 HandleValue value = REGS(activation.regs()).stackHandleAt(-1);
2899
2900 ReservedRooted<JSObject*> obj(&rootObject0);
2901 obj = ToObjectFromStackForPropertyAccess(cx, receiver, receiverIndex,
2902 REGS(activation.regs()).stackHandleAt(-2));
2903 if (!obj) {
2904 goto error;
2905 }
2906
2907 ReservedRooted<jsid> id(&rootId0);
2908 FETCH_ELEMENT_ID(-2, id)do { if (!ToPropertyKey(cx, (activation.regs()).stackHandleAt
(-2), &(id))) goto error; } while (0)
;
2909
2910 if (!SetObjectElementOperation(cx, obj, id, value, receiver,
2911 JSOp(*REGS(activation.regs()).pc) == JSOp::StrictSetElem)) {
2912 goto error;
2913 }
2914 REGS(activation.regs()).sp[-3] = value;
2915 REGS(activation.regs()).sp -= 2;
2916 }
2917 END_CASE(SetElem)do { (activation.regs()).pc += (JSOpLength_SetElem); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
2918
2919 CASE(SetElemSuper)label_SetElemSuper:
2920 CASE(StrictSetElemSuper)label_StrictSetElemSuper: {
2921 static_assert(
2922 JSOpLength_SetElemSuper == JSOpLength_StrictSetElemSuper,
2923 "setelem-super and strictsetelem-super must be the same size");
2924
2925 HandleValue receiver = REGS(activation.regs()).stackHandleAt(-4);
2926 HandleValue lval = REGS(activation.regs()).stackHandleAt(-2);
2927 MOZ_ASSERT(lval.isObjectOrNull())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(lval.isObjectOrNull())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(lval.isObjectOrNull()))), 0)
)) { do { } while (false); MOZ_ReportAssertionFailure("lval.isObjectOrNull()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2927); AnnotateMozCrashReason("MOZ_ASSERT" "(" "lval.isObjectOrNull()"
")"); do { *((volatile int*)__null) = 2927; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2928 HandleValue value = REGS(activation.regs()).stackHandleAt(-1);
2929
2930 ReservedRooted<JSObject*> obj(&rootObject0);
2931 obj = ToObjectFromStackForPropertyAccess(cx, lval, -2,
2932 REGS(activation.regs()).stackHandleAt(-3));
2933 if (!obj) {
2934 goto error;
2935 }
2936
2937 ReservedRooted<jsid> id(&rootId0);
2938 FETCH_ELEMENT_ID(-3, id)do { if (!ToPropertyKey(cx, (activation.regs()).stackHandleAt
(-3), &(id))) goto error; } while (0)
;
2939
2940 bool strict = JSOp(*REGS(activation.regs()).pc) == JSOp::StrictSetElemSuper;
2941 if (!SetObjectElementOperation(cx, obj, id, value, receiver, strict)) {
2942 goto error;
2943 }
2944 REGS(activation.regs()).sp[-4] = value;
2945 REGS(activation.regs()).sp -= 3;
2946 }
2947 END_CASE(SetElemSuper)do { (activation.regs()).pc += (JSOpLength_SetElemSuper); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
2948
2949 CASE(Eval)label_Eval:
2950 CASE(StrictEval)label_StrictEval: {
2951 static_assert(JSOpLength_Eval == JSOpLength_StrictEval,
2952 "eval and stricteval must be the same size");
2953
2954 CallArgs args = CallArgsFromSp(GET_ARGC(REGS(activation.regs()).pc), REGS(activation.regs()).sp);
2955 if (cx->global()->valueIsEval(args.calleev())) {
2956 if (!DirectEval(cx, args.get(0), args.rval())) {
2957 goto error;
2958 }
2959 } else {
2960 if (!CallFromStack(cx, args, CallReason::Call)) {
2961 goto error;
2962 }
2963 }
2964
2965 REGS(activation.regs()).sp = args.spAfterCall();
2966 }
2967 END_CASE(Eval)do { (activation.regs()).pc += (JSOpLength_Eval); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
2968
2969 CASE(SpreadNew)label_SpreadNew:
2970 CASE(SpreadCall)label_SpreadCall:
2971 CASE(SpreadSuperCall)label_SpreadSuperCall: {
2972 if (REGS(activation.regs()).fp()->hasPushedGeckoProfilerFrame()) {
2973 cx->geckoProfiler().updatePC(cx, script, REGS(activation.regs()).pc);
2974 }
2975 /* FALL THROUGH */
2976 }
2977
2978 CASE(SpreadEval)label_SpreadEval:
2979 CASE(StrictSpreadEval)label_StrictSpreadEval: {
2980 static_assert(JSOpLength_SpreadEval == JSOpLength_StrictSpreadEval,
2981 "spreadeval and strictspreadeval must be the same size");
2982 bool construct = JSOp(*REGS(activation.regs()).pc) == JSOp::SpreadNew ||
2983 JSOp(*REGS(activation.regs()).pc) == JSOp::SpreadSuperCall;
2984
2985 MOZ_ASSERT(REGS.stackDepth() >= 3u + construct)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 3u + construct
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).stackDepth() >= 3u + construct
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"(activation.regs()).stackDepth() >= 3u + construct", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 2985); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 3u + construct"
")"); do { *((volatile int*)__null) = 2985; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
2986
2987 HandleValue callee = REGS(activation.regs()).stackHandleAt(-3 - construct);
2988 HandleValue thisv = REGS(activation.regs()).stackHandleAt(-2 - construct);
2989 HandleValue arr = REGS(activation.regs()).stackHandleAt(-1 - construct);
2990 MutableHandleValue ret = REGS(activation.regs()).stackHandleAt(-3 - construct);
2991
2992 RootedValue& newTarget = rootValue0;
2993 if (construct) {
2994 newTarget = REGS(activation.regs()).sp[-1];
2995 } else {
2996 newTarget = NullValue();
2997 }
2998
2999 if (!SpreadCallOperation(cx, script, REGS(activation.regs()).pc, thisv, callee, arr,
3000 newTarget, ret)) {
3001 goto error;
3002 }
3003
3004 REGS(activation.regs()).sp -= 2 + construct;
3005 }
3006 END_CASE(SpreadCall)do { (activation.regs()).pc += (JSOpLength_SpreadCall); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3007
3008 CASE(New)label_New:
3009 CASE(NewContent)label_NewContent:
3010 CASE(Call)label_Call:
3011 CASE(CallContent)label_CallContent:
3012 CASE(CallIgnoresRv)label_CallIgnoresRv:
3013 CASE(CallIter)label_CallIter:
3014 CASE(CallContentIter)label_CallContentIter:
3015 CASE(SuperCall)label_SuperCall: {
3016 static_assert(JSOpLength_Call == JSOpLength_New,
3017 "call and new must be the same size");
3018 static_assert(JSOpLength_Call == JSOpLength_CallContent,
3019 "call and call-content must be the same size");
3020 static_assert(JSOpLength_Call == JSOpLength_CallIgnoresRv,
3021 "call and call-ignores-rv must be the same size");
3022 static_assert(JSOpLength_Call == JSOpLength_CallIter,
3023 "call and calliter must be the same size");
3024 static_assert(JSOpLength_Call == JSOpLength_CallContentIter,
3025 "call and call-content-iter must be the same size");
3026 static_assert(JSOpLength_Call == JSOpLength_SuperCall,
3027 "call and supercall must be the same size");
3028
3029 if (REGS(activation.regs()).fp()->hasPushedGeckoProfilerFrame()) {
3030 cx->geckoProfiler().updatePC(cx, script, REGS(activation.regs()).pc);
3031 }
3032
3033 JSOp op = JSOp(*REGS(activation.regs()).pc);
3034 MaybeConstruct construct = MaybeConstruct(
3035 op == JSOp::New || op == JSOp::NewContent || op == JSOp::SuperCall);
3036 bool ignoresReturnValue = op == JSOp::CallIgnoresRv;
3037 unsigned argStackSlots = GET_ARGC(REGS(activation.regs()).pc) + construct;
3038
3039 MOZ_ASSERT(REGS.stackDepth() >= 2u + GET_ARGC(REGS.pc))do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2u + GET_ARGC
((activation.regs()).pc))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!((activation.regs()).stackDepth
() >= 2u + GET_ARGC((activation.regs()).pc)))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2u + GET_ARGC((activation.regs()).pc)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3039); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2u + GET_ARGC((activation.regs()).pc)"
")"); do { *((volatile int*)__null) = 3039; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3040 CallArgs args =
3041 CallArgsFromSp(argStackSlots, REGS(activation.regs()).sp, construct, ignoresReturnValue);
3042
3043 JSFunction* maybeFun;
3044 bool isFunction = IsFunctionObject(args.calleev(), &maybeFun);
3045
3046 // Use the slow path if the callee is not an interpreted function, if we
3047 // have to throw an exception, or if we might have to invoke the
3048 // OnNativeCall hook for a self-hosted builtin.
3049 if (!isFunction || !maybeFun->isInterpreted() ||
3050 (construct && !maybeFun->isConstructor()) ||
3051 (!construct && maybeFun->isClassConstructor()) ||
3052 cx->realm()->debuggerObservesNativeCall()) {
3053 if (construct) {
3054 CallReason reason = op == JSOp::NewContent ? CallReason::CallContent
3055 : CallReason::Call;
3056 if (!ConstructFromStack(cx, args, reason)) {
3057 goto error;
3058 }
3059 } else {
3060 if ((op == JSOp::CallIter || op == JSOp::CallContentIter) &&
3061 args.calleev().isPrimitive()) {
3062 MOZ_ASSERT(args.length() == 0, "thisv must be on top of the stack")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(args.length() == 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(args.length() == 0))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("args.length() == 0"
" (" "thisv must be on top of the stack" ")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3062); AnnotateMozCrashReason("MOZ_ASSERT" "(" "args.length() == 0"
") (" "thisv must be on top of the stack" ")"); do { *((volatile
int*)__null) = 3062; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
3063 ReportValueError(cx, JSMSG_NOT_ITERABLE, -1, args.thisv(), nullptr);
3064 goto error;
3065 }
3066
3067 CallReason reason =
3068 (op == JSOp::CallContent || op == JSOp::CallContentIter)
3069 ? CallReason::CallContent
3070 : CallReason::Call;
3071 if (!CallFromStack(cx, args, reason)) {
3072 goto error;
3073 }
3074 }
3075 Value* newsp = args.spAfterCall();
3076 REGS(activation.regs()).sp = newsp;
3077 ADVANCE_AND_DISPATCH(JSOpLength_Call)do { (activation.regs()).pc += (JSOpLength_Call); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0)
;
3078 }
3079
3080 {
3081 MOZ_ASSERT(maybeFun)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(maybeFun)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(maybeFun))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("maybeFun", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3081); AnnotateMozCrashReason("MOZ_ASSERT" "(" "maybeFun" ")"
); do { *((volatile int*)__null) = 3081; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3082 ReservedRooted<JSFunction*> fun(&rootFunction0, maybeFun);
3083 ReservedRooted<JSScript*> funScript(
3084 &rootScript0, JSFunction::getOrCreateScript(cx, fun));
3085 if (!funScript) {
3086 goto error;
3087 }
3088
3089 // Enter the callee's realm if this is a cross-realm call. Use
3090 // MakeScopeExit to leave this realm on all error/JIT-return paths
3091 // below.
3092 const bool isCrossRealm = cx->realm() != funScript->realm();
3093 if (isCrossRealm) {
3094 cx->enterRealmOf(funScript);
3095 }
3096 auto leaveRealmGuard =
3097 mozilla::MakeScopeExit([isCrossRealm, cx, &script] {
3098 if (isCrossRealm) {
3099 cx->leaveRealm(script->realm());
3100 }
3101 });
3102
3103 if (construct && !MaybeCreateThisForConstructor(cx, args)) {
3104 goto error;
3105 }
3106
3107 {
3108 InvokeState state(cx, args, construct);
3109
3110 jit::EnterJitStatus status = jit::MaybeEnterJit(cx, state);
3111 switch (status) {
3112 case jit::EnterJitStatus::Error:
3113 goto error;
3114 case jit::EnterJitStatus::Ok:
3115 interpReturnOK = true;
3116 CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0);
3117 REGS(activation.regs()).sp = args.spAfterCall();
3118 goto jit_return;
3119 case jit::EnterJitStatus::NotEntered:
3120 break;
3121 }
3122
3123#ifdef NIGHTLY_BUILD1
3124 // If entry trampolines are enabled, call back into
3125 // MaybeEnterInterpreterTrampoline so we can generate an
3126 // entry trampoline for the new frame.
3127 if (jit::JitOptions.emitInterpreterEntryTrampoline) {
3128 if (MaybeEnterInterpreterTrampoline(cx, state)) {
3129 interpReturnOK = true;
3130 CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0);
3131 REGS(activation.regs()).sp = args.spAfterCall();
3132 goto jit_return;
3133 }
3134 goto error;
3135 }
3136#endif
3137 }
3138
3139 funScript = fun->nonLazyScript();
3140
3141 if (!activation.pushInlineFrame(args, funScript, construct)) {
3142 goto error;
3143 }
3144 leaveRealmGuard.release(); // We leave the callee's realm when we
3145 // call popInlineFrame.
3146 }
3147
3148 SET_SCRIPT(REGS.fp()->script())do { script = ((activation.regs()).fp()->script()); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(cx->
realm() == script->realm())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->realm() == script->
realm()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cx->realm() == script->realm()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3148); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == script->realm()"
")"); do { *((volatile int*)__null) = 3148; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); if (DebugAPI
::hasAnyBreakpointsOrStepMode(script) || script->hasScriptCounts
()) activation.enableInterruptsUnconditionally(); } while (0)
;
3149
3150 if (!REGS(activation.regs()).fp()->prologue(cx)) {
3151 goto prologue_error;
3152 }
3153
3154 if (!DebugAPI::onEnterFrame(cx, REGS(activation.regs()).fp())) {
3155 goto error;
3156 }
3157
3158 // Increment the coverage for the main entry point.
3159 INIT_COVERAGE()do { if (!script->hasScriptCounts()) { if (cx->realm()->
collectCoverageForDebug()) { if (!script->initScriptCounts
(cx)) goto error; } } } while (0)
;
3160 COUNT_COVERAGE_MAIN()do { jsbytecode* main = script->main(); if (!BytecodeIsJumpTarget
(JSOp(*main))) do { if (script->hasScriptCounts()) { PCCounts
* counts = script->maybeGetPCCounts(main); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(counts)
>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(counts))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3160); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 3160; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0); } while (0)
;
3161
3162 /* Load first op and dispatch it (safe since JSOp::RetRval). */
3163 ADVANCE_AND_DISPATCH(0)do { (activation.regs()).pc += (0); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
3164 }
3165
3166 CASE(OptimizeSpreadCall)label_OptimizeSpreadCall: {
3167 ReservedRooted<Value> val(&rootValue0, REGS(activation.regs()).sp[-1]);
3168 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
3169
3170 if (!OptimizeSpreadCall(cx, val, rval)) {
3171 goto error;
3172 }
3173 }
3174 END_CASE(OptimizeSpreadCall)do { (activation.regs()).pc += (JSOpLength_OptimizeSpreadCall
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3175
3176 CASE(ThrowMsg)label_ThrowMsg: {
3177 MOZ_ALWAYS_FALSE(ThrowMsgOperation(cx, GET_UINT8(REGS.pc)))do { if ((__builtin_expect(!!(!(ThrowMsgOperation(cx, GET_UINT8
((activation.regs()).pc)))), 1))) { } else { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(false)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(false))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("false" " (" "!(ThrowMsgOperation(cx, GET_UINT8((activation.regs()).pc)))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3177); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowMsgOperation(cx, GET_UINT8((activation.regs()).pc)))"
")"); do { *((volatile int*)__null) = 3177; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
3178 goto error;
3179 }
3180 END_CASE(ThrowMsg)do { (activation.regs()).pc += (JSOpLength_ThrowMsg); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3181
3182 CASE(ImplicitThis)label_ImplicitThis: {
3183 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
3184 ReservedRooted<JSObject*> envObj(&rootObject0,
3185 REGS(activation.regs()).fp()->environmentChain());
3186 ReservedRooted<JSObject*> env(&rootObject1);
3187 if (!LookupNameWithGlobalDefault(cx, name, envObj, &env)) {
3188 goto error;
3189 }
3190
3191 Value v = ComputeImplicitThis(env);
3192 PUSH_COPY(v)do { *(activation.regs()).sp++ = (v); cx->debugOnlyCheck((
activation.regs()).sp[-1]); } while (0)
;
3193 }
3194 END_CASE(ImplicitThis)do { (activation.regs()).pc += (JSOpLength_ImplicitThis); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3195
3196 CASE(GetGName)label_GetGName: {
3197 ReservedRooted<Value> rval(&rootValue0);
3198 ReservedRooted<JSObject*> env(&rootObject0,
3199 &cx->global()->lexicalEnvironment());
3200 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
3201 MOZ_ASSERT(!script->hasNonSyntacticScope())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!script->hasNonSyntacticScope())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!script->hasNonSyntacticScope
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!script->hasNonSyntacticScope()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3201); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!script->hasNonSyntacticScope()"
")"); do { *((volatile int*)__null) = 3201; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3202 if (!GetNameOperation(cx, env, name, JSOp(REGS(activation.regs()).pc[JSOpLength_GetGName]),
3203 &rval)) {
3204 goto error;
3205 }
3206
3207 PUSH_COPY(rval)do { *(activation.regs()).sp++ = (rval); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3208 }
3209 END_CASE(GetGName)do { (activation.regs()).pc += (JSOpLength_GetGName); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3210
3211 CASE(GetName)label_GetName: {
3212 ReservedRooted<Value> rval(&rootValue0);
3213 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
3214 if (!GetNameOperation(cx, REGS(activation.regs()).fp()->environmentChain(), name,
3215 JSOp(REGS(activation.regs()).pc[JSOpLength_GetName]), &rval)) {
3216 goto error;
3217 }
3218
3219 PUSH_COPY(rval)do { *(activation.regs()).sp++ = (rval); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3220 }
3221 END_CASE(GetName)do { (activation.regs()).pc += (JSOpLength_GetName); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3222
3223 CASE(GetImport)label_GetImport: {
3224 PUSH_NULL()(activation.regs()).sp++->setNull();
3225 MutableHandleValue rval = REGS(activation.regs()).stackHandleAt(-1);
3226 HandleObject envChain = REGS(activation.regs()).fp()->environmentChain();
3227 if (!GetImportOperation(cx, envChain, script, REGS(activation.regs()).pc, rval)) {
3228 goto error;
3229 }
3230 }
3231 END_CASE(GetImport)do { (activation.regs()).pc += (JSOpLength_GetImport); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3232
3233 CASE(GetIntrinsic)label_GetIntrinsic: {
3234 ReservedRooted<Value> rval(&rootValue0);
3235 if (!GetIntrinsicOperation(cx, script, REGS(activation.regs()).pc, &rval)) {
3236 goto error;
3237 }
3238
3239 PUSH_COPY(rval)do { *(activation.regs()).sp++ = (rval); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3240 }
3241 END_CASE(GetIntrinsic)do { (activation.regs()).pc += (JSOpLength_GetIntrinsic); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3242
3243 CASE(Uint16)label_Uint16: { PUSH_INT32((int32_t)GET_UINT16(REGS.pc))(activation.regs()).sp++->setInt32((int32_t)GET_UINT16((activation
.regs()).pc))
; }
3244 END_CASE(Uint16)do { (activation.regs()).pc += (JSOpLength_Uint16); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3245
3246 CASE(Uint24)label_Uint24: { PUSH_INT32((int32_t)GET_UINT24(REGS.pc))(activation.regs()).sp++->setInt32((int32_t)GET_UINT24((activation
.regs()).pc))
; }
3247 END_CASE(Uint24)do { (activation.regs()).pc += (JSOpLength_Uint24); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3248
3249 CASE(Int8)label_Int8: { PUSH_INT32(GET_INT8(REGS.pc))(activation.regs()).sp++->setInt32(GET_INT8((activation.regs
()).pc))
; }
3250 END_CASE(Int8)do { (activation.regs()).pc += (JSOpLength_Int8); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3251
3252 CASE(Int32)label_Int32: { PUSH_INT32(GET_INT32(REGS.pc))(activation.regs()).sp++->setInt32(GET_INT32((activation.regs
()).pc))
; }
3253 END_CASE(Int32)do { (activation.regs()).pc += (JSOpLength_Int32); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3254
3255 CASE(Double)label_Double: { PUSH_COPY(GET_INLINE_VALUE(REGS.pc))do { *(activation.regs()).sp++ = (GET_INLINE_VALUE((activation
.regs()).pc)); cx->debugOnlyCheck((activation.regs()).sp[-
1]); } while (0)
; }
3256 END_CASE(Double)do { (activation.regs()).pc += (JSOpLength_Double); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3257
3258 CASE(String)label_String: { PUSH_STRING(script->getString(REGS.pc))do { (activation.regs()).sp++->setString(script->getString
((activation.regs()).pc)); cx->debugOnlyCheck((activation.
regs()).sp[-1]); } while (0)
; }
3259 END_CASE(String)do { (activation.regs()).pc += (JSOpLength_String); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3260
3261 CASE(ToString)label_ToString: {
3262 MutableHandleValue oper = REGS(activation.regs()).stackHandleAt(-1);
3263
3264 if (!oper.isString()) {
3265 JSString* operString = ToString<CanGC>(cx, oper);
3266 if (!operString) {
3267 goto error;
3268 }
3269 oper.setString(operString);
3270 }
3271 }
3272 END_CASE(ToString)do { (activation.regs()).pc += (JSOpLength_ToString); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3273
3274 CASE(Symbol)label_Symbol: {
3275 PUSH_SYMBOL(cx->wellKnownSymbols().get(GET_UINT8(REGS.pc)))(activation.regs()).sp++->setSymbol(cx->wellKnownSymbols
().get(GET_UINT8((activation.regs()).pc)))
;
3276 }
3277 END_CASE(Symbol)do { (activation.regs()).pc += (JSOpLength_Symbol); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3278
3279 CASE(Object)label_Object: {
3280 MOZ_ASSERT(script->treatAsRunOnce())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(script->treatAsRunOnce())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(script->treatAsRunOnce())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("script->treatAsRunOnce()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3280); AnnotateMozCrashReason("MOZ_ASSERT" "(" "script->treatAsRunOnce()"
")"); do { *((volatile int*)__null) = 3280; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3281 PUSH_OBJECT(*script->getObject(REGS.pc))do { (activation.regs()).sp++->setObject(*script->getObject
((activation.regs()).pc)); cx->debugOnlyCheck((activation.
regs()).sp[-1]); } while (0)
;
3282 }
3283 END_CASE(Object)do { (activation.regs()).pc += (JSOpLength_Object); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3284
3285 CASE(CallSiteObj)label_CallSiteObj: {
3286 JSObject* cso = script->getObject(REGS(activation.regs()).pc);
3287 MOZ_ASSERT(!cso->as<ArrayObject>().isExtensible())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cso->as<ArrayObject>().isExtensible())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!cso->as<ArrayObject>().isExtensible()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!cso->as<ArrayObject>().isExtensible()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3287); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cso->as<ArrayObject>().isExtensible()"
")"); do { *((volatile int*)__null) = 3287; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3288 MOZ_ASSERT(cso->as<ArrayObject>().containsPure(cx->names().raw))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cso->as<ArrayObject>().containsPure(cx->
names().raw))>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(cso->as<ArrayObject>().containsPure
(cx->names().raw)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cso->as<ArrayObject>().containsPure(cx->names().raw)"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3288); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cso->as<ArrayObject>().containsPure(cx->names().raw)"
")"); do { *((volatile int*)__null) = 3288; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3289 PUSH_OBJECT(*cso)do { (activation.regs()).sp++->setObject(*cso); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3290 }
3291 END_CASE(CallSiteObj)do { (activation.regs()).pc += (JSOpLength_CallSiteObj); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3292
3293 CASE(RegExp)label_RegExp: {
3294 /*
3295 * Push a regexp object cloned from the regexp literal object mapped by
3296 * the bytecode at pc.
3297 */
3298 ReservedRooted<JSObject*> re(&rootObject0, script->getRegExp(REGS(activation.regs()).pc));
3299 JSObject* obj = CloneRegExpObject(cx, re.as<RegExpObject>());
3300 if (!obj) {
3301 goto error;
3302 }
3303 PUSH_OBJECT(*obj)do { (activation.regs()).sp++->setObject(*obj); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3304 }
3305 END_CASE(RegExp)do { (activation.regs()).pc += (JSOpLength_RegExp); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3306
3307 CASE(Zero)label_Zero: { PUSH_INT32(0)(activation.regs()).sp++->setInt32(0); }
3308 END_CASE(Zero)do { (activation.regs()).pc += (JSOpLength_Zero); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3309
3310 CASE(One)label_One: { PUSH_INT32(1)(activation.regs()).sp++->setInt32(1); }
3311 END_CASE(One)do { (activation.regs()).pc += (JSOpLength_One); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3312
3313 CASE(Null)label_Null: { PUSH_NULL()(activation.regs()).sp++->setNull(); }
3314 END_CASE(Null)do { (activation.regs()).pc += (JSOpLength_Null); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3315
3316 CASE(False)label_False: { PUSH_BOOLEAN(false)(activation.regs()).sp++->setBoolean(false); }
3317 END_CASE(False)do { (activation.regs()).pc += (JSOpLength_False); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3318
3319 CASE(True)label_True: { PUSH_BOOLEAN(true)(activation.regs()).sp++->setBoolean(true); }
3320 END_CASE(True)do { (activation.regs()).pc += (JSOpLength_True); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3321
3322 CASE(TableSwitch)label_TableSwitch: {
3323 jsbytecode* pc2 = REGS(activation.regs()).pc;
3324 int32_t len = GET_JUMP_OFFSET(pc2);
3325
3326 /*
3327 * ECMAv2+ forbids conversion of discriminant, so we will skip to the
3328 * default case if the discriminant isn't already an int jsval. (This
3329 * opcode is emitted only for dense int-domain switches.)
3330 */
3331 const Value& rref = *--REGS(activation.regs()).sp;
3332 int32_t i;
3333 if (rref.isInt32()) {
3334 i = rref.toInt32();
3335 } else {
3336 /* Use mozilla::NumberEqualsInt32 to treat -0 (double) as 0. */
3337 if (!rref.isDouble() || !NumberEqualsInt32(rref.toDouble(), &i)) {
3338 ADVANCE_AND_DISPATCH(len)do { (activation.regs()).pc += (len); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
3339 }
3340 }
3341
3342 pc2 += JUMP_OFFSET_LEN;
3343 int32_t low = GET_JUMP_OFFSET(pc2);
3344 pc2 += JUMP_OFFSET_LEN;
3345 int32_t high = GET_JUMP_OFFSET(pc2);
3346
3347 i = uint32_t(i) - uint32_t(low);
3348 if (uint32_t(i) < uint32_t(high - low + 1)) {
3349 len = script->tableSwitchCaseOffset(REGS(activation.regs()).pc, uint32_t(i)) -
3350 script->pcToOffset(REGS(activation.regs()).pc);
3351 }
3352 ADVANCE_AND_DISPATCH(len)do { (activation.regs()).pc += (len); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
3353 }
3354
3355 CASE(Arguments)label_Arguments: {
3356 MOZ_ASSERT(script->needsArgsObj())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(script->needsArgsObj())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(script->needsArgsObj())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("script->needsArgsObj()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3356); AnnotateMozCrashReason("MOZ_ASSERT" "(" "script->needsArgsObj()"
")"); do { *((volatile int*)__null) = 3356; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3357 ArgumentsObject* obj = ArgumentsObject::createExpected(cx, REGS(activation.regs()).fp());
3358 if (!obj) {
3359 goto error;
3360 }
3361 PUSH_COPY(ObjectValue(*obj))do { *(activation.regs()).sp++ = (ObjectValue(*obj)); cx->
debugOnlyCheck((activation.regs()).sp[-1]); } while (0)
;
3362 }
3363 END_CASE(Arguments)do { (activation.regs()).pc += (JSOpLength_Arguments); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3364
3365 CASE(Rest)label_Rest: {
3366 ReservedRooted<JSObject*> rest(&rootObject0,
3367 REGS(activation.regs()).fp()->createRestParameter(cx));
3368 if (!rest) {
3369 goto error;
3370 }
3371 PUSH_COPY(ObjectValue(*rest))do { *(activation.regs()).sp++ = (ObjectValue(*rest)); cx->
debugOnlyCheck((activation.regs()).sp[-1]); } while (0)
;
3372 }
3373 END_CASE(Rest)do { (activation.regs()).pc += (JSOpLength_Rest); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3374
3375 CASE(GetAliasedVar)label_GetAliasedVar: {
3376 EnvironmentCoordinate ec = EnvironmentCoordinate(REGS(activation.regs()).pc);
3377 ReservedRooted<Value> val(
3378 &rootValue0, REGS(activation.regs()).fp()->aliasedEnvironment(ec).aliasedBinding(ec));
3379
3380 ASSERT_UNINITIALIZED_ALIASED_LEXICAL(val)do { if (IsUninitializedLexical(val)) { JSOp next = JSOp(*GetNextPc
((activation.regs()).pc)); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(next == JSOp::CheckThis ||
next == JSOp::CheckReturn || next == JSOp::CheckThisReinit ||
next == JSOp::CheckAliasedLexical)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(next == JSOp::CheckThis || next
== JSOp::CheckReturn || next == JSOp::CheckThisReinit || next
== JSOp::CheckAliasedLexical))), 0))) { do { } while (false)
; MOZ_ReportAssertionFailure("next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3380); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
")"); do { *((volatile int*)__null) = 3380; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
0)
;
3381
3382 PUSH_COPY(val)do { *(activation.regs()).sp++ = (val); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3383 }
3384 END_CASE(GetAliasedVar)do { (activation.regs()).pc += (JSOpLength_GetAliasedVar); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3385
3386 CASE(GetAliasedDebugVar)label_GetAliasedDebugVar: {
3387 EnvironmentCoordinate ec = EnvironmentCoordinate(REGS(activation.regs()).pc);
3388 ReservedRooted<Value> val(
3389 &rootValue0,
3390 REGS(activation.regs()).fp()->aliasedEnvironmentMaybeDebug(ec).aliasedBinding(ec));
3391
3392 ASSERT_UNINITIALIZED_ALIASED_LEXICAL(val)do { if (IsUninitializedLexical(val)) { JSOp next = JSOp(*GetNextPc
((activation.regs()).pc)); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(next == JSOp::CheckThis ||
next == JSOp::CheckReturn || next == JSOp::CheckThisReinit ||
next == JSOp::CheckAliasedLexical)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(next == JSOp::CheckThis || next
== JSOp::CheckReturn || next == JSOp::CheckThisReinit || next
== JSOp::CheckAliasedLexical))), 0))) { do { } while (false)
; MOZ_ReportAssertionFailure("next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3392); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckAliasedLexical"
")"); do { *((volatile int*)__null) = 3392; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
0)
;
3393
3394 PUSH_COPY(val)do { *(activation.regs()).sp++ = (val); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3395 }
3396 END_CASE(GetAliasedVar)do { (activation.regs()).pc += (JSOpLength_GetAliasedVar); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3397
3398 CASE(SetAliasedVar)label_SetAliasedVar: {
3399 EnvironmentCoordinate ec = EnvironmentCoordinate(REGS(activation.regs()).pc);
3400 EnvironmentObject& obj = REGS(activation.regs()).fp()->aliasedEnvironment(ec);
3401 MOZ_ASSERT(!IsUninitializedLexical(obj.aliasedBinding(ec)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!IsUninitializedLexical(obj.aliasedBinding(ec)))>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(!IsUninitializedLexical(obj.aliasedBinding(ec))))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("!IsUninitializedLexical(obj.aliasedBinding(ec))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3401); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!IsUninitializedLexical(obj.aliasedBinding(ec))"
")"); do { *((volatile int*)__null) = 3401; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3402 obj.setAliasedBinding(ec, REGS(activation.regs()).sp[-1]);
3403 }
3404 END_CASE(SetAliasedVar)do { (activation.regs()).pc += (JSOpLength_SetAliasedVar); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3405
3406 CASE(ThrowSetConst)label_ThrowSetConst: {
3407 ReportRuntimeLexicalError(cx, JSMSG_BAD_CONST_ASSIGN, script, REGS(activation.regs()).pc);
3408 goto error;
3409 }
3410 END_CASE(ThrowSetConst)do { (activation.regs()).pc += (JSOpLength_ThrowSetConst); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3411
3412 CASE(CheckLexical)label_CheckLexical: {
3413 if (REGS(activation.regs()).sp[-1].isMagic(JS_UNINITIALIZED_LEXICAL)) {
3414 ReportRuntimeLexicalError(cx, JSMSG_UNINITIALIZED_LEXICAL, script,
3415 REGS(activation.regs()).pc);
3416 goto error;
3417 }
3418 }
3419 END_CASE(CheckLexical)do { (activation.regs()).pc += (JSOpLength_CheckLexical); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3420
3421 CASE(CheckAliasedLexical)label_CheckAliasedLexical: {
3422 if (REGS(activation.regs()).sp[-1].isMagic(JS_UNINITIALIZED_LEXICAL)) {
3423 ReportRuntimeLexicalError(cx, JSMSG_UNINITIALIZED_LEXICAL, script,
3424 REGS(activation.regs()).pc);
3425 goto error;
3426 }
3427 }
3428 END_CASE(CheckAliasedLexical)do { (activation.regs()).pc += (JSOpLength_CheckAliasedLexical
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3429
3430 CASE(InitLexical)label_InitLexical: {
3431 uint32_t i = GET_LOCALNO(REGS(activation.regs()).pc);
3432 REGS(activation.regs()).fp()->unaliasedLocal(i) = REGS(activation.regs()).sp[-1];
3433 }
3434 END_CASE(InitLexical)do { (activation.regs()).pc += (JSOpLength_InitLexical); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3435
3436 CASE(InitAliasedLexical)label_InitAliasedLexical: {
3437 EnvironmentCoordinate ec = EnvironmentCoordinate(REGS(activation.regs()).pc);
3438 EnvironmentObject& obj = REGS(activation.regs()).fp()->aliasedEnvironment(ec);
3439 obj.setAliasedBinding(ec, REGS(activation.regs()).sp[-1]);
3440 }
3441 END_CASE(InitAliasedLexical)do { (activation.regs()).pc += (JSOpLength_InitAliasedLexical
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3442
3443 CASE(InitGLexical)label_InitGLexical: {
3444 ExtensibleLexicalEnvironmentObject* lexicalEnv;
3445 if (script->hasNonSyntacticScope()) {
3446 lexicalEnv = &REGS(activation.regs()).fp()->extensibleLexicalEnvironment();
3447 } else {
3448 lexicalEnv = &cx->global()->lexicalEnvironment();
3449 }
3450 HandleValue value = REGS(activation.regs()).stackHandleAt(-1);
3451 InitGlobalLexicalOperation(cx, lexicalEnv, script, REGS(activation.regs()).pc, value);
3452 }
3453 END_CASE(InitGLexical)do { (activation.regs()).pc += (JSOpLength_InitGLexical); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3454
3455 CASE(Uninitialized)label_Uninitialized: { PUSH_MAGIC(JS_UNINITIALIZED_LEXICAL)(activation.regs()).sp++->setMagic(JS_UNINITIALIZED_LEXICAL
)
; }
3456 END_CASE(Uninitialized)do { (activation.regs()).pc += (JSOpLength_Uninitialized); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3457
3458 CASE(GetArg)label_GetArg: {
3459 unsigned i = GET_ARGNO(REGS(activation.regs()).pc);
3460 if (script->argsObjAliasesFormals()) {
3461 PUSH_COPY(REGS.fp()->argsObj().arg(i))do { *(activation.regs()).sp++ = ((activation.regs()).fp()->
argsObj().arg(i)); cx->debugOnlyCheck((activation.regs()).
sp[-1]); } while (0)
;
3462 } else {
3463 PUSH_COPY(REGS.fp()->unaliasedFormal(i))do { *(activation.regs()).sp++ = ((activation.regs()).fp()->
unaliasedFormal(i)); cx->debugOnlyCheck((activation.regs()
).sp[-1]); } while (0)
;
3464 }
3465 }
3466 END_CASE(GetArg)do { (activation.regs()).pc += (JSOpLength_GetArg); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3467
3468 CASE(GetFrameArg)label_GetFrameArg: {
3469 uint32_t i = GET_ARGNO(REGS(activation.regs()).pc);
3470 PUSH_COPY(REGS.fp()->unaliasedFormal(i, DONT_CHECK_ALIASING))do { *(activation.regs()).sp++ = ((activation.regs()).fp()->
unaliasedFormal(i, DONT_CHECK_ALIASING)); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3471 }
3472 END_CASE(GetFrameArg)do { (activation.regs()).pc += (JSOpLength_GetFrameArg); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3473
3474 CASE(SetArg)label_SetArg: {
3475 unsigned i = GET_ARGNO(REGS(activation.regs()).pc);
3476 if (script->argsObjAliasesFormals()) {
3477 REGS(activation.regs()).fp()->argsObj().setArg(i, REGS(activation.regs()).sp[-1]);
3478 } else {
3479 REGS(activation.regs()).fp()->unaliasedFormal(i) = REGS(activation.regs()).sp[-1];
3480 }
3481 }
3482 END_CASE(SetArg)do { (activation.regs()).pc += (JSOpLength_SetArg); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3483
3484 CASE(GetLocal)label_GetLocal: {
3485 uint32_t i = GET_LOCALNO(REGS(activation.regs()).pc);
3486 PUSH_COPY_SKIP_CHECK(REGS.fp()->unaliasedLocal(i))*(activation.regs()).sp++ = ((activation.regs()).fp()->unaliasedLocal
(i))
;
3487
3488#ifdef DEBUG1
3489 if (IsUninitializedLexical(REGS(activation.regs()).sp[-1])) {
3490 JSOp next = JSOp(*GetNextPc(REGS(activation.regs()).pc));
3491 MOZ_ASSERT(next == JSOp::CheckThis || next == JSOp::CheckReturn ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckLexical
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckLexical
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3492); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckLexical"
")"); do { *((volatile int*)__null) = 3492; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
3492 next == JSOp::CheckThisReinit || next == JSOp::CheckLexical)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckLexical
)>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(next == JSOp::CheckThis || next == JSOp::CheckReturn
|| next == JSOp::CheckThisReinit || next == JSOp::CheckLexical
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckLexical"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3492); AnnotateMozCrashReason("MOZ_ASSERT" "(" "next == JSOp::CheckThis || next == JSOp::CheckReturn || next == JSOp::CheckThisReinit || next == JSOp::CheckLexical"
")"); do { *((volatile int*)__null) = 3492; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3493 }
3494
3495 /*
3496 * Skip the same-compartment assertion if the local will be immediately
3497 * popped. We do not guarantee sync for dead locals when coming in from
3498 * the method JIT, and a GetLocal followed by Pop is not considered to
3499 * be a use of the variable.
3500 */
3501 if (JSOp(REGS(activation.regs()).pc[JSOpLength_GetLocal]) != JSOp::Pop) {
3502 cx->debugOnlyCheck(REGS(activation.regs()).sp[-1]);
3503 }
3504#endif
3505 }
3506 END_CASE(GetLocal)do { (activation.regs()).pc += (JSOpLength_GetLocal); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3507
3508 CASE(SetLocal)label_SetLocal: {
3509 uint32_t i = GET_LOCALNO(REGS(activation.regs()).pc);
3510
3511 MOZ_ASSERT(!IsUninitializedLexical(REGS.fp()->unaliasedLocal(i)))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!IsUninitializedLexical((activation.regs()).fp()->
unaliasedLocal(i)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!IsUninitializedLexical((activation
.regs()).fp()->unaliasedLocal(i))))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("!IsUninitializedLexical((activation.regs()).fp()->unaliasedLocal(i))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3511); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!IsUninitializedLexical((activation.regs()).fp()->unaliasedLocal(i))"
")"); do { *((volatile int*)__null) = 3511; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3512
3513 REGS(activation.regs()).fp()->unaliasedLocal(i) = REGS(activation.regs()).sp[-1];
3514 }
3515 END_CASE(SetLocal)do { (activation.regs()).pc += (JSOpLength_SetLocal); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3516
3517 CASE(ArgumentsLength)label_ArgumentsLength: {
3518 MOZ_ASSERT(!script->needsArgsObj())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!script->needsArgsObj())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!script->needsArgsObj()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!script->needsArgsObj()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3518); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!script->needsArgsObj()"
")"); do { *((volatile int*)__null) = 3518; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3519 PUSH_INT32(REGS.fp()->numActualArgs())(activation.regs()).sp++->setInt32((activation.regs()).fp(
)->numActualArgs())
;
3520 }
3521 END_CASE(ArgumentsLength)do { (activation.regs()).pc += (JSOpLength_ArgumentsLength); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3522
3523 CASE(GetActualArg)label_GetActualArg: {
3524 MOZ_ASSERT(!script->needsArgsObj())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!script->needsArgsObj())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!script->needsArgsObj()))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!script->needsArgsObj()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3524); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!script->needsArgsObj()"
")"); do { *((volatile int*)__null) = 3524; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3525 uint32_t index = REGS(activation.regs()).sp[-1].toInt32();
3526 REGS(activation.regs()).sp[-1] = REGS(activation.regs()).fp()->unaliasedActual(index);
3527 }
3528 END_CASE(GetActualArg)do { (activation.regs()).pc += (JSOpLength_GetActualArg); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3529
3530 CASE(GlobalOrEvalDeclInstantiation)label_GlobalOrEvalDeclInstantiation: {
3531 GCThingIndex lastFun = GET_GCTHING_INDEX(REGS(activation.regs()).pc);
3532 HandleObject env = REGS(activation.regs()).fp()->environmentChain();
3533 if (!GlobalOrEvalDeclInstantiation(cx, env, script, lastFun)) {
3534 goto error;
3535 }
3536 }
3537 END_CASE(GlobalOrEvalDeclInstantiation)do { (activation.regs()).pc += (JSOpLength_GlobalOrEvalDeclInstantiation
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3538
3539 CASE(Lambda)label_Lambda: {
3540 /* Load the specified function object literal. */
3541 ReservedRooted<JSFunction*> fun(&rootFunction0,
3542 script->getFunction(REGS(activation.regs()).pc));
3543 JSObject* obj = Lambda(cx, fun, REGS(activation.regs()).fp()->environmentChain());
3544 if (!obj) {
3545 goto error;
3546 }
3547
3548 MOZ_ASSERT(obj->staticPrototype())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(obj->staticPrototype())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(obj->staticPrototype())))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("obj->staticPrototype()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3548); AnnotateMozCrashReason("MOZ_ASSERT" "(" "obj->staticPrototype()"
")"); do { *((volatile int*)__null) = 3548; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3549 PUSH_OBJECT(*obj)do { (activation.regs()).sp++->setObject(*obj); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3550 }
3551 END_CASE(Lambda)do { (activation.regs()).pc += (JSOpLength_Lambda); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3552
3553 CASE(ToAsyncIter)label_ToAsyncIter: {
3554 ReservedRooted<Value> nextMethod(&rootValue0, REGS(activation.regs()).sp[-1]);
3555 ReservedRooted<JSObject*> iter(&rootObject1, &REGS(activation.regs()).sp[-2].toObject());
3556 JSObject* asyncIter = CreateAsyncFromSyncIterator(cx, iter, nextMethod);
3557 if (!asyncIter) {
3558 goto error;
3559 }
3560
3561 REGS(activation.regs()).sp--;
3562 REGS(activation.regs()).sp[-1].setObject(*asyncIter);
3563 }
3564 END_CASE(ToAsyncIter)do { (activation.regs()).pc += (JSOpLength_ToAsyncIter); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3565
3566 CASE(CanSkipAwait)label_CanSkipAwait: {
3567 ReservedRooted<Value> val(&rootValue0, REGS(activation.regs()).sp[-1]);
3568 bool canSkip;
3569 if (!CanSkipAwait(cx, val, &canSkip)) {
3570 goto error;
3571 }
3572
3573 PUSH_BOOLEAN(canSkip)(activation.regs()).sp++->setBoolean(canSkip);
3574 }
3575 END_CASE(CanSkipAwait)do { (activation.regs()).pc += (JSOpLength_CanSkipAwait); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3576
3577 CASE(MaybeExtractAwaitValue)label_MaybeExtractAwaitValue: {
3578 MutableHandleValue val = REGS(activation.regs()).stackHandleAt(-2);
3579 ReservedRooted<Value> canSkip(&rootValue0, REGS(activation.regs()).sp[-1]);
3580
3581 if (canSkip.toBoolean()) {
3582 if (!ExtractAwaitValue(cx, val, val)) {
3583 goto error;
3584 }
3585 }
3586 }
3587 END_CASE(MaybeExtractAwaitValue)do { (activation.regs()).pc += (JSOpLength_MaybeExtractAwaitValue
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3588
3589 CASE(AsyncAwait)label_AsyncAwait: {
3590 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3590); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3590; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3591 ReservedRooted<JSObject*> gen(&rootObject1, &REGS(activation.regs()).sp[-1].toObject());
3592 ReservedRooted<Value> value(&rootValue0, REGS(activation.regs()).sp[-2]);
3593 JSObject* promise =
3594 AsyncFunctionAwait(cx, gen.as<AsyncFunctionGeneratorObject>(), value);
3595 if (!promise) {
3596 goto error;
3597 }
3598
3599 REGS(activation.regs()).sp--;
3600 REGS(activation.regs()).sp[-1].setObject(*promise);
3601 }
3602 END_CASE(AsyncAwait)do { (activation.regs()).pc += (JSOpLength_AsyncAwait); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3603
3604 CASE(AsyncResolve)label_AsyncResolve: {
3605 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3605); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3605; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3606 ReservedRooted<JSObject*> gen(&rootObject1, &REGS(activation.regs()).sp[-1].toObject());
3607 ReservedRooted<Value> value(&rootValue0, REGS(activation.regs()).sp[-2]);
3608 JSObject* promise = AsyncFunctionResolve(
3609 cx, gen.as<AsyncFunctionGeneratorObject>(), value);
3610 if (!promise) {
3611 goto error;
3612 }
3613
3614 REGS(activation.regs()).sp--;
3615 REGS(activation.regs()).sp[-1].setObject(*promise);
3616 }
3617 END_CASE(AsyncResolve)do { (activation.regs()).pc += (JSOpLength_AsyncResolve); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3618
3619 CASE(AsyncReject)label_AsyncReject: {
3620 MOZ_ASSERT(REGS.stackDepth() >= 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 3)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 3))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 3"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3620); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 3"
")"); do { *((volatile int*)__null) = 3620; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3621 ReservedRooted<JSObject*> gen(&rootObject1, &REGS(activation.regs()).sp[-1].toObject());
3622 ReservedRooted<Value> stack(&rootValue0, REGS(activation.regs()).sp[-2]);
3623 ReservedRooted<Value> reason(&rootValue1, REGS(activation.regs()).sp[-3]);
3624 JSObject* promise = AsyncFunctionReject(
3625 cx, gen.as<AsyncFunctionGeneratorObject>(), reason, stack);
3626 if (!promise) {
3627 goto error;
3628 }
3629
3630 REGS(activation.regs()).sp -= 2;
3631 REGS(activation.regs()).sp[-1].setObject(*promise);
3632 }
3633 END_CASE(AsyncReject)do { (activation.regs()).pc += (JSOpLength_AsyncReject); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3634
3635 CASE(SetFunName)label_SetFunName: {
3636 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3636); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3636; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3637 FunctionPrefixKind prefixKind = FunctionPrefixKind(GET_UINT8(REGS(activation.regs()).pc));
3638 ReservedRooted<Value> name(&rootValue0, REGS(activation.regs()).sp[-1]);
3639 ReservedRooted<JSFunction*> fun(&rootFunction0,
3640 &REGS(activation.regs()).sp[-2].toObject().as<JSFunction>());
3641 if (!SetFunctionName(cx, fun, name, prefixKind)) {
3642 goto error;
3643 }
3644
3645 REGS(activation.regs()).sp--;
3646 }
3647 END_CASE(SetFunName)do { (activation.regs()).pc += (JSOpLength_SetFunName); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3648
3649 CASE(Callee)label_Callee: {
3650 MOZ_ASSERT(REGS.fp()->isFunctionFrame())do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).fp()->isFunctionFrame())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isFunctionFrame()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isFunctionFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3650); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isFunctionFrame()"
")"); do { *((volatile int*)__null) = 3650; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3651 PUSH_COPY(REGS.fp()->calleev())do { *(activation.regs()).sp++ = ((activation.regs()).fp()->
calleev()); cx->debugOnlyCheck((activation.regs()).sp[-1])
; } while (0)
;
3652 }
3653 END_CASE(Callee)do { (activation.regs()).pc += (JSOpLength_Callee); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3654
3655 CASE(InitPropGetter)label_InitPropGetter:
3656 CASE(InitHiddenPropGetter)label_InitHiddenPropGetter:
3657 CASE(InitPropSetter)label_InitPropSetter:
3658 CASE(InitHiddenPropSetter)label_InitHiddenPropSetter: {
3659 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3659); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3659; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3660
3661 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-2].toObject());
3662 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
3663 ReservedRooted<JSObject*> val(&rootObject1, &REGS(activation.regs()).sp[-1].toObject());
3664
3665 if (!InitPropGetterSetterOperation(cx, REGS(activation.regs()).pc, obj, name, val)) {
3666 goto error;
3667 }
3668
3669 REGS(activation.regs()).sp--;
3670 }
3671 END_CASE(InitPropGetter)do { (activation.regs()).pc += (JSOpLength_InitPropGetter); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3672
3673 CASE(InitElemGetter)label_InitElemGetter:
3674 CASE(InitHiddenElemGetter)label_InitHiddenElemGetter:
3675 CASE(InitElemSetter)label_InitElemSetter:
3676 CASE(InitHiddenElemSetter)label_InitHiddenElemSetter: {
3677 MOZ_ASSERT(REGS.stackDepth() >= 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 3)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 3))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 3"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3677); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 3"
")"); do { *((volatile int*)__null) = 3677; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3678
3679 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-3].toObject());
3680 ReservedRooted<Value> idval(&rootValue0, REGS(activation.regs()).sp[-2]);
3681 ReservedRooted<JSObject*> val(&rootObject1, &REGS(activation.regs()).sp[-1].toObject());
3682
3683 if (!InitElemGetterSetterOperation(cx, REGS(activation.regs()).pc, obj, idval, val)) {
3684 goto error;
3685 }
3686
3687 REGS(activation.regs()).sp -= 2;
3688 }
3689 END_CASE(InitElemGetter)do { (activation.regs()).pc += (JSOpLength_InitElemGetter); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3690
3691 CASE(Hole)label_Hole: { PUSH_MAGIC(JS_ELEMENTS_HOLE)(activation.regs()).sp++->setMagic(JS_ELEMENTS_HOLE); }
3692 END_CASE(Hole)do { (activation.regs()).pc += (JSOpLength_Hole); do { js::gc
::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
3693
3694 CASE(NewInit)label_NewInit: {
3695 JSObject* obj = NewObjectOperation(cx, script, REGS(activation.regs()).pc);
3696
3697 if (!obj) {
3698 goto error;
3699 }
3700 PUSH_OBJECT(*obj)do { (activation.regs()).sp++->setObject(*obj); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3701 }
3702 END_CASE(NewInit)do { (activation.regs()).pc += (JSOpLength_NewInit); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3703
3704 CASE(NewArray)label_NewArray: {
3705 uint32_t length = GET_UINT32(REGS(activation.regs()).pc);
3706 ArrayObject* obj = NewArrayOperation(cx, length);
3707 if (!obj) {
3708 goto error;
3709 }
3710 PUSH_OBJECT(*obj)do { (activation.regs()).sp++->setObject(*obj); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3711 }
3712 END_CASE(NewArray)do { (activation.regs()).pc += (JSOpLength_NewArray); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3713
3714 CASE(NewObject)label_NewObject: {
3715 JSObject* obj = NewObjectOperation(cx, script, REGS(activation.regs()).pc);
3716 if (!obj) {
3717 goto error;
3718 }
3719 PUSH_OBJECT(*obj)do { (activation.regs()).sp++->setObject(*obj); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3720 }
3721 END_CASE(NewObject)do { (activation.regs()).pc += (JSOpLength_NewObject); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3722
3723 CASE(MutateProto)label_MutateProto: {
3724 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3724); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3724; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3725
3726 if (REGS(activation.regs()).sp[-1].isObjectOrNull()) {
3727 ReservedRooted<JSObject*> newProto(&rootObject1,
3728 REGS(activation.regs()).sp[-1].toObjectOrNull());
3729 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-2].toObject());
3730 MOZ_ASSERT(obj->is<PlainObject>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(obj->is<PlainObject>())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(obj->is<PlainObject>
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("obj->is<PlainObject>()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3730); AnnotateMozCrashReason("MOZ_ASSERT" "(" "obj->is<PlainObject>()"
")"); do { *((volatile int*)__null) = 3730; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3731
3732 if (!SetPrototype(cx, obj, newProto)) {
3733 goto error;
3734 }
3735 }
3736
3737 REGS(activation.regs()).sp--;
3738 }
3739 END_CASE(MutateProto)do { (activation.regs()).pc += (JSOpLength_MutateProto); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3740
3741 CASE(InitProp)label_InitProp:
3742 CASE(InitLockedProp)label_InitLockedProp:
3743 CASE(InitHiddenProp)label_InitHiddenProp: {
3744 static_assert(JSOpLength_InitProp == JSOpLength_InitLockedProp,
3745 "initprop and initlockedprop must be the same size");
3746 static_assert(JSOpLength_InitProp == JSOpLength_InitHiddenProp,
3747 "initprop and inithiddenprop must be the same size");
3748 /* Load the property's initial value into rval. */
3749 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3749); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3749; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3750 ReservedRooted<Value> rval(&rootValue0, REGS(activation.regs()).sp[-1]);
3751
3752 /* Load the object being initialized into lval/obj. */
3753 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-2].toObject());
3754
3755 ReservedRooted<PropertyName*> name(&rootName0, script->getName(REGS(activation.regs()).pc));
3756
3757 if (!InitPropertyOperation(cx, REGS(activation.regs()).pc, obj, name, rval)) {
3758 goto error;
3759 }
3760
3761 REGS(activation.regs()).sp--;
3762 }
3763 END_CASE(InitProp)do { (activation.regs()).pc += (JSOpLength_InitProp); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3764
3765 CASE(InitElem)label_InitElem:
3766 CASE(InitHiddenElem)label_InitHiddenElem:
3767 CASE(InitLockedElem)label_InitLockedElem: {
3768 MOZ_ASSERT(REGS.stackDepth() >= 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 3)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 3))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 3"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3768); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 3"
")"); do { *((volatile int*)__null) = 3768; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3769 HandleValue val = REGS(activation.regs()).stackHandleAt(-1);
3770 HandleValue id = REGS(activation.regs()).stackHandleAt(-2);
3771
3772 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-3].toObject());
3773
3774 if (!InitElemOperation(cx, REGS(activation.regs()).pc, obj, id, val)) {
3775 goto error;
3776 }
3777
3778 REGS(activation.regs()).sp -= 2;
3779 }
3780 END_CASE(InitElem)do { (activation.regs()).pc += (JSOpLength_InitElem); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3781
3782 CASE(InitElemArray)label_InitElemArray: {
3783 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3783); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3783; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3784 HandleValue val = REGS(activation.regs()).stackHandleAt(-1);
3785 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-2].toObject());
3786
3787 InitElemArrayOperation(cx, REGS(activation.regs()).pc, obj.as<ArrayObject>(), val);
3788 REGS(activation.regs()).sp--;
3789 }
3790 END_CASE(InitElemArray)do { (activation.regs()).pc += (JSOpLength_InitElemArray); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3791
3792 CASE(InitElemInc)label_InitElemInc: {
3793 MOZ_ASSERT(REGS.stackDepth() >= 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 3)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 3))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 3"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3793); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 3"
")"); do { *((volatile int*)__null) = 3793; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3794 HandleValue val = REGS(activation.regs()).stackHandleAt(-1);
3795
3796 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-3].toObject());
3797
3798 uint32_t index = REGS(activation.regs()).sp[-2].toInt32();
3799 if (!InitElemIncOperation(cx, obj.as<ArrayObject>(), index, val)) {
3800 goto error;
3801 }
3802
3803 REGS(activation.regs()).sp[-2].setInt32(index + 1);
3804 REGS(activation.regs()).sp--;
3805 }
3806 END_CASE(InitElemInc)do { (activation.regs()).pc += (JSOpLength_InitElemInc); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3807
3808#ifdef ENABLE_RECORD_TUPLE
3809 CASE(InitRecord)label_InitRecord: {
3810 uint32_t length = GET_UINT32(REGS(activation.regs()).pc);
3811 RecordType* rec = RecordType::createUninitialized(cx, length);
3812 if (!rec) {
3813 goto error;
3814 }
3815 PUSH_EXTENDED_PRIMITIVE(*rec);
3816 }
3817 END_CASE(InitRecord)do { (activation.regs()).pc += (JSOpLength_InitRecord); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3818
3819 CASE(AddRecordProperty)label_AddRecordProperty: {
3820 MOZ_ASSERT(REGS.stackDepth() >= 3)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 3)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 3))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 3"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3820); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 3"
")"); do { *((volatile int*)__null) = 3820; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3821
3822 ReservedRooted<JSObject*> rec(&rootObject0,
3823 &REGS(activation.regs()).sp[-3].toExtendedPrimitive());
3824 MOZ_ASSERT(rec->is<RecordType>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(rec->is<RecordType>())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(rec->is<RecordType>
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("rec->is<RecordType>()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3824); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rec->is<RecordType>()"
")"); do { *((volatile int*)__null) = 3824; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3825
3826 ReservedRooted<Value> key(&rootValue0, REGS(activation.regs()).sp[-2]);
3827 ReservedRooted<jsid> id(&rootId0);
3828 if (!JS_ValueToId(cx, key, &id)) {
3829 goto error;
3830 }
3831 if (!rec->as<RecordType>().initializeNextProperty(
3832 cx, id, REGS(activation.regs()).stackHandleAt(-1))) {
3833 goto error;
3834 }
3835
3836 REGS(activation.regs()).sp -= 2;
3837 }
3838 END_CASE(AddRecordProperty)do { (activation.regs()).pc += (JSOpLength_AddRecordProperty)
; do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3839
3840 CASE(AddRecordSpread)label_AddRecordSpread: {
3841 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3841); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3841; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3842
3843 if (!AddRecordSpreadOperation(cx, REGS(activation.regs()).stackHandleAt(-2),
3844 REGS(activation.regs()).stackHandleAt(-1))) {
3845 goto error;
3846 }
3847 REGS(activation.regs()).sp--;
3848 }
3849 END_CASE(AddRecordSpread)do { (activation.regs()).pc += (JSOpLength_AddRecordSpread); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3850
3851 CASE(FinishRecord)label_FinishRecord: {
3852 MOZ_ASSERT(REGS.stackDepth() >= 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 1))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3852); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 1"
")"); do { *((volatile int*)__null) = 3852; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3853 RecordType* rec = &REGS(activation.regs()).sp[-1].toExtendedPrimitive().as<RecordType>();
3854 if (!rec->finishInitialization(cx)) {
3855 goto error;
3856 }
3857 }
3858 END_CASE(FinishRecord)do { (activation.regs()).pc += (JSOpLength_FinishRecord); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3859
3860 CASE(InitTuple)label_InitTuple: {
3861 uint32_t length = GET_UINT32(REGS(activation.regs()).pc);
3862 TupleType* tup = TupleType::createUninitialized(cx, length);
3863 if (!tup) {
3864 goto error;
3865 }
3866 PUSH_EXTENDED_PRIMITIVE(*tup);
3867 }
3868 END_CASE(InitTuple)do { (activation.regs()).pc += (JSOpLength_InitTuple); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3869
3870 CASE(AddTupleElement)label_AddTupleElement: {
3871 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3871); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 3871; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3872
3873 ReservedRooted<JSObject*> tup(&rootObject0,
3874 &REGS(activation.regs()).sp[-2].toExtendedPrimitive());
3875 HandleValue val = REGS(activation.regs()).stackHandleAt(-1);
3876
3877 if (!tup->as<TupleType>().initializeNextElement(cx, val)) {
3878 goto error;
3879 }
3880
3881 REGS(activation.regs()).sp--;
3882 }
3883 END_CASE(AddTupleElement)do { (activation.regs()).pc += (JSOpLength_AddTupleElement); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3884
3885 CASE(FinishTuple)label_FinishTuple: {
3886 MOZ_ASSERT(REGS.stackDepth() >= 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 1)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 1))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 1"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3886); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 1"
")"); do { *((volatile int*)__null) = 3886; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3887 TupleType& tup = REGS(activation.regs()).sp[-1].toExtendedPrimitive().as<TupleType>();
3888 tup.finishInitialization(cx);
3889 }
3890 END_CASE(FinishTuple)do { (activation.regs()).pc += (JSOpLength_FinishTuple); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3891#endif
3892
3893 CASE(Exception)label_Exception: {
3894 PUSH_NULL()(activation.regs()).sp++->setNull();
3895 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-1);
3896 if (!GetAndClearException(cx, res)) {
3897 goto error;
3898 }
3899 }
3900 END_CASE(Exception)do { (activation.regs()).pc += (JSOpLength_Exception); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3901
3902 CASE(ExceptionAndStack)label_ExceptionAndStack: {
3903 ReservedRooted<Value> stack(&rootValue0);
3904 if (!cx->getPendingExceptionStack(&stack)) {
3905 goto error;
3906 }
3907 PUSH_NULL()(activation.regs()).sp++->setNull();
3908 MutableHandleValue res = REGS(activation.regs()).stackHandleAt(-1);
3909 if (!GetAndClearException(cx, res)) {
3910 goto error;
3911 }
3912 PUSH_COPY(stack)do { *(activation.regs()).sp++ = (stack); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
3913 }
3914 END_CASE(ExceptionAndStack)do { (activation.regs()).pc += (JSOpLength_ExceptionAndStack)
; do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3915
3916 CASE(Finally)label_Finally: { CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0); }
3917 END_CASE(Finally)do { (activation.regs()).pc += (JSOpLength_Finally); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
3918
3919 CASE(Throw)label_Throw: {
3920 CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0);
3921 ReservedRooted<Value> v(&rootValue0);
3922 POP_COPY_TO(v)(v) = *--(activation.regs()).sp;
3923 MOZ_ALWAYS_FALSE(ThrowOperation(cx, v))do { if ((__builtin_expect(!!(!(ThrowOperation(cx, v))), 1)))
{ } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "!(ThrowOperation(cx, v))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3923); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowOperation(cx, v))" ")"); do { *((volatile int*
)__null) = 3923; __attribute__((nomerge)) ::abort(); } while (
false); } } while (false); } } while (false)
;
3924 /* let the code at error try to catch the exception. */
3925 goto error;
3926 }
3927
3928 CASE(ThrowWithStack)label_ThrowWithStack: {
3929 CHECK_BRANCH()do { if (!CheckForInterrupt(cx)) goto error; } while (0);
3930 ReservedRooted<Value> v(&rootValue0);
3931 ReservedRooted<Value> stack(&rootValue1);
3932 POP_COPY_TO(stack)(stack) = *--(activation.regs()).sp;
3933 POP_COPY_TO(v)(v) = *--(activation.regs()).sp;
3934 MOZ_ALWAYS_FALSE(ThrowWithStackOperation(cx, v, stack))do { if ((__builtin_expect(!!(!(ThrowWithStackOperation(cx, v
, stack))), 1))) { } else { do { static_assert( mozilla::detail
::AssertionConditionType<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "!(ThrowWithStackOperation(cx, v, stack))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3934); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowWithStackOperation(cx, v, stack))" ")"); do { *
((volatile int*)__null) = 3934; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false); } } while (false)
;
3935 /* let the code at error try to catch the exception. */
3936 goto error;
3937 }
3938
3939 CASE(Instanceof)label_Instanceof: {
3940 ReservedRooted<Value> rref(&rootValue0, REGS(activation.regs()).sp[-1]);
3941 if (HandleValue(rref).isPrimitive()) {
3942 ReportValueError(cx, JSMSG_BAD_INSTANCEOF_RHS, -1, rref, nullptr);
3943 goto error;
3944 }
3945 ReservedRooted<JSObject*> obj(&rootObject0, &rref.toObject());
3946 bool cond = false;
3947 if (!InstanceofOperator(cx, obj, REGS(activation.regs()).stackHandleAt(-2), &cond)) {
3948 goto error;
3949 }
3950 REGS(activation.regs()).sp--;
3951 REGS(activation.regs()).sp[-1].setBoolean(cond);
3952 }
3953 END_CASE(Instanceof)do { (activation.regs()).pc += (JSOpLength_Instanceof); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3954
3955 CASE(Debugger)label_Debugger: {
3956 if (!DebugAPI::onDebuggerStatement(cx, REGS(activation.regs()).fp())) {
3957 goto error;
3958 }
3959 }
3960 END_CASE(Debugger)do { (activation.regs()).pc += (JSOpLength_Debugger); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
3961
3962 CASE(PushLexicalEnv)label_PushLexicalEnv: {
3963 ReservedRooted<Scope*> scope(&rootScope0, script->getScope(REGS(activation.regs()).pc));
3964
3965 // Create block environment and push on scope chain.
3966 if (!REGS(activation.regs()).fp()->pushLexicalEnvironment(cx, scope.as<LexicalScope>())) {
3967 goto error;
3968 }
3969 }
3970 END_CASE(PushLexicalEnv)do { (activation.regs()).pc += (JSOpLength_PushLexicalEnv); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3971
3972 CASE(PopLexicalEnv)label_PopLexicalEnv: {
3973#ifdef DEBUG1
3974 Scope* scope = script->lookupScope(REGS(activation.regs()).pc);
3975 MOZ_ASSERT(scope)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(scope)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(scope))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("scope", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3975); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope" ")")
; do { *((volatile int*)__null) = 3975; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3976 MOZ_ASSERT(scope->is<LexicalScope>() || scope->is<ClassBodyScope>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(scope->is<LexicalScope>() || scope->is<
ClassBodyScope>())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope->is<LexicalScope
>() || scope->is<ClassBodyScope>()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("scope->is<LexicalScope>() || scope->is<ClassBodyScope>()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3976); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope->is<LexicalScope>() || scope->is<ClassBodyScope>()"
")"); do { *((volatile int*)__null) = 3976; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3977 MOZ_ASSERT_IF(scope->is<LexicalScope>(),do { if (scope->is<LexicalScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(scope->
as<LexicalScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope->as<LexicalScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("scope->as<LexicalScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3978); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope->as<LexicalScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 3978; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
3978 scope->as<LexicalScope>().hasEnvironment())do { if (scope->is<LexicalScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(scope->
as<LexicalScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope->as<LexicalScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("scope->as<LexicalScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3978); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope->as<LexicalScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 3978; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
3979 MOZ_ASSERT_IF(scope->is<ClassBodyScope>(),do { if (scope->is<ClassBodyScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(scope->
as<ClassBodyScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope->as<ClassBodyScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("scope->as<ClassBodyScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3980); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope->as<ClassBodyScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 3980; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
3980 scope->as<ClassBodyScope>().hasEnvironment())do { if (scope->is<ClassBodyScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(scope->
as<ClassBodyScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope->as<ClassBodyScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("scope->as<ClassBodyScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3980); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope->as<ClassBodyScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 3980; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
3981#endif
3982
3983 if (MOZ_UNLIKELY(cx->realm()->isDebuggee())(__builtin_expect(!!(cx->realm()->isDebuggee()), 0))) {
3984 DebugEnvironments::onPopLexical(cx, REGS(activation.regs()).fp(), REGS(activation.regs()).pc);
3985 }
3986
3987 // Pop block from scope chain.
3988 REGS(activation.regs()).fp()->popOffEnvironmentChain<LexicalEnvironmentObject>();
3989 }
3990 END_CASE(PopLexicalEnv)do { (activation.regs()).pc += (JSOpLength_PopLexicalEnv); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
3991
3992 CASE(DebugLeaveLexicalEnv)label_DebugLeaveLexicalEnv: {
3993#ifdef DEBUG1
3994 Scope* scope = script->lookupScope(REGS(activation.regs()).pc);
3995 MOZ_ASSERT(scope)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(scope)>::isValid, "invalid assertion condition");
if ((__builtin_expect(!!(!(!!(scope))), 0))) { do { } while (
false); MOZ_ReportAssertionFailure("scope", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3995); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope" ")")
; do { *((volatile int*)__null) = 3995; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3996 MOZ_ASSERT(scope->is<LexicalScope>() || scope->is<ClassBodyScope>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(scope->is<LexicalScope>() || scope->is<
ClassBodyScope>())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope->is<LexicalScope
>() || scope->is<ClassBodyScope>()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("scope->is<LexicalScope>() || scope->is<ClassBodyScope>()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3996); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope->is<LexicalScope>() || scope->is<ClassBodyScope>()"
")"); do { *((volatile int*)__null) = 3996; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
3997 MOZ_ASSERT_IF(scope->is<LexicalScope>(),do { if (scope->is<LexicalScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(!scope->
as<LexicalScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!scope->as<LexicalScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!scope->as<LexicalScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3998); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!scope->as<LexicalScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 3998; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
3998 !scope->as<LexicalScope>().hasEnvironment())do { if (scope->is<LexicalScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(!scope->
as<LexicalScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!scope->as<LexicalScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!scope->as<LexicalScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 3998); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!scope->as<LexicalScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 3998; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
3999 MOZ_ASSERT_IF(scope->is<ClassBodyScope>(),do { if (scope->is<ClassBodyScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(!scope->
as<ClassBodyScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!scope->as<ClassBodyScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!scope->as<ClassBodyScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4000); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!scope->as<ClassBodyScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 4000; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
4000 !scope->as<ClassBodyScope>().hasEnvironment())do { if (scope->is<ClassBodyScope>()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(!scope->
as<ClassBodyScope>().hasEnvironment())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!scope->as<ClassBodyScope
>().hasEnvironment()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!scope->as<ClassBodyScope>().hasEnvironment()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4000); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!scope->as<ClassBodyScope>().hasEnvironment()"
")"); do { *((volatile int*)__null) = 4000; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4001#endif
4002 // FIXME: This opcode should not be necessary. The debugger shouldn't
4003 // need help from bytecode to do its job. See bug 927782.
4004
4005 if (MOZ_UNLIKELY(cx->realm()->isDebuggee())(__builtin_expect(!!(cx->realm()->isDebuggee()), 0))) {
4006 DebugEnvironments::onPopLexical(cx, REGS(activation.regs()).fp(), REGS(activation.regs()).pc);
4007 }
4008 }
4009 END_CASE(DebugLeaveLexicalEnv)do { (activation.regs()).pc += (JSOpLength_DebugLeaveLexicalEnv
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4010
4011 CASE(FreshenLexicalEnv)label_FreshenLexicalEnv: {
4012#ifdef DEBUG1
4013 Scope* scope = script->getScope(REGS(activation.regs()).pc);
4014 auto envChain = REGS(activation.regs()).fp()->environmentChain();
4015 auto* envScope = &envChain->as<BlockLexicalEnvironmentObject>().scope();
4016 MOZ_ASSERT(scope == envScope)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(scope == envScope)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope == envScope))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("scope == envScope"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4016); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope == envScope"
")"); do { *((volatile int*)__null) = 4016; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4017#endif
4018
4019 if (!REGS(activation.regs()).fp()->freshenLexicalEnvironment(cx, REGS(activation.regs()).pc)) {
4020 goto error;
4021 }
4022 }
4023 END_CASE(FreshenLexicalEnv)do { (activation.regs()).pc += (JSOpLength_FreshenLexicalEnv)
; do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4024
4025 CASE(RecreateLexicalEnv)label_RecreateLexicalEnv: {
4026#ifdef DEBUG1
4027 Scope* scope = script->getScope(REGS(activation.regs()).pc);
4028 auto envChain = REGS(activation.regs()).fp()->environmentChain();
4029 auto* envScope = &envChain->as<BlockLexicalEnvironmentObject>().scope();
4030 MOZ_ASSERT(scope == envScope)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(scope == envScope)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(scope == envScope))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("scope == envScope"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4030); AnnotateMozCrashReason("MOZ_ASSERT" "(" "scope == envScope"
")"); do { *((volatile int*)__null) = 4030; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4031#endif
4032
4033 if (!REGS(activation.regs()).fp()->recreateLexicalEnvironment(cx, REGS(activation.regs()).pc)) {
4034 goto error;
4035 }
4036 }
4037 END_CASE(RecreateLexicalEnv)do { (activation.regs()).pc += (JSOpLength_RecreateLexicalEnv
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4038
4039 CASE(PushClassBodyEnv)label_PushClassBodyEnv: {
4040 ReservedRooted<Scope*> scope(&rootScope0, script->getScope(REGS(activation.regs()).pc));
4041
4042 if (!REGS(activation.regs()).fp()->pushClassBodyEnvironment(cx,
4043 scope.as<ClassBodyScope>())) {
4044 goto error;
4045 }
4046 }
4047 END_CASE(PushClassBodyEnv)do { (activation.regs()).pc += (JSOpLength_PushClassBodyEnv);
do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4048
4049 CASE(PushVarEnv)label_PushVarEnv: {
4050 ReservedRooted<Scope*> scope(&rootScope0, script->getScope(REGS(activation.regs()).pc));
4051
4052 if (!REGS(activation.regs()).fp()->pushVarEnvironment(cx, scope)) {
4053 goto error;
4054 }
4055 }
4056 END_CASE(PushVarEnv)do { (activation.regs()).pc += (JSOpLength_PushVarEnv); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4057
4058 CASE(Generator)label_Generator: {
4059 MOZ_ASSERT(!cx->isExceptionPending())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cx->isExceptionPending())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cx->isExceptionPending()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!cx->isExceptionPending()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4059); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 4059; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4060 MOZ_ASSERT(REGS.stackDepth() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() == 0)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!((activation.regs()).stackDepth() == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4060); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() == 0"
")"); do { *((volatile int*)__null) = 4060; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4061 JSObject* obj = AbstractGeneratorObject::createFromFrame(cx, REGS(activation.regs()).fp());
4062 if (!obj) {
4063 goto error;
4064 }
4065 PUSH_OBJECT(*obj)do { (activation.regs()).sp++->setObject(*obj); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
4066 }
4067 END_CASE(Generator)do { (activation.regs()).pc += (JSOpLength_Generator); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4068
4069 CASE(InitialYield)label_InitialYield: {
4070 MOZ_ASSERT(!cx->isExceptionPending())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cx->isExceptionPending())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cx->isExceptionPending()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!cx->isExceptionPending()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4070); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 4070; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4071 MOZ_ASSERT_IF(script->isModule() && script->isAsync(),do { if (script->isModule() && script->isAsync(
)) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isModuleFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isModuleFrame()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isModuleFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4072); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isModuleFrame()"
")"); do { *((volatile int*)__null) = 4072; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
4072 REGS.fp()->isModuleFrame())do { if (script->isModule() && script->isAsync(
)) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isModuleFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isModuleFrame()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isModuleFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4072); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isModuleFrame()"
")"); do { *((volatile int*)__null) = 4072; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4073 MOZ_ASSERT_IF(!script->isModule() && script->isAsync(),do { if (!script->isModule() && script->isAsync
()) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isFunctionFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isFunctionFrame()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isFunctionFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4074); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isFunctionFrame()"
")"); do { *((volatile int*)__null) = 4074; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
4074 REGS.fp()->isFunctionFrame())do { if (!script->isModule() && script->isAsync
()) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isFunctionFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isFunctionFrame()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isFunctionFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4074); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isFunctionFrame()"
")"); do { *((volatile int*)__null) = 4074; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4075 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-1].toObject());
4076 POP_RETURN_VALUE()(activation.regs()).fp()->setReturnValue(*--(activation.regs
()).sp)
;
4077 MOZ_ASSERT(REGS.stackDepth() == 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() == 0)>::isValid,
"invalid assertion condition"); if ((__builtin_expect(!!(!(!
!((activation.regs()).stackDepth() == 0))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() == 0"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4077); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() == 0"
")"); do { *((volatile int*)__null) = 4077; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4078 if (!AbstractGeneratorObject::suspend(cx, obj, REGS(activation.regs()).fp(), REGS(activation.regs()).pc,
4079 script->nfixed())) {
4080 goto error;
4081 }
4082 goto successful_return_continuation;
4083 }
4084
4085 CASE(Yield)label_Yield:
4086 CASE(Await)label_Await: {
4087 MOZ_ASSERT(!cx->isExceptionPending())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cx->isExceptionPending())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cx->isExceptionPending()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!cx->isExceptionPending()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4087); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 4087; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4088 MOZ_ASSERT_IF(script->isModule() && script->isAsync(),do { if (script->isModule() && script->isAsync(
)) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isModuleFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isModuleFrame()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isModuleFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4089); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isModuleFrame()"
")"); do { *((volatile int*)__null) = 4089; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
4089 REGS.fp()->isModuleFrame())do { if (script->isModule() && script->isAsync(
)) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isModuleFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isModuleFrame()))), 0))
) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isModuleFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4089); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isModuleFrame()"
")"); do { *((volatile int*)__null) = 4089; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4090 MOZ_ASSERT_IF(!script->isModule() && script->isAsync(),do { if (!script->isModule() && script->isAsync
()) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isFunctionFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isFunctionFrame()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isFunctionFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4091); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isFunctionFrame()"
")"); do { *((volatile int*)__null) = 4091; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
4091 REGS.fp()->isFunctionFrame())do { if (!script->isModule() && script->isAsync
()) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isFunctionFrame())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isFunctionFrame()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isFunctionFrame()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4091); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isFunctionFrame()"
")"); do { *((volatile int*)__null) = 4091; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4092 ReservedRooted<JSObject*> obj(&rootObject0, &REGS(activation.regs()).sp[-1].toObject());
4093 if (!AbstractGeneratorObject::suspend(
4094 cx, obj, REGS(activation.regs()).fp(), REGS(activation.regs()).pc,
4095 script->nfixed() + REGS(activation.regs()).stackDepth() - 2)) {
4096 goto error;
4097 }
4098
4099 REGS(activation.regs()).sp--;
4100 POP_RETURN_VALUE()(activation.regs()).fp()->setReturnValue(*--(activation.regs
()).sp)
;
4101
4102 goto successful_return_continuation;
4103 }
4104
4105 CASE(ResumeKind)label_ResumeKind: {
4106 GeneratorResumeKind resumeKind = ResumeKindFromPC(REGS(activation.regs()).pc);
4107 PUSH_INT32(int32_t(resumeKind))(activation.regs()).sp++->setInt32(int32_t(resumeKind));
4108 }
4109 END_CASE(ResumeKind)do { (activation.regs()).pc += (JSOpLength_ResumeKind); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4110
4111 CASE(CheckResumeKind)label_CheckResumeKind: {
4112 int32_t kindInt = REGS(activation.regs()).sp[-1].toInt32();
4113 GeneratorResumeKind resumeKind = IntToResumeKind(kindInt);
4114 if (MOZ_UNLIKELY(resumeKind != GeneratorResumeKind::Next)(__builtin_expect(!!(resumeKind != GeneratorResumeKind::Next)
, 0))
) {
4115 ReservedRooted<Value> val(&rootValue0, REGS(activation.regs()).sp[-3]);
4116 Rooted<AbstractGeneratorObject*> gen(
4117 cx, &REGS(activation.regs()).sp[-2].toObject().as<AbstractGeneratorObject>());
4118 MOZ_ALWAYS_FALSE(GeneratorThrowOrReturn(cx, activation.regs().fp(), gen,do { if ((__builtin_expect(!!(!(GeneratorThrowOrReturn(cx, activation
.regs().fp(), gen, val, resumeKind))), 1))) { } else { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(false)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(false))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("false" " (" "!(GeneratorThrowOrReturn(cx, activation.regs().fp(), gen, val, resumeKind))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4119); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(GeneratorThrowOrReturn(cx, activation.regs().fp(), gen, val, resumeKind))"
")"); do { *((volatile int*)__null) = 4119; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
4119 val, resumeKind))do { if ((__builtin_expect(!!(!(GeneratorThrowOrReturn(cx, activation
.regs().fp(), gen, val, resumeKind))), 1))) { } else { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(false)>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(false))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("false" " (" "!(GeneratorThrowOrReturn(cx, activation.regs().fp(), gen, val, resumeKind))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4119); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(GeneratorThrowOrReturn(cx, activation.regs().fp(), gen, val, resumeKind))"
")"); do { *((volatile int*)__null) = 4119; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4120 goto error;
4121 }
4122 REGS(activation.regs()).sp -= 2;
4123 }
4124 END_CASE(CheckResumeKind)do { (activation.regs()).pc += (JSOpLength_CheckResumeKind); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4125
4126 CASE(Resume)label_Resume: {
4127 {
4128 Rooted<AbstractGeneratorObject*> gen(
4129 cx, &REGS(activation.regs()).sp[-3].toObject().as<AbstractGeneratorObject>());
4130 ReservedRooted<Value> val(&rootValue0, REGS(activation.regs()).sp[-2]);
4131 ReservedRooted<Value> resumeKindVal(&rootValue1, REGS(activation.regs()).sp[-1]);
4132
4133 // popInlineFrame expects there to be an additional value on the stack
4134 // to pop off, so leave "gen" on the stack.
4135 REGS(activation.regs()).sp -= 1;
4136
4137 if (!AbstractGeneratorObject::resume(cx, activation, gen, val,
4138 resumeKindVal)) {
4139 goto error;
4140 }
4141
4142 JSScript* generatorScript = REGS(activation.regs()).fp()->script();
4143 if (cx->realm() != generatorScript->realm()) {
4144 cx->enterRealmOf(generatorScript);
4145 }
4146 SET_SCRIPT(generatorScript)do { script = (generatorScript); do { static_assert( mozilla::
detail::AssertionConditionType<decltype(cx->realm() == script
->realm())>::isValid, "invalid assertion condition"); if
((__builtin_expect(!!(!(!!(cx->realm() == script->realm
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("cx->realm() == script->realm()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4146); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->realm() == script->realm()"
")"); do { *((volatile int*)__null) = 4146; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); if (DebugAPI
::hasAnyBreakpointsOrStepMode(script) || script->hasScriptCounts
()) activation.enableInterruptsUnconditionally(); } while (0)
;
4147
4148 if (!probes::EnterScript(cx, generatorScript,
4149 generatorScript->function(), REGS(activation.regs()).fp())) {
4150 goto error;
4151 }
4152
4153 if (!DebugAPI::onResumeFrame(cx, REGS(activation.regs()).fp())) {
4154 MOZ_ASSERT_IF(cx->isPropagatingForcedReturn(), gen->isClosed())do { if (cx->isPropagatingForcedReturn()) { do { static_assert
( mozilla::detail::AssertionConditionType<decltype(gen->
isClosed())>::isValid, "invalid assertion condition"); if (
(__builtin_expect(!!(!(!!(gen->isClosed()))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("gen->isClosed()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4154); AnnotateMozCrashReason("MOZ_ASSERT" "(" "gen->isClosed()"
")"); do { *((volatile int*)__null) = 4154; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4155 goto error;
4156 }
4157 }
4158 ADVANCE_AND_DISPATCH(0)do { (activation.regs()).pc += (0); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
4159 }
4160
4161 CASE(AfterYield)label_AfterYield: {
4162 // AbstractGeneratorObject::resume takes care of setting the frame's
4163 // debuggee flag.
4164 MOZ_ASSERT_IF(REGS.fp()->script()->isDebuggee(), REGS.fp()->isDebuggee())do { if ((activation.regs()).fp()->script()->isDebuggee
()) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype((activation.regs()).fp()->isDebuggee())>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!((activation.regs()).fp()->isDebuggee()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("(activation.regs()).fp()->isDebuggee()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4164); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).fp()->isDebuggee()"
")"); do { *((volatile int*)__null) = 4164; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); } } while (
false)
;
4165 COUNT_COVERAGE()do { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc
)))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc)))
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4165); AnnotateMozCrashReason("MOZ_ASSERT" "(" "BytecodeIsJumpTarget(JSOp(*(activation.regs()).pc))"
")"); do { *((volatile int*)__null) = 4165; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); do { if (script
->hasScriptCounts()) { PCCounts* counts = script->maybeGetPCCounts
((activation.regs()).pc); do { static_assert( mozilla::detail
::AssertionConditionType<decltype(counts)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(counts))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("counts", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4165); AnnotateMozCrashReason("MOZ_ASSERT" "(" "counts" ")"
); do { *((volatile int*)__null) = 4165; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false); counts->
numExec()++; } } while (0); } while (0)
;
4166 }
4167 END_CASE(AfterYield)do { (activation.regs()).pc += (JSOpLength_AfterYield); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4168
4169 CASE(FinalYieldRval)label_FinalYieldRval: {
4170 ReservedRooted<JSObject*> gen(&rootObject0, &REGS(activation.regs()).sp[-1].toObject());
4171 REGS(activation.regs()).sp--;
4172 AbstractGeneratorObject::finalSuspend(cx, gen);
4173 goto successful_return_continuation;
4174 }
4175
4176 CASE(CheckClassHeritage)label_CheckClassHeritage: {
4177 HandleValue heritage = REGS(activation.regs()).stackHandleAt(-1);
4178
4179 if (!CheckClassHeritageOperation(cx, heritage)) {
4180 goto error;
4181 }
4182 }
4183 END_CASE(CheckClassHeritage)do { (activation.regs()).pc += (JSOpLength_CheckClassHeritage
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4184
4185 CASE(BuiltinObject)label_BuiltinObject: {
4186 auto kind = BuiltinObjectKind(GET_UINT8(REGS(activation.regs()).pc));
4187 JSObject* builtin = BuiltinObjectOperation(cx, kind);
4188 if (!builtin) {
4189 goto error;
4190 }
4191 PUSH_OBJECT(*builtin)do { (activation.regs()).sp++->setObject(*builtin); cx->
debugOnlyCheck((activation.regs()).sp[-1]); } while (0)
;
4192 }
4193 END_CASE(BuiltinObject)do { (activation.regs()).pc += (JSOpLength_BuiltinObject); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4194
4195 CASE(FunWithProto)label_FunWithProto: {
4196 ReservedRooted<JSObject*> proto(&rootObject1, &REGS(activation.regs()).sp[-1].toObject());
4197
4198 /* Load the specified function object literal. */
4199 ReservedRooted<JSFunction*> fun(&rootFunction0,
4200 script->getFunction(REGS(activation.regs()).pc));
4201
4202 JSObject* obj =
4203 FunWithProtoOperation(cx, fun, REGS(activation.regs()).fp()->environmentChain(), proto);
4204 if (!obj) {
4205 goto error;
4206 }
4207
4208 REGS(activation.regs()).sp[-1].setObject(*obj);
4209 }
4210 END_CASE(FunWithProto)do { (activation.regs()).pc += (JSOpLength_FunWithProto); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4211
4212 CASE(ObjWithProto)label_ObjWithProto: {
4213 JSObject* obj = ObjectWithProtoOperation(cx, REGS(activation.regs()).stackHandleAt(-1));
4214 if (!obj) {
4215 goto error;
4216 }
4217
4218 REGS(activation.regs()).sp[-1].setObject(*obj);
4219 }
4220 END_CASE(ObjWithProto)do { (activation.regs()).pc += (JSOpLength_ObjWithProto); do {
js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4221
4222 CASE(InitHomeObject)label_InitHomeObject: {
4223 MOZ_ASSERT(REGS.stackDepth() >= 2)do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).stackDepth() >= 2)>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!((activation.regs()).stackDepth() >= 2))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("(activation.regs()).stackDepth() >= 2"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4223); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).stackDepth() >= 2"
")"); do { *((volatile int*)__null) = 4223; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4224
4225 /* Load the function to be initialized */
4226 JSFunction* func = &REGS(activation.regs()).sp[-2].toObject().as<JSFunction>();
4227 MOZ_ASSERT(func->allowSuperProperty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(func->allowSuperProperty())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(func->allowSuperProperty(
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("func->allowSuperProperty()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4227); AnnotateMozCrashReason("MOZ_ASSERT" "(" "func->allowSuperProperty()"
")"); do { *((volatile int*)__null) = 4227; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4228
4229 /* Load the home object */
4230 JSObject* obj = &REGS(activation.regs()).sp[-1].toObject();
4231 MOZ_ASSERT(obj->is<PlainObject>() || obj->is<JSFunction>())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(obj->is<PlainObject>() || obj->is<JSFunction
>())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(obj->is<PlainObject>() || obj->is<JSFunction
>()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("obj->is<PlainObject>() || obj->is<JSFunction>()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4231); AnnotateMozCrashReason("MOZ_ASSERT" "(" "obj->is<PlainObject>() || obj->is<JSFunction>()"
")"); do { *((volatile int*)__null) = 4231; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4232
4233 func->setExtendedSlot(FunctionExtended::METHOD_HOMEOBJECT_SLOT,
4234 ObjectValue(*obj));
4235 REGS(activation.regs()).sp--;
4236 }
4237 END_CASE(InitHomeObject)do { (activation.regs()).pc += (JSOpLength_InitHomeObject); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4238
4239 CASE(SuperBase)label_SuperBase: {
4240 JSFunction& superEnvFunc = REGS(activation.regs()).sp[-1].toObject().as<JSFunction>();
4241 MOZ_ASSERT(superEnvFunc.allowSuperProperty())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(superEnvFunc.allowSuperProperty())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(superEnvFunc.allowSuperProperty
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("superEnvFunc.allowSuperProperty()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4241); AnnotateMozCrashReason("MOZ_ASSERT" "(" "superEnvFunc.allowSuperProperty()"
")"); do { *((volatile int*)__null) = 4241; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4242 MOZ_ASSERT(superEnvFunc.baseScript()->needsHomeObject())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(superEnvFunc.baseScript()->needsHomeObject())>
::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(superEnvFunc.baseScript()->needsHomeObject()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("superEnvFunc.baseScript()->needsHomeObject()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4242); AnnotateMozCrashReason("MOZ_ASSERT" "(" "superEnvFunc.baseScript()->needsHomeObject()"
")"); do { *((volatile int*)__null) = 4242; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4243 const Value& homeObjVal = superEnvFunc.getExtendedSlot(
4244 FunctionExtended::METHOD_HOMEOBJECT_SLOT);
4245
4246 JSObject* homeObj = &homeObjVal.toObject();
4247 JSObject* superBase = HomeObjectSuperBase(homeObj);
4248
4249 REGS(activation.regs()).sp[-1].setObjectOrNull(superBase);
4250 }
4251 END_CASE(SuperBase)do { (activation.regs()).pc += (JSOpLength_SuperBase); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4252
4253 CASE(NewTarget)label_NewTarget: {
4254 PUSH_COPY(REGS.fp()->newTarget())do { *(activation.regs()).sp++ = ((activation.regs()).fp()->
newTarget()); cx->debugOnlyCheck((activation.regs()).sp[-1
]); } while (0)
;
4255 MOZ_ASSERT(REGS.sp[-1].isObject() || REGS.sp[-1].isUndefined())do { static_assert( mozilla::detail::AssertionConditionType<
decltype((activation.regs()).sp[-1].isObject() || (activation
.regs()).sp[-1].isUndefined())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!((activation.regs()).sp[-1].isObject
() || (activation.regs()).sp[-1].isUndefined()))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("(activation.regs()).sp[-1].isObject() || (activation.regs()).sp[-1].isUndefined()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4255); AnnotateMozCrashReason("MOZ_ASSERT" "(" "(activation.regs()).sp[-1].isObject() || (activation.regs()).sp[-1].isUndefined()"
")"); do { *((volatile int*)__null) = 4255; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4256 }
4257 END_CASE(NewTarget)do { (activation.regs()).pc += (JSOpLength_NewTarget); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4258
4259 CASE(ImportMeta)label_ImportMeta: {
4260 JSObject* metaObject = ImportMetaOperation(cx, script);
4261 if (!metaObject) {
4262 goto error;
4263 }
4264
4265 PUSH_OBJECT(*metaObject)do { (activation.regs()).sp++->setObject(*metaObject); cx->
debugOnlyCheck((activation.regs()).sp[-1]); } while (0)
;
4266 }
4267 END_CASE(ImportMeta)do { (activation.regs()).pc += (JSOpLength_ImportMeta); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4268
4269 CASE(DynamicImport)label_DynamicImport: {
4270 ReservedRooted<Value> options(&rootValue0, REGS(activation.regs()).sp[-1]);
4271 REGS(activation.regs()).sp--;
4272
4273 ReservedRooted<Value> specifier(&rootValue1);
4274 POP_COPY_TO(specifier)(specifier) = *--(activation.regs()).sp;
4275
4276 JSObject* promise =
4277 StartDynamicModuleImport(cx, script, specifier, options);
4278 if (!promise) goto error;
4279
4280 PUSH_OBJECT(*promise)do { (activation.regs()).sp++->setObject(*promise); cx->
debugOnlyCheck((activation.regs()).sp[-1]); } while (0)
;
4281 }
4282 END_CASE(DynamicImport)do { (activation.regs()).pc += (JSOpLength_DynamicImport); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4283
4284 CASE(EnvCallee)label_EnvCallee: {
4285 uint8_t numHops = GET_UINT8(REGS(activation.regs()).pc);
4286 JSObject* env = &REGS(activation.regs()).fp()->environmentChain()->as<EnvironmentObject>();
4287 for (unsigned i = 0; i < numHops; i++) {
4288 env = &env->as<EnvironmentObject>().enclosingEnvironment();
4289 }
4290 PUSH_OBJECT(env->as<CallObject>().callee())do { (activation.regs()).sp++->setObject(env->as<CallObject
>().callee()); cx->debugOnlyCheck((activation.regs()).sp
[-1]); } while (0)
;
4291 }
4292 END_CASE(EnvCallee)do { (activation.regs()).pc += (JSOpLength_EnvCallee); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4293
4294 CASE(SuperFun)label_SuperFun: {
4295 JSObject* superEnvFunc = &REGS(activation.regs()).sp[-1].toObject();
4296 JSObject* superFun = SuperFunOperation(superEnvFunc);
4297 REGS(activation.regs()).sp[-1].setObjectOrNull(superFun);
4298 }
4299 END_CASE(SuperFun)do { (activation.regs()).pc += (JSOpLength_SuperFun); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4300
4301 CASE(CheckObjCoercible)label_CheckObjCoercible: {
4302 ReservedRooted<Value> checkVal(&rootValue0, REGS(activation.regs()).sp[-1]);
4303 if (checkVal.isNullOrUndefined()) {
4304 MOZ_ALWAYS_FALSE(ThrowObjectCoercible(cx, checkVal))do { if ((__builtin_expect(!!(!(ThrowObjectCoercible(cx, checkVal
))), 1))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "!(ThrowObjectCoercible(cx, checkVal))"
")", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4304); AnnotateMozCrashReason("MOZ_DIAGNOSTIC_ASSERT" "(" "false"
") (" "!(ThrowObjectCoercible(cx, checkVal))" ")"); do { *((
volatile int*)__null) = 4304; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false); } } while (false)
;
4305 goto error;
4306 }
4307 }
4308 END_CASE(CheckObjCoercible)do { (activation.regs()).pc += (JSOpLength_CheckObjCoercible)
; do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4309
4310 CASE(DebugCheckSelfHosted)label_DebugCheckSelfHosted: {
4311#ifdef DEBUG1
4312 ReservedRooted<Value> checkVal(&rootValue0, REGS(activation.regs()).sp[-1]);
4313 if (!Debug_CheckSelfHosted(cx, checkVal)) {
4314 goto error;
4315 }
4316#endif
4317 }
4318 END_CASE(DebugCheckSelfHosted)do { (activation.regs()).pc += (JSOpLength_DebugCheckSelfHosted
); do { js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4319
4320 CASE(IsConstructing)label_IsConstructing: { PUSH_MAGIC(JS_IS_CONSTRUCTING)(activation.regs()).sp++->setMagic(JS_IS_CONSTRUCTING); }
4321 END_CASE(IsConstructing)do { (activation.regs()).pc += (JSOpLength_IsConstructing); do
{ js::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses
[(*(activation.regs()).pc | activation.opMask())]; } while (0
);
4322
4323 CASE(Inc)label_Inc: {
4324 MutableHandleValue val = REGS(activation.regs()).stackHandleAt(-1);
4325 if (!IncOperation(cx, val, val)) {
4326 goto error;
4327 }
4328 }
4329 END_CASE(Inc)do { (activation.regs()).pc += (JSOpLength_Inc); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
4330
4331 CASE(Dec)label_Dec: {
4332 MutableHandleValue val = REGS(activation.regs()).stackHandleAt(-1);
4333 if (!DecOperation(cx, val, val)) {
4334 goto error;
4335 }
4336 }
4337 END_CASE(Dec)do { (activation.regs()).pc += (JSOpLength_Dec); do { js::gc::
MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(activation
.regs()).pc | activation.opMask())]; } while (0);
4338
4339 CASE(ToNumeric)label_ToNumeric: {
4340 if (!ToNumeric(cx, REGS(activation.regs()).stackHandleAt(-1))) {
4341 goto error;
4342 }
4343 }
4344 END_CASE(ToNumeric)do { (activation.regs()).pc += (JSOpLength_ToNumeric); do { js
::gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(
*(activation.regs()).pc | activation.opMask())]; } while (0);
4345
4346 CASE(BigInt)label_BigInt: { PUSH_BIGINT(script->getBigInt(REGS.pc))(activation.regs()).sp++->setBigInt(script->getBigInt((
activation.regs()).pc))
; }
4347 END_CASE(BigInt)do { (activation.regs()).pc += (JSOpLength_BigInt); do { js::
gc::MaybeVerifyBarriers(cx); } while (0); goto* addresses[(*(
activation.regs()).pc | activation.opMask())]; } while (0);
4348
4349 DEFAULT()label_default: {
4350 char numBuf[12];
4351 SprintfLiteral(numBuf, "%d", *REGS(activation.regs()).pc);
4352 JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
4353 JSMSG_BAD_BYTECODE, numBuf);
4354 goto error;
4355 }
4356
4357 } /* interpreter loop */
4358
4359 MOZ_CRASH("Interpreter loop exited via fallthrough")do { do { } while (false); MOZ_ReportCrash("" "Interpreter loop exited via fallthrough"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4359); AnnotateMozCrashReason("MOZ_CRASH(" "Interpreter loop exited via fallthrough"
")"); do { *((volatile int*)__null) = 4359; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
4360
4361error:
4362 switch (HandleError(cx, REGS(activation.regs()))) {
4363 case SuccessfulReturnContinuation:
4364 goto successful_return_continuation;
4365
4366 case ErrorReturnContinuation:
4367 interpReturnOK = false;
4368 goto return_continuation;
4369
4370 case CatchContinuation:
4371 ADVANCE_AND_DISPATCH(0)do { (activation.regs()).pc += (0); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
4372
4373 case FinallyContinuation: {
4374 /*
4375 * Push (exception, stack, true) triple for finally to indicate that we
4376 * should rethrow the exception.
4377 */
4378 ReservedRooted<Value> exception(&rootValue0);
4379 ReservedRooted<Value> exceptionStack(&rootValue1);
4380 if (!cx->getPendingException(&exception) ||
4381 !cx->getPendingExceptionStack(&exceptionStack)) {
4382 interpReturnOK = false;
4383 goto return_continuation;
4384 }
4385 PUSH_COPY(exception)do { *(activation.regs()).sp++ = (exception); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
4386 PUSH_COPY(exceptionStack)do { *(activation.regs()).sp++ = (exceptionStack); cx->debugOnlyCheck
((activation.regs()).sp[-1]); } while (0)
;
4387 PUSH_BOOLEAN(true)(activation.regs()).sp++->setBoolean(true);
4388 cx->clearPendingException();
4389 }
4390 ADVANCE_AND_DISPATCH(0)do { (activation.regs()).pc += (0); do { js::gc::MaybeVerifyBarriers
(cx); } while (0); goto* addresses[(*(activation.regs()).pc |
activation.opMask())]; } while (0)
;
4391 }
4392
4393 MOZ_CRASH("Invalid HandleError continuation")do { do { } while (false); MOZ_ReportCrash("" "Invalid HandleError continuation"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4393); AnnotateMozCrashReason("MOZ_CRASH(" "Invalid HandleError continuation"
")"); do { *((volatile int*)__null) = 4393; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
4394
4395exit:
4396 if (MOZ_LIKELY(!frameHalfInitialized)(__builtin_expect(!!(!frameHalfInitialized), 1))) {
4397 interpReturnOK =
4398 DebugAPI::onLeaveFrame(cx, REGS(activation.regs()).fp(), REGS(activation.regs()).pc, interpReturnOK);
4399
4400 REGS(activation.regs()).fp()->epilogue(cx, REGS(activation.regs()).pc);
4401 }
4402
4403 gc::MaybeVerifyBarriers(cx, true);
4404
4405 /*
4406 * This path is used when it's guaranteed the method can be finished
4407 * inside the JIT.
4408 */
4409leave_on_safe_point:
4410
4411 if (interpReturnOK) {
4412 state.setReturnValue(activation.entryFrame()->returnValue());
4413 }
4414
4415 return interpReturnOK;
4416
4417prologue_error:
4418 interpReturnOK = false;
4419 frameHalfInitialized = true;
4420 goto prologue_return_continuation;
4421}
4422
4423bool js::ThrowOperation(JSContext* cx, HandleValue v) {
4424 MOZ_ASSERT(!cx->isExceptionPending())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cx->isExceptionPending())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cx->isExceptionPending()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!cx->isExceptionPending()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4424); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 4424; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4425 cx->setPendingException(v, ShouldCaptureStack::Maybe);
4426 return false;
4427}
4428
4429bool js::ThrowWithStackOperation(JSContext* cx, HandleValue v,
4430 HandleValue stack) {
4431 MOZ_ASSERT(!cx->isExceptionPending())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!cx->isExceptionPending())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!cx->isExceptionPending()
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"!cx->isExceptionPending()", "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4431); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 4431; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4432 MOZ_ASSERT(stack.isObjectOrNull())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(stack.isObjectOrNull())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(stack.isObjectOrNull()))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("stack.isObjectOrNull()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4432); AnnotateMozCrashReason("MOZ_ASSERT" "(" "stack.isObjectOrNull()"
")"); do { *((volatile int*)__null) = 4432; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4433
4434 // Use a normal throw when no stack was recorded.
4435 if (!stack.isObject()) {
4436 return ThrowOperation(cx, v);
4437 }
4438
4439 MOZ_ASSERT(UncheckedUnwrap(&stack.toObject())->is<SavedFrame>() ||do { static_assert( mozilla::detail::AssertionConditionType<
decltype(UncheckedUnwrap(&stack.toObject())->is<SavedFrame
>() || IsDeadProxyObject(&stack.toObject()))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(UncheckedUnwrap(&stack.toObject())->is<SavedFrame
>() || IsDeadProxyObject(&stack.toObject())))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("UncheckedUnwrap(&stack.toObject())->is<SavedFrame>() || IsDeadProxyObject(&stack.toObject())"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4440); AnnotateMozCrashReason("MOZ_ASSERT" "(" "UncheckedUnwrap(&stack.toObject())->is<SavedFrame>() || IsDeadProxyObject(&stack.toObject())"
")"); do { *((volatile int*)__null) = 4440; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
4440 IsDeadProxyObject(&stack.toObject()))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(UncheckedUnwrap(&stack.toObject())->is<SavedFrame
>() || IsDeadProxyObject(&stack.toObject()))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(UncheckedUnwrap(&stack.toObject())->is<SavedFrame
>() || IsDeadProxyObject(&stack.toObject())))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("UncheckedUnwrap(&stack.toObject())->is<SavedFrame>() || IsDeadProxyObject(&stack.toObject())"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4440); AnnotateMozCrashReason("MOZ_ASSERT" "(" "UncheckedUnwrap(&stack.toObject())->is<SavedFrame>() || IsDeadProxyObject(&stack.toObject())"
")"); do { *((volatile int*)__null) = 4440; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4441
4442 Rooted<SavedFrame*> stackObj(cx,
4443 stack.toObject().maybeUnwrapIf<SavedFrame>());
4444 cx->setPendingException(v, stackObj);
4445 return false;
4446}
4447
4448bool js::GetPendingExceptionStack(JSContext* cx, MutableHandleValue vp) {
4449 MOZ_ASSERT(cx->isExceptionPending())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(cx->isExceptionPending())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(cx->isExceptionPending())
)), 0))) { do { } while (false); MOZ_ReportAssertionFailure("cx->isExceptionPending()"
, "/var/lib/jenkins/workspace/firefox-scan-build/js/src/vm/Interpreter.cpp"
, 4449); AnnotateMozCrashReason("MOZ_ASSERT" "(" "cx->isExceptionPending()"
")"); do { *((volatile int*)__null) = 4449; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
4450 return cx->getPendingExceptionStack(vp);
4451}
4452
4453bool js::GetProperty(JSContext* cx, HandleValue v, Handle<PropertyName*> name,
4454 MutableHandleValue vp) {
4455 if (name == cx->names().length) {
4456 // Fast path for strings, arrays and arguments.
4457 if (GetLengthProperty(v, vp)) {
4458 return true;
4459 }
4460 }
4461
4462 // Optimize common cases like (2).toString() or "foo".valueOf() to not
4463 // create a wrapper object.
4464 if (v.isPrimitive() && !v.isNullOrUndefined()) {
4465 JSObject* proto;
4466
4467 switch (v.type()) {
4468 case ValueType::Double:
4469 case ValueType::Int32:
4470 proto = GlobalObject::getOrCreateNumberPrototype(cx, cx->global());
4471 break;
4472 case ValueType::Boolean:
4473 proto = GlobalObject::getOrCreateBooleanPrototype(cx, cx->global());
4474 break;
4475 case ValueType::String:
4476 proto = GlobalObject::getOrCreateStringPrototype(cx, cx->global());
4477 break;
4478 case ValueType::Symbol:
4479 proto = GlobalObject::getOrCreateSymbolPrototype(cx, cx->global());
4480 break;
4481 case ValueType::BigInt:
4482 proto = GlobalObject::getOrCreateBigIntPrototype(cx, cx->global());
4483 break;
4484#ifdef ENABLE_RECORD_TUPLE
4485 case ValueType::ExtendedPrimitive: {
4486 RootedObject obj(cx, &v.toExtendedPrimitive());
4487 RootedId id(cx, NameToId(name));
4488 return ExtendedPrimitiveGetProperty(cx, obj, v, id, vp);
4489 }
4490#endif
4491