summaryrefslogtreecommitdiffstats
path: root/js/src/jsscript.h
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-12-01 19:14:11 -0500
committerGaming4JC <g4jc@hyperbola.info>2019-12-17 06:25:24 -0500
commit3a3de55aadd9d3a2aafc3638c7a9b0c23584cef4 (patch)
treed1f38e0fc9c35838279f191036741532c1657647 /js/src/jsscript.h
parentf07d5707c77e73031b6921faac165ca7f8d577c6 (diff)
downloadUXP-3a3de55aadd9d3a2aafc3638c7a9b0c23584cef4.tar
UXP-3a3de55aadd9d3a2aafc3638c7a9b0c23584cef4.tar.gz
UXP-3a3de55aadd9d3a2aafc3638c7a9b0c23584cef4.tar.lz
UXP-3a3de55aadd9d3a2aafc3638c7a9b0c23584cef4.tar.xz
UXP-3a3de55aadd9d3a2aafc3638c7a9b0c23584cef4.zip
Bug 1343481 - Part 3: Add JSOP_AWAIT and rename {yieldIndex,yieldOffset} to {yieldAndAwaitIndex,yieldAndAwaitOffset}.
Tag #1287
Diffstat (limited to 'js/src/jsscript.h')
-rw-r--r--js/src/jsscript.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/js/src/jsscript.h b/js/src/jsscript.h
index 13eaeff34..c19fbfc71 100644
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -156,7 +156,7 @@ struct ScopeNoteArray {
uint32_t length; // Count of indexed try notes.
};
-class YieldOffsetArray {
+class YieldAndAwaitOffsetArray {
friend bool
detail::CopyScript(JSContext* cx, HandleScript src, HandleScript dst,
MutableHandle<GCVector<Scope*>> scopes);
@@ -1699,7 +1699,9 @@ class JSScript : public js::gc::TenuredCell
bool hasObjects() const { return hasArray(OBJECTS); }
bool hasTrynotes() const { return hasArray(TRYNOTES); }
bool hasScopeNotes() const { return hasArray(SCOPENOTES); }
- bool hasYieldOffsets() const { return isStarGenerator() || isLegacyGenerator() || isAsync(); }
+ bool hasYieldAndAwaitOffsets() const {
+ return isStarGenerator() || isLegacyGenerator() || isAsync();
+ }
#define OFF(fooOff, hasFoo, t) (fooOff() + (hasFoo() ? sizeof(t) : 0))
@@ -1708,7 +1710,9 @@ class JSScript : public js::gc::TenuredCell
size_t objectsOffset() const { return OFF(constsOffset, hasConsts, js::ConstArray); }
size_t trynotesOffset() const { return OFF(objectsOffset, hasObjects, js::ObjectArray); }
size_t scopeNotesOffset() const { return OFF(trynotesOffset, hasTrynotes, js::TryNoteArray); }
- size_t yieldOffsetsOffset() const { return OFF(scopeNotesOffset, hasScopeNotes, js::ScopeNoteArray); }
+ size_t yieldAndAwaitOffsetsOffset() const {
+ return OFF(scopeNotesOffset, hasScopeNotes, js::ScopeNoteArray);
+ }
#undef OFF
@@ -1738,9 +1742,10 @@ class JSScript : public js::gc::TenuredCell
return reinterpret_cast<js::ScopeNoteArray*>(data + scopeNotesOffset());
}
- js::YieldOffsetArray& yieldOffsets() {
- MOZ_ASSERT(hasYieldOffsets());
- return *reinterpret_cast<js::YieldOffsetArray*>(data + yieldOffsetsOffset());
+ js::YieldAndAwaitOffsetArray& yieldAndAwaitOffsets() {
+ MOZ_ASSERT(hasYieldAndAwaitOffsets());
+ return *reinterpret_cast<js::YieldAndAwaitOffsetArray*>(data +
+ yieldAndAwaitOffsetsOffset());
}
bool hasLoops();