summaryrefslogtreecommitdiff
path: root/js/src/frontend/BytecodeEmitter.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-09-01 15:44:29 +0200
committerMoonchild <moonchild@palemoon.org>2023-09-01 15:44:29 +0200
commit2d48de9998d5c4f768af051ce997777be126f8cd (patch)
treec6023db91bfadaa8e1d7c4c12d90ad63bf810454 /js/src/frontend/BytecodeEmitter.h
parent3b029cdfe482e5097ee09fa1998591faf9c1005b (diff)
parentee97a5dad40fb8d207b717cb2a0d487f54dd5f1d (diff)
downloaduxp-RC_20230901.tar.gz
Merge branch 'master' into releaseRC_20230901RB_20230904
Diffstat (limited to 'js/src/frontend/BytecodeEmitter.h')
-rw-r--r--js/src/frontend/BytecodeEmitter.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h
index 732a1f24f8..9ca4856cf5 100644
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -35,20 +35,21 @@ class SharedContext;
class TokenStream;
class CGConstList {
- Vector<Value> list;
+ Rooted<ValueVector> vector;
public:
- explicit CGConstList(ExclusiveContext* cx) : list(cx) {}
+ explicit CGConstList(ExclusiveContext* cx)
+ : vector(cx, ValueVector(cx))
+ { }
MOZ_MUST_USE bool append(const Value& v) {
- MOZ_ASSERT_IF(v.isString(), v.toString()->isAtom());
- return list.append(v);
+ return vector.append(v);
}
- size_t length() const { return list.length(); }
+ size_t length() const { return vector.length(); }
void finish(ConstArray* array);
};
struct CGObjectList {
uint32_t length; /* number of emitted so far objects */
- ObjectBox* lastbox; /* last emitted object */
+ ObjectBox* lastbox; /* last emitted object */
CGObjectList() : length(0), lastbox(nullptr) {}
@@ -198,7 +199,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
return innermostEmitterScope_;
}
- CGConstList constList; /* constants to be included with the script */
+ CGConstList constList; /* double and bigint values used by script */
CGObjectList objectList; /* list of emitted objects */
CGScopeList scopeList; /* list of emitted scopes */
CGTryNoteList tryNoteList; /* list of emitted try notes */
@@ -478,6 +479,8 @@ struct MOZ_STACK_CLASS BytecodeEmitter
MOZ_MUST_USE bool emitNumberOp(double dval);
+ MOZ_MUST_USE bool emitBigIntOp(BigInt* bigint);
+
MOZ_MUST_USE bool emitThisLiteral(ThisLiteral* pn);
MOZ_MUST_USE bool emitGetFunctionThis(ParseNode* pn);
MOZ_MUST_USE bool emitGetFunctionThis(const mozilla::Maybe<uint32_t>& offset);