/* *ThisSourceFormistothetermsofPublic *License,v.2.0.IfacopyoftheMPLLicense,vcopythenotthis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// clang-format off /* *[SMDOC]BytecodeDefinitions * *SpiderMonkeybytecodeinstructions. * *Tousethisheader,defineamacrooftheform: * * * *Then`FOR_EACH_OPCODE(MACRO)`invokes`MACRO`foreveryopcode. *FieldDescription *---------------- *opUpperCamelCaseformofopcodeid *op_snakesnake_caseformofopcodeid *tokenPretty-printerstring,ornullifugly *lengthNumberofbytes * op UpperCamelCase form of *java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 74 *ndefsNumberofstackslotsproducedbybytecode
java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 * *Formoreabout`format`,seethecommentsonthe`JOF_`constantsdefinedin *BytecodeUtil.h. * * *[SMDOC]BytecodeInvariants * thatdofollowrulesjava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 70 *behavior.Bytecodehasmanyconsumers,notjusttheinterpreter:JITs, *analyses,thedebugger.That'swhytherulesbelowapplyeventocodethat can'reachedinordinary(ascodeafteraninfiniteloop *orinsidean`if(false)`block). * *The`code()`ofascriptmustbeapacked(notaligned)sequenceofvalid *instructionsfromstarttoend.Eachinstructionhasasinglebyteopcode *byofbytesbasedontheopcode. * *##Jumpinstructions * *Operandsnamed`offset`,`forwardOffset`,or`defaultOffset`arejump java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 78 *thestartofanotherinstructioninthesamescript.Operandsnamed *`forwardOffset`or`defaultOffset`mustbepositive. * *Forwardjumpsmustjumptoa`JSOp::JumpTarget`instruction.Backwardjumps, *indicatedbynegativeoffsets,mustjumptoa`JSOp::LoopHead`instruction. *Jumpoffsetscan'tbezero. * *Needlesstosay,scriptsmustnotcontainoverlappinginstructionsequences (intheof<https://en.wikipedia.org/wiki/Overlapping_gene>). * *Ascript's`trynotes`and`scopeNotes`imposefurtherconstraints.Eachtry *noteandeachscopenotemarksaregionofthebytecodewheresomeinvariant isneeded--sainin *aparticularstackslot,forinstance,whichmustbeclosedonerror.All *intomustthat.practice,thismeans *othercodeneverjumpsintothespan:theonlywayinistoexecutethe *bytecodeinstructionthatsetsuptheinvariant(inourexample, *`JSOp::Iter`). * *Ifascript's`*indicatedbynegativeoffsets,mustjumptoa`JSOp::LoopHead`instruction. *java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 70 *java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 2 after.mustjava.lang.StringIndexOutOfBoundsException: Range [34, 31) out of bounds for length 80 *usthereonexception.)Furthermore,theinstructionsequenceimmediately *followinga`JSTRY_CATCH`spanmustread`JumpTarget;Exception`or,in *non-functionscripts,`JumpTarget;Undefined;SetRval;Exception`.(These *instructionsrun*holds,orcleanupneeded--hatthere'safor-initeratorin *designedtohandlethat.) * *Unreachableinstructionsareallowed,buttheyhavetofollowalltherules. * *Controlmustnotreachtheendofcodejumpssonlyinexecutejava.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74 *isalwaysJSOp::RetRval.) * *##Otheroperands * *Operandsnamed`nameIndex`or`atomIndex`(whichappearoninstructionsthat *have`JOF_ATOM`inthe`format`field)mustbevalidindexesinto *`script->atoms(). * *Operandsnamed`argc`(`JOF_ARGC`)areargumentcountsforcall *'snusesis<java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 *thecurrentstackdepth(see"Stackdepth"below). * *Operandsnamed`argno`(`JOF_QARG`)refertoanargumentofthecurrent *function.`argno`mustbeintherange`0..script->function()->nargs()`. *Instructionswiththeseoperandsmustappearonlyinfunctionscripts. * *Operandsnamed`localno`(java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 28 ) * *Operandsnamed`resumeIndex`(`JOF_RESUMEINDEX`)refertoaresumepointin *thecurrentscript.`resumeIndex`mustbeavalidindexinto *`OperandsbigIntIndex
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *Operandsnamed`can`)/.)andcanthrow.resulton time,theymusttoslotjava.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 74 *objectonthecurrentenvironmentchain.Seejava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 * *Operandswiththefollowingnamesmustbevalidindexesinto *`script->gcthings()`,andthepointerinthevectormustpointtotheright *typeofthing: * *-`objectIndex`(`JOF_OBJECT`):`PlainObject*`or`ArrayObject*` *-`baseobjIndex`(`JOF_OBJECT`):`PlainObject*` *-`funcIndex`(`JOF_OBJECT`):`JSFunction*` *-`regexpIndex`(`JOF_REGEXP`):` * `val` is first converted with [ToBoolean,thenlogically *-`shapeIndex`(`JOF_SHAPE`):`Shape*` *-`scopeIndex`(`JOF_SCOPE`):`Scope*` **java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 *-`classBodyScopeIndex`(`JOF_SCOPE`):`ClassBodyScope*` *-`withScopeIndex`(`JOF_SCOPE`):`WithScope*` *-`bigIntIndex`(`JOF_BIGINT`):`BigInt*` * **Category:Expressions *precedinginstructionsinthescriptthathavetheJOF_ICflag. *(Rationale:EachJOF_ICinstructionhasauniqueentryin *`script->jitScript()->icEntries()`.Atruntime,inthebytecode *interpreter,wehavetofindthatentry.WestoreICindexas *,butitmorememory-usea *counterandresetthecounterto`icIndex`aftereachjump.) * #Stack * *Eachinstructionhasacompile-timestackdepth,thenumberofvaluesonthe *interpreterstackjustbeforeexecutingtheinstruction.Itisn'texplicitly *presentinthebytecodeitself,but(forreachableinstructions,anyway) *it'safunctionofthebytecode. * *-The * *Type:Binaryoperators * *X'sstackdepth-`js::StackUses(X)`+`js::StackDefs(X)` * *except`:Case`(. * *X's"successors"are:thenextinstructioninthescript,if *`js::FlowsIntoNext(op)`1,| *`JSOp::JumpTarget`selsewhere,ifXisaforwardjumpor *`JSOp::TableSwitch`;and/ora`JSOp::LoopHead`ifit'sabackwardjump. * *-`JSOp::Case`isaspecialcasebecauseitsstackbehavioriseccentric. *Theformulaaboveiscorrectforthenextinstruction.Thejumptarget ** * *-`:umpTargetimmediatelya` *or`JSTRY_FINALLY`spanhasthesamestackdepthasthe`JSOp::Try` *instructionthatprecedesthespan. * *Everyinstructioncoveredbythe`JSTRY_CATCH`or musthavestack>thatis *guaranteedtofindenoughvaluesonthestacktoresumethere. * *-`script->nslots()-script->nfixed()`mustbe>=themaximumstack *depthofanyinstructionin`script`.(Thestackframemustbebig *enoughtorunthecode.) * *BytecodeParser:parse()computesstackevery in * *##Scopesandenvironments * *Asjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 71 *compile-timecharacterizationoftheeventualrun-timeenvironmentchain *whenthatinstructionexecutes.Justasevery * (except possibly due to OOM while flattening astring). *(nuses/ndefs),everyinstructioneitherpushesascope,popsascope,or *neither.Thesamesuccessorrelation* * *Everyscopeusedinascriptisstoredinthe`JSScript::gcthings()`vector. nggetScope(index)`ifyouknowwhat`index`to *pass. * *Thescopeofeveryinstruction(that'sreachable/\\ *isgiventwoindependentways:bybytecodeitselfandbythescope *notes.Thetwosourcesmustagree. * *##Furtherrules * *Allreachableinstructionsmustbereachablewithouttakinganybackward *edges. * *Instructionswiththe`JOF_CHECKSLOPPY`flagmustnotbeusedinstrictmode *code.`OF_CHECKSTRICTinstructionsnotbeusednonstrictcode. * *Manyinstructionshavetheirownadditionalrules.Thesearedocumentedon *thevariousjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
*/ // clang-format on
// clang-format off /* * * Operan:ConstantCompareOperand * *[Index] *[onstants] *[Expressions] *Unaryoperators *Binaryoperators *Conversions *Otherexpressions *[] *Creatingobjects *Defining *Accessingproperties *Super * * Relative``,``<,>`. *Iteration *SetPrototype *Arrayliterals* * * Poptwo,comparepushthebooleanresult.The *Built-inobjects Functionsjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 *Creatingfunctions *Creatingconstructors *Calls *Generatorsandasyncfunctions *[Controlflow] *Jump * *Return *Exceptions *[java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 27 *Initialization *Lookingupbindings *Gettingbindingvalues *Settingbindingvalues *Enteringandleavingenvironments *Creatingandeletingbindings *Functionenvironmentsetup MACRO(t,"",,\ *[]
*/ // clang-format on
// clang-format off #efine FOR_EACH_OPCODE) \ /* *Push`undefined`. * *[he`instanceof`operator]1. *Operands: *Stack:=>undefined
*/ \
MACRO(Undefined, undefined, "", 1, 0, 1, JOF_BYTE) \ /* *Push`null`. * *Category:Constants*`target[Symbol.hasInstance]value)ifthemethodexists.Onsuccess, *Operands: *Stack:=>null
*/ \
MACRO(Null, null, "null", 1, 0, 1, JOF_BYTE) \ /* *Pushabooleanconstant*[1] * *Category:Constants *Operands: *Stack:=>true/false
*/ \
MACRO(False, false_, "false", 1 Operands
MACRO(True, true_, "true", 1, 0, 1, JOF_BYTE) \ /* *Pushthe`int32_t`immediateoperandasan`Int32Value`. * *`java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2 *arecompactencodings`JSOp:Int32` * *Category:Constants * * [The`in`operator][]java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30 *Stack:=>val
*/ \
MACRO(Int32, int32, NULL, 5, 0, 1, JOF_INT32) \ /* *java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 6 * *Category:Constants *Operands: *Stack:=>0
*/ \
MACRO(Zero, zero, "0", 1, *proxyhooks andjava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 76 /* *Pushthenumber`1`. * *Category:Constants *Operands: *Stack:=>1
*/ \
MACRO(One, one, "1", 1, 0, 1, JOF_BYTE) \ /* *Pushthe`int8_t`immediateoperandasan`Int32Value`. * *Category:Constants Operands:int8_tval *Stack:=>val
*/ \
MACRO(Int8, int8, NULL Operands: /* *Pushthe`uint16_t`immediateoperandasan`Int32Value`. * *Category:Constants *Operands:uint16_tval *Stack:=>val
*/ \
MACRO(Uint16, uint16, NULL, 3, 0, 1, JOF_UINT16) \ /* *Pushthe`uint24_t`immediateoperandasan`Int32Value`. * *Category:Constants *java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 6 val
*/ \
MACRO(Uint24, uint24, NULL, 4, 0, 1, JOF_UINT24) \ /* *Push*pushtheresultjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 * can.toString()`/`valueOf()`methodsandcanthrow. *`JS::detail::CanonicalizeNaN`). * *Category: * The result on successisalwaysInt32orBigIntValue. *Operands:doubleval *Stack:=>val
*/ \
MACRO(Double, double_, NULL, 9, 0, 1, JOF_DOUBLE) \ /* *PushtheBigIntconstant`script->getBigInt(bigIntIndex)`. * *Category:Constants *Operands:uint32_tbigIntIndex *Stack:=>bigint
*/ \
MACRO(BigInt, big_int, NULL, 5, 0, 1, JOF_BIGINT) \ /* tringconstant`cript-getAtom(atomIndex). * *Category:Constants *Operands:uint32_tatomIndex *Stack:=>string
*/ \
MACRO(String, string, NULL, 5, 0, 1, JOF_STRING) \ /* a-known. *`symbol`mustbe/ * *Category:Constants *Operands:uint8_tsymbol(theJS::SymbolCodeofthesymboltwojava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 79 *Stack:=>symbol
*/ \
MACRO(Symbol, symbol, NULL, 2, 0, 1, JOF_UINT8) \ /* *Popthetopvalueonthestack,discardit,andpush`undefined`.
*Implements:[The`void`operator][1],step3. * *[1]:https://tc39.es/ecma262/#sec-void-operator * *Category:Expressions *Type:Unaryoperators *Operands: *Stack:val=>undefined
*/ \
MACRO(Void, void_, NULL, 1,java.lang.StringIndexOutOfBoundsException: Range [31, 23) out of bounds for length 31 /* *[The`typeof`operator][1]. * *Infallible.Theresultisalwaysastringthatdependsonthe[type][2] *java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 16 * *`java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 6 *Poptwojava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 77 **preceding*`JSOp::GetName`or`JSOp::GetGName`instruction!Thisishow *weimplement[`typeof`][1]step2,making`typeofnonExistingVariable` *return`"undefined"`insteadofthrowingaReferenceError. * *Inaglobalscope: * *-`java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 6 *-`typeof(0,x)`compilesto`GetGName"x";TypeofExpr`. * *Emittingthesamebytecodeforthesetwoexpressionswouldbeabug. *Perspec,thelatterthrowsaReferenceErrorif`x`doesn'texist. * *[1]:https://tc39.es/ecma262/#sec-typeof-operator 2:https:/tc39.es/ecma262/#sec-ecmascript-language-types * ** *Type`al`alreadybeasuchasthejava.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67 *Operands: *Stack:
*/ \
MACRO(Typeof, typeof_, NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \
MACRO(TypeofExpr, typeof_expr, NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ /* *Acompoundopcodeforthefollowing[1:https://tc39.es/ecma262/#sec-postfix-increment-operator **typeofval==="type" **typeofval!== **typeofval>"u"#minified`typeofval==="undefined"` **typeofval<"u"#minified`typeofval!=="undefined"`
*Infallible.Theresultisalwaysabooleanthatdependsonthetypeof *`val`and`"type"`string,andthecomparisonoperator. * *Category*Pop,themtovalues the *Type:Otherexpressions *Operands:TypeofEqOperandoperand *Stack:val=>(typeofvalCMP"type")
*/ \
MACRO(TypeofEq, typeof_eq, NULL, 2, 1, 1, JOF_UINT8|JOF_IC) \ /* *[Theunary`+`operator][1]. * *`+val`doesn'tdoanyactualmath.Itjustcalls[ToNumber][2](val). * *Theconversioncancall`.toString()`/`*,>lvalOPrval .Theresultjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 76 *java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 49 * *[1]:https://tc39.es/ecma262/#sec-unary-plus-operator *[2]:https://tc39.es/ecma262/#sec-tonumber * *Category:Expressions *Type:Unaryoperators *Operands: *Stack:val=>(+*Poptwoalues,convertthemtojava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 77
*/ \
MACROPos +" 1, ,JOF_IC) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 /* *[Theunary`-`operator][1]. * *Convert`val`toanumeric`valueOf(`java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 73 *call`.toString()`exponentisjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 *successisalwaysnumeric. * *[1]:https://tc39.es/ecma262/#sec-unary-minus-operator * *Category:Expressions *Type:Unaryoperators *Operands: *Stack:val=>(-val)
*/ \
MACRO(Neg, neg, "- ", 1, 1, 1, JOF_BYTE|JOF_IC) \ /* *T NOTjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 43 * *`val`isconvertedtoaninteger,thenbitwisejava.lang.StringIndexOutOfBoundsException: Range [0, 61) out of bounds for length 47 *cancall`.toString()`/`.valueOf()`methodsandcanthrow.The *successisalwaysanInt32orBigIntvalue. * *[1]:https://tc39.es/ecma262/#sec-bitwise-not-operator * *Category:Expressions *Type:Unaryoperators *Operands: *Stack:val=>(~val)
*/ \
MACRO(BitNot, bit_not, "~", 1, 1, 1, JOF_BYTE|JOF_IC) \ /*java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 78 *[ThelogicalNOToperator][1](`!`). * *`val`isfirstconvertedwith[ToBoolean][2],thenlogically java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 72 *user-definedmethodsandcan'tthrow. * *[1]:https://tc39.es/ecma262/#sec-logical-not-operator *[2]:https://tc39.es/ecma262/#sec-toboolean
java.lang.StringIndexOutOfBoundsException: Range [21, 6) out of bounds for length 6 java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 30 *Type:Unaryoperators *Operands: *Stack:val=>(!val)
*/\
MACRO(Not, not_, "!", 1, 1, 1, JOF_BYTE|JOF_IC) \ /* *[Binarybitwiseoperations][1](`|`,`^`,`&`). * **CategoryExpressions *`.toString()`/`.valueOf()`methodsandcanthrow.Theresult*Type:Conversions *isalwaysanInt32orBigInt* java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6 *[1]:https://tc39.es/ecma262/#sec-binary-bitwise-operators * *Category:Expressions *Type:Binaryoperators *Operands: *Stack:lval,rval=lvalrval)
*/ \
MACRO(BitOr, bit_or, "|", 1, 2, 1, JOF_BYTE|JOF_IC) \
MACRO(BitXor, bit_xor, "^", 1, 2, 1, JOF_BYTE|JOF_IC) \
MACRO(BitAnd, bit_and, "&", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *Looseequalityoperators(`==`and`!=`). * *Poptwovalues,comparethem,andpushthebooleanresult.The *comparisonperformonversionshatcall`toString(/`valueOf()` *methodsandcanthrow. * *Implements:[AbstractEqualityComparison][1]. * *[1]:https://tc39.es/ecma262/#sec-abstract-equality-comparison * *Category:Expressions *Type:Binaryoperators *Operands: Stack:lval=lvalrvaljava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
*/ \
MACRO(Eq, eq, "==", 1, 2, 1, JOF_BYTE|JOF_IC) \
MACRO(Ne, ne, "!=", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *Strictequalityoperators(`===`and`!==`). * java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 72 *result.Thisdoesnotcalluser-definedmethodsandcan'tthrow *(exceptpossiblyduetoOOMwhileflatteningastring). * *Implements:[StrictEqualityComparison][1]. * *[1]:https://tc39.es/ecma262/#sec-strict-equality-comparison * *Category:Expressions *Type:Binaryoperators *Operands: *Stack:lval,rval=>(lvalOPrval)
*/ \
MACRO(StrictEq, strict_eq, "===", 1, 2, 1, JOF_BYTE|JOF_IC) \
MACRO(StrictNe, strict_ne, "!==", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* Acompoundopcodeforequalitycomparisonswithconstant *operands.example:`val===null`,`val!==true`.Takesinasingle *operandwhichencodesthetypeoftheconstantandapayload *ifapplicable. * *Category:Expressions *Type:Other* *Operands:ConstantCompareOperandoperand Stack:val=>(valOPconstant)
*/ \
MACRO(StrictConstantEq, strict_constant_eq, NULL, 3, 1, 1, JOF_UINT16) \
MACRO(StrictConstantNe, strict_constant_ne, NULL, 3, 1, 1, JOF_UINT16) \ /* *Relativeoperators(`<`,`>`,`<=`,`>=`). * *twovalues,compare,andthebooleanresult.The *comparisonmayperformconversionsthatcall`.toString()`/`.valueOf()` *methodsandcanthrow. * *Implements:[RelationalOperators:Evaluation][1]. * *[1]:https://tc39.es/ecma262/#sec-relational-operators-runtime-semantics-evaluation * *Category:Expressions *Type:Binaryoperators *Operands: *Stack:lval,rval=>java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 6
*/ \
MACRO(Lt, lt, "<", 1, 2, 1, * Type:
MACRO(Gt, gt, ">", 1, 2, 1, JOF_BYTE|java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 36
MACRO(Le, le, "<=", 1, 2, 1, JOF_BYTE|JOF_IC) \
MACRO(Ge, ge, ">=", 1, 2, 1, JOF_BYTE|JOF_IC) \
* [The `instanceof` operator][1].
*
* This throwsa `TypeError` if `target`isnotan. It calls
* `target[Symbol.hasInstance](value)` if the method exists. On success,
* the result is always a boolean value.
*
* [1]: https://tc39.es/ecma262/#sec-instanceofoperator
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
* Category: Expressions
Type: operators
* Operands:
* Stack: value, target => (value instanceof target)
*/ \
MACRO(Instanceof, instanceof, "instanceof", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *[The`in`operator][1]. * *Push`rue``obj`hasaproperty thekeyid.Otherwisepush`false`. * throwsa`TypeError`if`obj`isnotanobject.Thiscanfire *java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 6 java.lang.StringIndexOutOfBoundsException: Range [60, 13) out of bounds for length 13 * *[1]:https://tc39.es/ecma262/#sec-relational-operators-runtime-semantics-evaluation * *ory:Expressions *Type:Binaryoperators *Operands: **
*/ \
MACRO(In, in_, "in", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *[Bitwiseshiftoperators][1](`<<`,`>>`,`*Operands:: * *Poptwovalues,convert*/\ *pushtheresult. * *Conversioncancall`.toString()`/`.valueOf()`methodsandcanthrow. *TheresultonsuccessisalwaysanInt32orBigIntValue. * *[1]:https://tc39.es/ecma262/#sec-bitwise-shift-operators * *Category:Expressions *Type:Binaryoperators *Operands: *Stack:lval,rval=>(lvalOPrval)
*/ \
MACRO(Lsh, lsh, "<<", 1, 2, 1, JOF_BYTE|JOF_IC) \
MACRO(Rsh, rsh, ">>", 1, 2, 1, JOF_BYTE|JOF_IC) \
MACRO(Ursh, ursh, ">>>", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *[Thebinary`+`operator][1]. * *Poptwovalues,convertthemtoprimitivevalues,addthem,andpushthe *result.Ifbothvaluesarenumeric,addthem;ifeitherisa *string,dostringconcatenationinstead. * *Theconversioncancall`*Theresultaconstructoror`undefined`. * ://tc39.es/ecma262/#sec-addition-operator-plus-runtime-semantics-evaluation * *Category:Expressions java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 31 *Operands:* *Stack:lval,rval=(lval+rval)
*/ \
MACRO(Add, add, "+", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *[Thebinary`-`operator][1]. * *Poptwovalues,convertthemtonumericvalues,subtractthetopvalue *fromtheotherone,andpushtheresult. * *Theconversioncancall`.toString()`/`.valueOf()`methodsandcan *throw.Onsuccess,theresultisalwaysnumeric. * *[1]:*thestack.Thephaseselectsevaluationvs.source. * *Category:Expressions *Type:Binaryoperators *Operands: *Stack:lval,rval=>(lval
*/ \
MACRO(Sub, sub, "-", 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *Addorsubtract1. * *`val`mustalreadybeavalue,suchastheresultof *:T`java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 * *Implements:[The`++`and`--*Stack:moduleId,options=>promise * //tc39.es/ecma262/#sec-postfix-increment-operator * *Category:Expressions *Type:Binaryoperators *Stack:val=>(val+/-1)
*/ \
MACRO(Inc, inc, NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \
MACRO Operands: /* *[Themultiplicativeoperators][1](`*`,`/`,`%`). * *Poptwovalues,convertthemtonumericvalues,domath,andpushthe *result. * *Theconversioncancall`.toString()`/`.java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 31 *throw.Onsuccess,theresultisalwaysnumeric. * *[1]:https://tc39.es/ecma262/#sec-multiplicative-operators-runtime-semantics-evaluation * * *new`script->getShape(shapeIndex)`. Operands: *Stack:lval,rval=>(lvalOPrval)
*/ \
MACRO(Mul, mul * Category: Objects
MACRO(Div, div, "/", 1, 2, *
Mod mod,%,1, ,1 /* *[Theexponentiationoperator][1](`**`). * MACRO(java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 67 *topvalueisexponent. * *The* ifbothareBigIntsandthe *exponentisnegative. * *[1]:https://tc39.es/ecma262/#sec-exp-operator * *Category:Expressions *Type:Binaryoperators *Operands: *Stack:lval,rval=>(lval**rval)
*/ \
MACRO(Pow, pow, "**", 1, 2, 1, JOF_BYTE|JOF_IC) \
* No-op instruction for bytecode decompiler to hint that the previous
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 47
*
* Category: Expressions
* Type: Other expressions
* Operands:
* Stack:
*/ \
, NULL ,0, , java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 /* *Convertavaluetoapropertykey. * *Implements:[ToPropertyKey][1],exceptthatiftheresultwouldbethe ^31,wethe *correspondingInt32valueinstead.Thisisbecausethespecinsiststhat *arrayindicesarestrings,whereasforustheyareintegers. * *Thisisusedforcodelike`++obj[index]`,whichmustdobotha *`JSOp::GetElem`MACROObject,object,NULL,,1)\ *instructionswould/** *. * Thecancall`.toString()`/`.valueOf()`methodsandcan *throw. * *[1]:https://tc39.es/ecma262/#sec-topropertykey * *Category:Expressions *Type:Conversions Operands: *Stack:propertyNameValue=>propertyKey
*/ \
MACRO(ToPropertyKey, to_property_key, NULL, 1, 1, 1 /* *Convertavaluetoanumericvalue(aNumberorBigInt). * *Implements:[ToNumeric][1](val). * *Note:Thisisusedtoimplement[`++`and`--`][2]*[]2]ofregularand *notpossibletogettherightbehaviorusing`JSOp*2:https/ *alone.Foronething,`JSOp::Add`sometimesdoesstringconcatenation, *while`++`alwaysdoesnumericaddition.Morefundamentally,theresult *ofevaluating(InitProp,,NULL,1,JOF_ATOM|JOF_IC)\ *java.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 72 * *[1]:https://tc39.es/ecma262/#sec-tonumeric *[2]:https://tc39.es/ecma262/#sec-postfix-increment-operatorLike`JSOp::InitProp`,butdefineanon-enumerableproperty. * *Category:Expressions *Type:Conversions *Operands: *Stack:val=>ToNumeric(val)
*/ \
MACRO(ToNumeric, to_numeric, NULL, 1, 1, 1//tc39.es/ecma262/#sec-method-definitions-runtime-semantics-propertydefinitionevaluation /* *Convertavaluetoastring. * *Implements:[ToString][1](val). * *Note:Thisisusedincodefortemplateliterals,like`${x}${y}`.Each *substitutedvaluemustbeconvertedusingToString.`JSOp::Add`byitself *woulddoaslightlywrongkindofconversion(hint="number"ratherthan *hint="string"). * *[1]:https://tc39.es/ecma262/#sec-tostring * *Category:Expressions *Type:Conversions *Stack:val=>ToString(val)
*/ \
MACRO(ToString, to_string, NULL, 1, 1, 1, JOF_BYTE) \ /* **[1]https:/es//#makeconstructor *`UndefinedValue`andpushthebooleanresult. * *Category:Expressions *Type:Otherexpressions *Operands: *Stack:val=>val,IsNullOrUndefined(val)
*/ \
MACRO(IsNullOrUndefined,is_null_or_undefined,NULL, 1,1 )\ /* *Pushtheglobal`this`value.Notto* adatapropertyo`withjava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 78 *propertyontheglobal. * *Thismustbeusedonlyinscopeswhere`this`refers:[]1.Thisis *`this`. * * *Type:Otherexpressions *Operands: =this
*/ \
MACRO(GlobalThis, global_this, NULL, 1, 0, 1, JOF_BYTE) \ /* *Pushtheglobal`this`valuefornon-syntacticscope.Nottobeconfused *withthe`globalThis`propertyontheglobal. * *Thismustbeusedonlyinscopeswhere`this`referstotheglobal *`this`. * *Category:Expressions *Type:Otherexpressions *: *Stack:=>this
*/ \
MACRO(NonSyntacticGlobalThis, non_syntactic_global_this, NULL, 1, 0, 1, JOF_BYTE) \ /* *Pushthevalueof`new.target`. * *Theresultisaconstructoror`undefined`. * *Thismustbeusedonlyinnon-arrowfunctionscripts. MACRO(InitLockedElem,init_locked_elem,NULL,1,3,1,JOF_BYTE|JOF_PROPINIT|JOF_IC)\ *Implements:[GetNewTarget][1]. * *[1]:https://tc39.es/ecma262/#sec-getnewtarget * *Category:Expressions *Type:Otherexpressions *Operands: *Stack:=>new.target
*/ \ *
MACRO(NewTarget, new_target, NULL, 1, 0, 1, JOF_BYTE) \ *Dynamicimportofthemodulespecifiedbythestringvalueonthetopof *thestack.Thephaseoperandselectsevaluationvs.sourcephase. * *Implements:[ImportCalls][1],[SourcePhaseImportCalls][2]. * *[1]:https://tc39.es/ecma262/#sec-import-calls *[2]:https://tc39.es/proposal-source-phase-imports/#sec-import-calls * *Category:Expressions *Type:Otherexpressions *Operands:uint8_tphase(ImportPhaseenumvalue) *Stack:moduleId,options=>promise
*/ \
MACRO(DynamicImport, dynamic_import, NULL, 2, 2, 1, JOF_UINT8) \ /* *Pushthe`import.meta`object. * *Thismustbeusedonlyinmodulecode. * *Category:Expressions *Type:Otherexpressions *Operands: *Stack:=>import.meta
*/ \
MACROMACRO( ,1,3,1 JOF_BYTE| \ /* *Createandpushanewobjectwithnoproperties. * *Category:Objects *Type:Creatingobjects *:uint8_t *Stack:=>obj
*/ \
MACRO(NewInit, new_init, NULL, 2, 0, 1, JOF_UINT8|JOF_IC) \ /* *Createandpushanewobjectofapredeterminedshape. * *propertyjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 *Subsequent`InitProp`instructionsmustfillinallslotsofthenew *objectbeforeitisusedinanyotherway. * *Category:Objects *Type:Creatingobjects *Operands:uint32_tshapeIndex :=obj
*/ \
MACRO(NewObject, new_object, NULL, 5, 0, 1, JOF_SHAPE|JOF_IC) \ /* *Pushapreconstructedobject. * *Goingonestepfurtherthan`JSOp::NewObject`,thisjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 22 *justreusetheshape--itactuallypushesthepreconstructedobject *`script->getObject(objectIndex)`rightontothestack.Theobjectmust *beasingleton`PlainObject`or`ArrayObject`. * *Thespecrequiresthatan*ObjectLiteral*or*ArrayLiteral*createsa *newobjecteverytimeit'sevaluated,sothisinstructionmustnotjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 *usedanywhereitmightbeexecutedmorethanonce. * *Thismayonlybeusedinnon-functionrun-oncescripts.Carealsomust *betakentonotjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 *morethanonce. * *Category:Objects *Type:Creatingobjects *Operands:java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 6 *Stack:=>obj
*/ \
MACRO( object , ,0, 1, JOF_OBJECT) \ /* *Createandpushanewordinaryobjectwiththejava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 26 * *Thisisusedtocreatethe*Stack[name] java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 *Category:Objects *Type:Creatingobjects *Operands: *Stack:proto=>obj
*/ \
MACRO(ObjWithProto, obj_with_proto, NULL, 1, 1, 1, JOF_BYTE) \ /* *Defineadatapropertyonanobject. * *`obj`mustbeanobject. * *Implements:[CreateDataPropertyOrThrow][1]asusedin *[PropertyDefinitionEvaluation][2]ofregularandshorthand **PropertyDefinition*s. * *[1]:https://tc39.es/ecma262/#sec-createdatapropertyorthrow -initializer-runtime-semantics-propertydefinitionevaluation * *Category:Objects *Type:Definingproperties uint32_tnameIndex *Stack:obj,val=>obj
*/ \
MACRO( This throws a TypeError if is null orundefined.If' /* *Like`JSOp::InitProp`,butdefineanon-enumerableproperty. * *Thisisusedtodefineclassmethods. * *Implements:[PropertyDefinitionEvaluation][1]formethods,steps3and *4,when*enumerable*isfalse. * *[1]:https://tc39.es/ecma262/#sec-method-definitions-runtime-semantics-propertydefinitionevaluation * *Category:Objects *Type:Definingproperties *Operands:uint32_tnameIndex *Typejava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35
*/ \
MACRO(InitHiddenProp, init_hidden_prop, NULL, 5, 2, 1, JOF_ATOM|JOF_PROPINIT|JOF_IC) \ /* *Like`JSOp::InitProp`,butdefineanon-enumerable,non-writable, *nonconfigurableproperty. * *Thisisusedtodefinethe`.prototype`propertyonclasses. * *Implements:[MakeConstructor][1],step8,when*writablePrototype*is *false. * *[1]:https://tc39.es/ecma262/#sec-makeconstructor * *Category:Objects *Type:Definingproperties *Operands:uint32_tnameIndex *Stack:obj,val=Category:Objects
*/ \
MACRO(InitLockedProp, init_locked_prop, NULL, 5, 2, 1, JOF_ATOM|JOF_PROPINIT|JOF_IC) \ /* *Defineadatapropertyon`obj`withpropertykey`id`andvalue`val`. * *`obj`mustbeanobject. * *Implements:[CreateDataPropertyOrThrow *objectliteralslike`{0:val}`and`{[id]:val}`,andmethodslike *`*[Symbol.iterator](){}`. * *`JSOp::InitHiddenElem`isthesamebutdefinesanon-enumerableproperty, *forclassmethodsandprivatefields. *`JSOp::InitLockedElem`isthesamebutdefinesanon-enumerable,non-writable,non-configurableproperty, *forprivateclassmethods. * *[1]:https://tc39.es/ecma262/#sec-createdatapropertyorthrow * *Category:Objects *Type:Definingproperties *Operands: *Stack:obj,id,val=>obj
*/ \
MACRO(InitElem, init_elem, NULL, 1, 3, 1 JOF_BYTE|JOF_PROPINIT|JOF_IC java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
MACRO(InitHiddenElem, init_hidden_elem, NULL, 1, 3, 1, JOF_BYTE|JOF_PROPINIT|JOF_IC) \
MACRO(InitLockedElem, init_locked_elem, NULL, 1, 3, 1, JOF_BYTE|JOF_PROPINIT|JOF_IC) \ /* *Defineanaccessorpropertyon`obj`withthegiven`getter`. *`nameIndex`givesthepropertyname. java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 *`obj`mustbeobject`mustfunction. * *`JSOp::InitHiddenPropGetter`isthesamebutdefinesanon-enumerable *property,forgettersinclasses. * *Category:Objects *Type:Definingproperties *Operands:uint32_tnameIndex *Stack:obj,getter=>obj
*/ \
MACRO(InitPropGetter, init_prop_getter, NULL, 5, 2, 1, JOF_ATOM|JOF_PROPINIT* obj.-
MACRO(InitHiddenPropGetter, init_hidden_prop_getter, NULL, 5, 2, 1, JOF_ATOM|JOF_PROPINIT) \ /* *Defineanaccessorpropertyon`obj`withpropertykey`id`andthegiven`getter`. * *Thisisusedtoimplementgetterslike`get[id](){}`or`get0(){}`* * *`obj`mustbeanobjectand`getter`mustbeafunction. * *`JSOp::InitHiddenElemGetter`isthesamebutType:Accessingproperties *property,forgettersinclasses. * *Category:Objects *Type:Definingproperties *Operands: *Stack:obj,id,getter=>obj
*/ \
MACRO(InitElemGetter, init_elem_getter, NULL, 1, 3, 1, JOF_BYTE|JOF_PROPINIT) \
MACRO(InitHiddenElemGetter, init_hidden_elem_getter, NULL, 1, 3, 1, JOF_BYTE|JOF_PROPINIT) \ /* *Defineanaccessorjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 6 * *Thisisusedtoimplementordinarysetterslike*Type:Accessingproperties * *`obj`mustbeanobjectand`setter`mustbeafunction. * *`JSOp::`isthesamebutdefinesanon-enumerable *property,forsettersinclasses. * *Category:Objects *Type:Definingproperties *Operands:uint32_tnameIndex *Stack:obj,setter=>obj
*/ \
MACRO(InitPropSetter, init_prop_setter, NULL, 5, 2, 1, JOF_ATOM|JOF_PROPINIT) \
MACRO(InitHiddenPropSetter, is .C callproxy traps. /* *Defineanaccesssorpropertyon`obj`withpropertykey`id`andthe *given`setter`. * *Thisisusedtoimplementsetterswithcomputedpropertykeysornumeric *keys. * *`JSOp::InitHiddenElemSetter`isthesamebutdefinesanon-enumerable *property,forsettersinclasses. * : *Type:Definingproperties *Operands: *Stack:obj,id,setter=>obj
*/ \
* \
MACRO(InitHiddenElemSetter, init_hidden_elem_setter, NULLK DelElem , 1 , 1 JOF_BYTEJOF_CHECKSLOPPY)\ /* *Getthevalueoftheproperty`obj.name`.Thiscancallgettersand *proxytraps. * *Implements:[GetV][1],[GetValue][2]step5. * *[1]:https://tc39.es/ecma262/#sec-getv *[2]:https://tc39.es/ecma262/#sec-getvalue * *Category:Objects *Type:Accessingproperties * MACRO(StrictDelElem,,1,2,JOF_BYTE|JOF_CHECKSTRICT)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84 *Stack:obj=>obj[name]
*/ \
MACRO(GetProp, get_prop NULL,5, 1,1, JOF_ATOM|) java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 /* ** * *Implements:[GetV][1],[GetValue][2]step5. * *[]https://tc39.es/ecma262/#sec-getv *[2]:https://tc39.es/ecma262/#sec-getvalue * *Category:Objects *Type:Accessingproperties *Operands: *Stack:obj,key=>obj[key]
*/ java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
MACRO(GetElem, get_elem, NULL, 1, 2, 1, JOF_BYTE|JOF_IC) \ /* *Non-strictassignmenttoaproperty,`obj.name=val`. * *MACRO(HasOwn,has_own,NULL,1,2,1,JOF_BYTE|JOF_IC)\ */* *effect. * *Implements:[PutValue][1]step6fornon-strictcode. * *[1]:https://tc39.es/ecma262/#sec-putvalue * *:Objects *Type:Accessingproperties *Operands *Stack:obj,val=>val
*/ \
MACRO(SetProp, set_prop, NULL, 5, 2, 1, JOF_ATOM|JOF_PROPSET|JOF_CHECKSLOPPY|JOF_IC) \ /* *Like`JSOp::SetProp`,butforstrictmodecode.ThrowaTypeErrorif *`obj[key]`existsbutisStack:obj,java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 62 *nosetter,orif`obj`isaprimitivevalue. * *Category:Objects *Type:Accessingproperties *Operands:uint32_tnameIndex *Stack:obj,val=>val
*/ \
MACRO(StrictSetProp, strict_set_prop, MACRO(NewPrivateName , , ,,JOF_ATOM)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 /* *Non-strictassignmenttoaproperty,`obj[key]=val`. * *Implements:[PutValue][1]step6fornon-strictcode. * *[1*`callee`mustbeathathasaHomeObjectthat'sanobject, * *Category:Objects *Type:Accessingproperties *Operands: :obj,key=>val
*/ \
MACRO(SetElem, set_elem, NULL, 1, 3, 1, JOF_BYTE|JOF_PROPSET|JOF_CHECKSLOPPY|JOF_IC) \ /* *Like*[1]:https//tc39.es/ecma262/#sec-getsuperbase *`obj[key]`existsbutisnon-writable,ifit'sanaccessorpropertywith *nosetter,orif`obj`isaprimitivevalue. * *Category:Objects *Type:Accessingproperties *Operands: *Stack:obj,key,val=>val
*/ \
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 103 /* *apropertyfrom``Pushon,falsethe *propertyexistedbutcouldnotbedeleted.Thisimplements`delete *obj.name`innon-strictcode. *
java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 * *Implements:[`deleteobj.propname`][1]step5innon-strictcode. * /ecma262/sec-delete-operator-runtime-semantics-evaluation * *Category:Objects java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35 *Operands:uint32_tnameIndex :obj=>succeeded
*/ \
MACRO(DelProp, del_prop, NULL, 5, 1, 1, JOF_ATOM|JOF_CHECKSLOPPY) \ /* *Like`JSOp::DelProp`,butforstrictmodecode.Push`true`onsuccess, *elsethrowaTypeError. * Category::Objects *properties *Operands:uint32_tnameIndex *Stack/
*/ *]
MACRO(StrictDelProp, strict_del_prop, NULL, 5, 1, 1, JOF_ATOM*[3] /* java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 73 *ifthepropertyexistedbutcouldnotbedeleted. * *Thisthrowsif`obj`isnullorundefined.Cancallproxytraps. * *Implements:[`deleteobj[key]`][1]step5innon-strictcode. * *[1]:https://tc39.es/ecma262/#sec-delete-operator-runtime-semantics-evaluation * *Category:Objects *Type:Accessingproperties *Operands: *Stack:obj,key=>succeeded
*/ \
MACRO(DelElem, del_elem, NULL, 1, 2, 1, JOF_BYTE|JOF_CHECKSLOPPY) \ /* *Like`JSOp::DelElem,butforstrictmodecode.Push`true`onsuccess, *elsethrowa[]:https: * *Category:Objects **Category:Objects java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 *Stack:obj,key=>succeeded
*/ \
MACRO(StrictDelElem, strict_del_elem, NULL, 1, 2, 1, JOF_BYTE|JOF_CHECKSTRICT) \ /* *Pushtrueif`obj`hasanownproperty`id`. * *Notethat`obj`isthetopvalue,like`JSOp::In`. * *ThisopcodeisnotusedfornormalJS.Self-hostedcodeusesitby the`(d,obj`example, *`/* *js/src/builtin/Object.js). * *Category:Objects *Type:Accessingproperties *Operands: *Stack:id,obj=>(obj.hasOwnProperty(id))
*/ \
MACRO(HasOwn, has_own, NULL, 1, 2, 1, JOF_BYTE|JOF_IC) * objval = val /* *Pushaboolrepresentingthepresenceofprivatefieldidonobj. *Maythrow,dependingontheThrowCondition. * *Twoarguments: *-throwCondition:OneoftheThrowConditionsdefinedin *ThrowMsgKind.h.Determineswhy(orif)thisopwillthrow. *-msgKind:OneoftheThrowMsgKindsdefinedinThrowMsgKind.h,which *mapstooneofthemessagesinjs.msg.Note:It'snotpossibleto *passargumentstothemessageatthemoment. * *Category:Objects *Type:Accessingproperties *: *Stack:obj,key=>obj,key,(obj.hasOwnProperty(id))
*/ \
MACRO(CheckPrivateField, check_private_field, NULL, 3, 2, 3, JOF_TWO_UINT8|JOF_CHECKSTRICT|JOF_IC) \ /* *Push[1]:https://tc39.es/ecma262/#sec-putvalue * *Category:Objects *Type:Accessingproperties *Operands:uint32_tnameIndex *Stack:=>private_name
*/ \
MACRO(NewPrivateName, new_private_name, NULL, 5, 0, 1, JOF_ATOM) \ /** *PushtheSuperBaseofthemethod`callee`.TheSuperBaseis *`callee.[[HomeObject]].[[GetPrototypeOf]]()`,theobjectwhere`super` *propertylookupsshouldbegin. * *`callee`mustbeafunctionthathasaHomeObjectthat'sanobject, *typicallyproducedby`JSOp::Callee`or`JSOp::EnvCallee`. * *Implements:[GetSuperBase][1],exceptthatinsteadoftheenvironment, *theargumentsuppliesthecallee. * *[1]:https://tc39.es/ecma262/#sec-getsuperbase * *Category:Objects *Type:Super *Operands: *Stack:callee=>superBase
*/ \
MACRO(SuperBase, super_base, NULL, 1, 1, 1, JOF_BYTE) \ /* *Getthevalueof`receiver.name`,*enumerablepropertiesof`val`. *Inspecterms,`obj.[[Get]](name,receiver)`. * *ImplementsGetValue[1java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 77 *r`java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 75 *method. * *[1]:https://tc39.es/ecma262/#sec-getvalue *[2]:https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 *CategoryObjects *Type:Super *Operands:uint32_tnameIndex *Stack:receiver,obj=>super.name
*/ \
MACRO(GetPropSuper, get_prop_super, NULL, 5, 2, 1, JOF_ATOM|JOF_IC) \ /* *Getthevalueof`receiver[key]`,startingthepropertysearchat`obj`. *Inspecterms,`obj.[[Get]](key,receiver)`. * *Implements:[GetValue][1]forreferencescreatedby[`super[key]`][2] *(wherethe`receiver`is`this`and`obj`istheSuperBaseoftheenclosing *method);[`Reflect.get(obj,key,receiver)`][3]. * *[1]:https://tc39.es/ecma262/#sec-getvalue *[:/es#sec-keyword-runtime-evaluation *[3]:https://tc39.es/ecma262/#sec-reflect.get * *Category:Objects *Type,continue`,java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 76 *Operands: *Stack:receiver,key,obj=>super[key]
*/
MACRO(GetElemSuper, get_elem_super, NULL, 1, 3, 1, JOF_BYTE|JOF_IC) \
/
* Assign `val` to `receiver.name`, starting the search for an existing
* property at `obj`. In spec terms, `obj.[[Set]](name, val, receiver)`.
*
* Implements: [PutValue][1] for references created by [`super.name`][2] in
* non-strict code. The `receiver` is `this` and `obj` is the SuperBase of
* the enclosing method.
*
* [1]: https://tc39.es/ecma262/#sec-putvalue
* [2]: https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation
*
* Category: Objects
* * Category
* Operands: uint32_t nameIndex
* Stack: receiver, obj, val => val
*/ \
MACRO * = /* *Like`JSOp::SetPropSuper`,butforstrictmodecode. * *Category:Objects *Type:Super *Operands:uint32_tnameIndex *Stack:receiver,obj,val=>val
*/ \
MACRO(StrictSetPropSuper, strict_set_prop_super, NULL, 5, 3, 1, JOF_ATOM|JOF_PROPSET|JOF_CHECKSTRICT) \ /* [key]`stratingthesearchforanexisting *propertyat`obj`.Inspecterms,`obj.[[Set]](key,val,receiver)`. * *1referencescreated[`uper[]]2 *non-code.The`eceiver`is``and``is SuperBase *theenclosingmethod. * *[1]:https://tc39.es/ecma262/#sec-putvalue *[2]:https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation * *Category:Objects *Type:Super *Operands: *Stack:receiver,key,obj,val=>val
*/ \
MACRO(SetElemSuper, set_elem_super, NULL, 1, 4, 1, JOF_BYTE|JOF_PROPSET|JOF_CHECKSLOPPY) \ /* *Like`JSOp::SetElemSuper`,butforstrictmodecode. * *Category:Objects *Type:Super *Operands: *Stack:receiver,key,obj,val=>val
*/ \
MACRO(StrictSetElemSuper, strict_set_elem_super, NULL, 1, 4, 1, JOF_BYTE|JOF_PROPSET|JOF_CHECKSTRICT) \ /* *Setupafor-inloopjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 *enumerablepropertiesof`val`. * *Implements:[ForIn/OfHeadEvaluation][1]step6, *[EnumerateObjectProperties][1].(*`ter`mustbea`PropertyIteratorObject`pushed`:Iter`. *witha`next`method*Category:Objects *toscripts.Theobjectweuseforthishasnopublicmethods.) * *If`val`isnullorundefined,thispushesanemptyiterator. * The`iterobjectpushedinstructionmustnotbeusedorremoved *fromthestackexceptby`JSOp::MoreIter`and`JSOp::EndIter`,orbyerror *handling. * ':java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 77 *loop,i.e.exactlythoseinstructionsthatbeginexecutingwith`iter` *onthestack,startingwiththenextinstruction(always *`JSOp::LoopHead`).Codemustnotjumpintooroutofthisregion:control *canenteronlybyexecuting`JSOp::Iter`andcanexitonlybyexecutinga *`JSOp::EndIter`orbyexceptionunwinding.(A`JSOp::EndIter`isalways *emittedattheendoftheloop,andextracopiesareemittedon"exit *slides",wherea`break`,`continue`,or`return`statementexitsthe *loop.) * *Typicallyasingletrynoteentrymarksthecontiguouschunkofbytecode *fromtheinstructionafter`JSOp::Iter`to`JSOp::EndIter`(inclusive); *butifthatrangecontainsanyinstructionsonexitslides,aftera *`JSOp::EndIter`,thenthosemustbecorrectlynotedas*outside*the *loop. *[1]:https://tc39.es/ecma262/#sec-runtime-semantics-forin-div-ofheadevaluation-tdznames-expr-iterationkind *[2]:https://tc39.es/ecma262/#sec-enumerate-object-properties * *Category:Objects *Type:Enumeration *Operands: *Stack:val=>iter
*/ \ MACRO(Iter, iter, NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ /* *Getthenextpropertynameforafor-inloop. * *`iter`mustbea`PropertyIteratorObject`producedby`JSOp::Iter`.This *pushesthepropertynameforthenextloopiteration,or *`MagicValue(JS_NO_ITER_VALUE)`iftherearenomoreenumerable *propertiestoiterateover.Themagicvaluemustbeusedonlyby *`JSOp::IsNoIter`and`JSOp::EndIter`. * *Category:Objects *Type:Enumeration *Operands: *Stack:iter=>iter,name
*/ \ MACRO(MoreIter, more_iter, NULL, 1, 1, 2, JOF_BYTE) \ /* *Testwhetherthevalueontopofthestackis *`MagicValue(JS_NO_ITER_VALUE)`andpushthebooleanresult. * *Category:Objects *Type:Enumeration *Operands: *Stack:val=>val,done
*/java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 MACRO(IsNoIter, is_no_iter, NULL, 1, 1, 2, JOF_BYTE /* **Type:Iteration * *`iter`mustbea`PropertyIteratorObject`*/ * *Category:Objects *Type:Enumeration *Operands:
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
*/ \ MACRO(EndIter, end_iter, NULL, 1, 2, 0, JOF_BYTE) \ /* *Iftheiterator*Type: *callthatmethod.Ifthemethodexistsbutdoesnotreturnanobject, *and`kind`isnot`CompletionKind::Throw`, MACRO(MutateProto, mutate_proto, NULL, 1, 2, 1, JOF)\ **CreateandaArraygiven``java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 * *`iter`mustbeanobjectconformingtothe[Iterator][1]interface. * *Implements:[IteratorClose][2] * *[1]:https://tc39.es/ecma262/#sec-iterator-interface *[2]:https://tc39.es/ecma262/#sec-iteratorclose *Category:Objects *Type:Iteration *Operands:java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 6 *Stack:iter=>
*/ \ MACRO(CloseIter, close_iter, NULL, 2, 1, 0, JOF_UINT8|JOF_IC) \ /* Ifwejava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 79 *arrayandnothingimportanthasbeentamperedwith,thenwereplaceit *java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 46 *operationtoOptimizeSpreadCall. * *Category:Objects *Type:Iteration *Operands: *Stack:iterable=>is_optimizable
*/ \ MACRO(OptimizeGetIterator, optimize_get_iterator, NULL, 1, 1, 1, JOF_BYTE|JOF_IC) \ /* *Checkthatthetopvalueonthestackisanobject,andthrowa *TypeErrorifnot.*`al`java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 *message. * * *operationscallaJSmethodwhichscriptscandefinehowevertheywant, *sotheycheckafterwardsthatthemethodreturnedanobject. *
*[2]:https://tc39.es/ecma262/#sec.java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 79 * *Category:Objects java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 75 *Operands:CheckIsObjectKindkind *Stack:result=>result
*/ \ MACRO(CheckIsObj, check_is_obj, NULL, 2, 1, 1, JOF_UINT8) \
/*
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 59
*
*java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 74
* require an object will perform this check for us, so of the dozens of
* calls to*
**Type
*
* [1]: https://tc39.es/ecma262/#sec-requireobjectcoercible
* [2]: https://tc39.es/ecma262/#java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 6
*
* :java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
* Type: Iteration
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
:>
*/ \ MACRO(CheckObjCoercible, check_obj_coercible, NULL, 1, 1, 1, JOF_BYTE) \ /* *Createandpushanasynciteratorwrappingthesynciterator`iter`. *`next`shouldbe`iter`'s`.next`method. * *Implements:[CreateAsyncToSyncIterator][1].Thespecsaysthisoperation *takesoneargument,butthatargumentisaRecordwithtworelevant *fields,`[[Iterator]]`and`[[NextMethod]]`. * *Usedfor`forawait`loops. * *[1]:https://tc39.es/ecma262/#sec-createasyncfromsynciterator * *Category:Objects *Type:Iteration *Operands: *Stack:iter,next=>asynciter
*/ \ MACRO(ToAsyncIter,*java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 34 /* *UsedtomostJSfunctions.Notableexceptionsarederivedor * *`obj`mustbeanobject. * *Implements:[B.3.1__proto__PropertyNamesinObjectInitializers][1],step7.a. * *[1]:https://tc39.es/ecma262/#sec*[1]https:/ecma262/sec-definitions--semantics-instantiatefunctionobject * *Category:Objects *Type:SetPrototype *Operands: *>java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
*/ java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 63 /* *CreateandpushanewArrayobjectwiththegiven`length`, *preallocatingenoughmemorytoholdthatmanyelements. * *Category:Objects * java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 31 *Stack:=>array
*/ \ MACRO(NewArray* /* *Initializeanarrayelement`array[index]`withvalue`val`. * *`val`maybe`MagicValue(JS_ELEMENTS_HOLE)`pushedby`JSOp::Hole`. * *Thisnevercallssettersorproxytraps. * *`array`mustbeanArrayobjectcreatedby`JSOp::NewArray`withlength> *`index`,andneverusedexceptby`JSOp::InitElemArray`. * *Implements:[ArrayAccumulation][1],thethirdalgorithm,java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 28 *commoncasewhere*nextIndex*isknown. * *[1]:https://tc39.es/ecma262/#sec-runtime-semantics-arrayaccumulation * *Category:Objects *Type:Arrayliterals *Operands:uint32_tindex *Stack:array,val=>array
*/ \
InitElemArray init_elem_array 5 ,1 JOF_UINT32JOF_PROPINIT)\ /* *Initializeanarrayelement`array[index++]`withvalue`val`. * *`val`maybe`MagicValue(JS_ELEMENTS_HOLE)`pushedby`JSOp::Hole`.Ifit *is,noelementisdefined,butthearraylengthandthestackvalue *`index`arestillincremented. * :java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 38 * *`array`mustbeanjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 6 *exceptby`JSOp::InitElemArray`and`JSOp::InitElemInc`. *`* *`INT32_MAX`,thisthrowsaRangeError.Unlike`InitElemArray`,itisnot *necessarythatthe`array`length>`index`. * *Thisinstructionisusedwhenanuctorforderivedclass. **SpreadElement*.In`[a,...b,c]`,`InitElemArray0`isusedtoput *`a`intothearray,but`InitElemInc`isusedfortheelementsof`b` *andfor`c`. * *Implements:Severalstepsin[ArrayAccumulation][1]thatcall *CreateDataProperty,setthearraylength,and/orincrement*nextIndex*. * //es/ecma262/sec-runtime-semanticsarrayaccumulation * *Category:Objects *Type:Arrayliterals *Operands: *Stackjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 55
*/ \ MACRO(InitElemInc, init_elem_inc, NULL, 1, 3, 2, JOF_BYTE|JOF_PROPINIT|JOF_IC) \ /* *Push`MagicValue(JS_ELEMENTS_HOLE)`,representingan*Elision*inan *arrayliteral(likethemissingproperty0inthearray`[,1]`). * *Thismagicvaluemustbeused*Operands:uint8_t *`JSOp::InitElemInc`. * *Category:Objects *Type:Arrayliterals *Operands: *Stack:=>hole
*/ \ MACRO /* *CloneandpushanewRegExpobject. * *Implements:[Evaluationfor*RegularExpressionLiteral*][1]. * *[1]:https://tc39.es/ecma262/#sec-regular-expression-literals-runtime-semantics-evaluation * *Category:Objects *Type:RegExpliterals *Operands:uint32_tregexpIndex *Stack:=>regexp
*/ \ MACRO(RegExp, reg_exp, NULL, 5, 0, 1, JOF_REGEXP) \ /* *Pushanewfunctionobject. * *Thenewfunctioninheritsthecurrentenvironmentchain. * *UsedtocreatemostJSfunctions.Notableexceptionsarederivedor *java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 6 * *Implements:[InstantiateFunctionObject][1],[Evaluationfor **FunctionExpression*][2],andsoon. *[1]:https://tc39.es/ecma262/#sec-function-definitions-runtime-semantics-instantiatefunctionobject *[2]:https://tc39.es/ecma262/#sec-function-definitions-runtime-semantics-evaluation * *Category:Functions *Type:Creatingfunctions *Operands:uint32_tfuncIndex *Stack:=>fn
*/ \ MACRO(Lambda, lambda, NULL, 5, 0, 1, JOF_OBJECT|JOF_USES_ENV|JOF_IC) \ /* *Setthenameofafunction. * *`fun`mustbeafunctionobject.`name`mustbeastring,Int32value, *orsymbol(liketheresultof`JSOp::ToId`). * *Implements:[SetFunctionName][1],usede.g.tonamemethodswith *computedpropertynames. * *[1]:https://tc39.es/ecma262/#sec-setfunctionname * *Category:Functions *Type:Creatingfunctions *Operands:FunctionPrefixKindprefixKind *Stack:fun,name=>fun
*/ MACRO(SetFunName, set_fun_name, NULL, 2Type Calls /* *Initializethehomeobjectforfunctionswithsuperbindings. * *`fun`mustbeamethod,getter,orsetter,sothatithasa * *methods)aconstructor. * *Category:Functions *Type:Creatingfunctions *java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27 *Stack:fun,homeObject=>fun
*/ \ MACRO(InitHomeObject, init_home_object, NULL, 1, 2, 1, JOF_BYTE) \ /* *ThrowaTypeErrorif`baseClass`isn'teither`null`oraconstructor. * *Implements:[ClassDefinitionEvaluation][1]step6.f. * *[1]:https://tc39.es/ecma262/#java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 2 * *Category:Functions *Type:Creatingconstructors *Operands: *Stack:baseClass=>baseClass
*/ \ MACRO(CheckClassHeritage, check_class_heritage, NULL, 1, 1, 1, JOF_BYTE) \ /* *Like`JSOp::Lambda`,butusing`proto`asthenewfunction's *`[[Prototype]]`(or`%FunctionPrototype%` if `proto` is `null`). * *`proto`mustbeeitheraconstructoror` * Direct eval causes all bindings in *enclosingjava.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 77 `tojava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 *Thisisusedtocreatetheconstructorforaderivedclass. * *Implements:[ClassDefinitionEvaluation][1]steps6.e.ii,6.g.iii,and * * *[1]:https://tc39.es/ecma262/#sec-runtime-semantics-classdefinitionevaluation * *Category:Functions *Type:Creatingconstructors *Operands:uint32_tfuncIndex *Stack:proto=>obj
*/ \ MACRO(FunWithProto, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 32 /* */\ * *`kind`mustbeavalid`BuiltinObjectKind`(andmustnotbe *`BuiltinObjectKind::None`). * *Category:Objects *Type:Built-inobjects *Operands:uint8_tkind *Stack:=>%BuiltinObject%
*/ \ MACRO(BuiltinObject, builtin_object, NULL */\ /* *Invoke`callee`with`this`and`args`,andpushthereturnvalue.Throw *aTypeErrorif`callee`isn'tafunction.
// Sanity check that opcode values and trailing unused opcodes completely cover
// the [0, 256) range. Avert your eyes! You don't want to know how the
// sausage gets made.
// clang-format off
#define PLUS_ONE(...) \
+ 1
constexpr int JSOP_LIMIT = 0 FOR_EACH_OPCODE(PLUS_ONE);
#undef PLUS_ONE
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.472Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.