summaryrefslogtreecommitdiff
path: root/deps/v8/src/runtime/runtime.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/runtime/runtime.h')
-rw-r--r--deps/v8/src/runtime/runtime.h581
1 files changed, 285 insertions, 296 deletions
diff --git a/deps/v8/src/runtime/runtime.h b/deps/v8/src/runtime/runtime.h
index 5a6364f644..f091d99092 100644
--- a/deps/v8/src/runtime/runtime.h
+++ b/deps/v8/src/runtime/runtime.h
@@ -17,10 +17,10 @@
namespace v8 {
namespace internal {
-// * Each intrinsic is consistently exposed in JavaScript via 2 names:
+// * Each intrinsic is exposed in JavaScript via:
// * %#name, which is always a runtime call.
-// * %_#name, which can be inlined or just a runtime call, the compiler in
-// question decides.
+// * (optionally) %_#name, which can be inlined or just a runtime call, the
+// compiler in question decides.
//
// * IntrinsicTypes are Runtime::RUNTIME and Runtime::INLINE, respectively.
//
@@ -31,53 +31,57 @@ namespace internal {
// * Each compiler has an explicit list of intrisics it supports, falling back
// to a simple runtime call if necessary.
-
// Entries have the form F(name, number of arguments, number of values):
// A variable number of arguments is specified by a -1, additional restrictions
-// are specified by inline comments
-
-#define FOR_EACH_INTRINSIC_ARRAY(F) \
- F(ArrayIncludes_Slow, 3, 1) \
- F(ArrayIndexOf, 3, 1) \
- F(ArrayIsArray, 1, 1) \
- F(ArraySpeciesConstructor, 1, 1) \
- F(EstimateNumberOfElements, 1, 1) \
- F(GetArrayKeys, 2, 1) \
- F(GrowArrayElements, 2, 1) \
- F(HasComplexElements, 1, 1) \
- F(IsArray, 1, 1) \
- F(MoveArrayContents, 2, 1) \
- F(NewArray, -1 /* >= 3 */, 1) \
- F(NormalizeElements, 1, 1) \
- F(PrepareElementsForSort, 2, 1) \
- F(TransitionElementsKind, 2, 1) \
+// are specified by inline comments. To declare only the runtime version (no
+// inline), use the F macro below. To declare the runtime version and the inline
+// version simultaneously, use the I macro below.
+
+#define FOR_EACH_INTRINSIC_ARRAY(F, I) \
+ F(ArrayIncludes_Slow, 3, 1) \
+ F(ArrayIndexOf, 3, 1) \
+ F(ArrayIsArray, 1, 1) \
+ F(ArraySpeciesConstructor, 1, 1) \
+ F(EstimateNumberOfElements, 1, 1) \
+ F(GetArrayKeys, 2, 1) \
+ F(GrowArrayElements, 2, 1) \
+ F(HasComplexElements, 1, 1) \
+ I(IsArray, 1, 1) \
+ F(MoveArrayContents, 2, 1) \
+ F(NewArray, -1 /* >= 3 */, 1) \
+ F(NormalizeElements, 1, 1) \
+ F(PrepareElementsForSort, 2, 1) \
+ F(TransitionElementsKind, 2, 1) \
+ F(TransitionElementsKindWithKind, 2, 1) \
F(TrySliceSimpleNonFastElements, 3, 1)
-#define FOR_EACH_INTRINSIC_ATOMICS(F) \
- F(AtomicsAdd, 3, 1) \
- F(AtomicsAnd, 3, 1) \
- F(AtomicsCompareExchange, 4, 1) \
- F(AtomicsExchange, 3, 1) \
- F(AtomicsNumWaitersForTesting, 2, 1) \
- F(AtomicsOr, 3, 1) \
- F(AtomicsSub, 3, 1) \
- F(AtomicsXor, 3, 1) \
+#define FOR_EACH_INTRINSIC_ATOMICS(F, I) \
+ F(AtomicsLoad64, 2, 1) \
+ F(AtomicsStore64, 3, 1) \
+ F(AtomicsAdd, 3, 1) \
+ F(AtomicsAnd, 3, 1) \
+ F(AtomicsCompareExchange, 4, 1) \
+ F(AtomicsExchange, 3, 1) \
+ F(AtomicsNumWaitersForTesting, 2, 1) \
+ F(AtomicsOr, 3, 1) \
+ F(AtomicsSub, 3, 1) \
+ F(AtomicsXor, 3, 1) \
F(SetAllowAtomicsWait, 1, 1)
-#define FOR_EACH_INTRINSIC_BIGINT(F) \
- F(BigIntBinaryOp, 3, 1) \
- F(BigIntCompareToBigInt, 3, 1) \
- F(BigIntCompareToNumber, 3, 1) \
- F(BigIntCompareToString, 3, 1) \
- F(BigIntEqualToBigInt, 2, 1) \
- F(BigIntEqualToNumber, 2, 1) \
- F(BigIntEqualToString, 2, 1) \
- F(BigIntToBoolean, 1, 1) \
- F(BigIntToNumber, 1, 1) \
- F(BigIntUnaryOp, 2, 1) \
+#define FOR_EACH_INTRINSIC_BIGINT(F, I) \
+ F(BigIntBinaryOp, 3, 1) \
+ F(BigIntCompareToBigInt, 3, 1) \
+ F(BigIntCompareToNumber, 3, 1) \
+ F(BigIntCompareToString, 3, 1) \
+ F(BigIntEqualToBigInt, 2, 1) \
+ F(BigIntEqualToNumber, 2, 1) \
+ F(BigIntEqualToString, 2, 1) \
+ F(BigIntToBoolean, 1, 1) \
+ F(BigIntToNumber, 1, 1) \
+ F(BigIntUnaryOp, 2, 1) \
F(ToBigInt, 1, 1)
-#define FOR_EACH_INTRINSIC_CLASSES(F) \
+#define FOR_EACH_INTRINSIC_CLASSES(F, I) \
F(DefineClass, -1 /* >= 3 */, 1) \
F(HomeObjectSymbol, 0, 1) \
F(LoadFromSuper, 3, 1) \
@@ -93,20 +97,16 @@ namespace internal {
F(ThrowSuperNotCalled, 0, 1) \
F(ThrowUnsupportedSuperError, 0, 1)
-#define FOR_EACH_INTRINSIC_COLLECTIONS(F) \
- F(GetWeakMapEntries, 2, 1) \
- F(GetWeakSetValues, 2, 1) \
- F(MapGrow, 1, 1) \
- F(MapIteratorClone, 1, 1) \
- F(MapShrink, 1, 1) \
- F(SetGrow, 1, 1) \
- F(SetIteratorClone, 1, 1) \
- F(SetShrink, 1, 1) \
- F(TheHole, 0, 1) \
- F(WeakCollectionDelete, 3, 1) \
+#define FOR_EACH_INTRINSIC_COLLECTIONS(F, I) \
+ F(MapGrow, 1, 1) \
+ F(MapShrink, 1, 1) \
+ F(SetGrow, 1, 1) \
+ F(SetShrink, 1, 1) \
+ F(TheHole, 0, 1) \
+ F(WeakCollectionDelete, 3, 1) \
F(WeakCollectionSet, 4, 1)
-#define FOR_EACH_INTRINSIC_COMPILER(F) \
+#define FOR_EACH_INTRINSIC_COMPILER(F, I) \
F(CompileForOnStackReplacement, 1, 1) \
F(CompileLazy, 1, 1) \
F(CompileOptimized_Concurrent, 1, 1) \
@@ -117,17 +117,14 @@ namespace internal {
F(NotifyDeoptimized, 0, 1) \
F(ResolvePossiblyDirectEval, 6, 1)
-#define FOR_EACH_INTRINSIC_DATE(F) \
- F(DateCurrentTime, 0, 1) \
- F(IsDate, 1, 1)
+#define FOR_EACH_INTRINSIC_DATE(F, I) F(DateCurrentTime, 0, 1)
-#define FOR_EACH_INTRINSIC_DEBUG(F) \
+#define FOR_EACH_INTRINSIC_DEBUG(F, I) \
F(ClearStepping, 0, 1) \
F(CollectGarbage, 1, 1) \
F(DebugBreakAtEntry, 1, 1) \
F(DebugCollectCoverage, 0, 1) \
F(DebugGetLoadedScriptIds, 0, 1) \
- F(DebugIsActive, 0, 1) \
F(DebugOnFunctionCall, 2, 1) \
F(DebugPopPromise, 0, 1) \
F(DebugPrepareStepInSuspendedGenerator, 0, 1) \
@@ -149,164 +146,136 @@ namespace internal {
F(SetGeneratorScopeVariableValue, 4, 1) \
F(LiveEditPatchScript, 2, 1)
-#define FOR_EACH_INTRINSIC_FORIN(F) \
- F(ForInEnumerate, 1, 1) \
+#define FOR_EACH_INTRINSIC_FORIN(F, I) \
+ F(ForInEnumerate, 1, 1) \
F(ForInHasProperty, 2, 1)
#ifdef V8_TRACE_IGNITION
-#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F) \
- F(InterpreterTraceBytecodeEntry, 3, 1) \
+#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) \
+ F(InterpreterTraceBytecodeEntry, 3, 1) \
F(InterpreterTraceBytecodeExit, 3, 1)
#else
-#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F)
+#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I)
#endif
#ifdef V8_TRACE_FEEDBACK_UPDATES
-#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F) \
+#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) \
F(InterpreterTraceUpdateFeedback, 3, 1)
#else
-#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F)
+#define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I)
#endif
-#define FOR_EACH_INTRINSIC_INTERPRETER(F) \
- FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F) \
- FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F) \
+#define FOR_EACH_INTRINSIC_INTERPRETER(F, I) \
+ FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) \
+ FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) \
F(InterpreterDeserializeLazy, 2, 1)
-#define FOR_EACH_INTRINSIC_FUNCTION(F) \
- F(Call, -1 /* >= 2 */, 1) \
- F(FunctionGetName, 1, 1) \
+#define FOR_EACH_INTRINSIC_FUNCTION(F, I) \
+ I(Call, -1 /* >= 2 */, 1) \
F(FunctionGetScriptSource, 1, 1) \
F(FunctionGetScriptId, 1, 1) \
F(FunctionGetScriptSourcePosition, 1, 1) \
F(FunctionGetSourceCode, 1, 1) \
F(FunctionIsAPIFunction, 1, 1) \
- F(IsConstructor, 1, 1) \
F(IsFunction, 1, 1) \
- F(SetCode, 2, 1) \
F(SetNativeFlag, 1, 1)
-#define FOR_EACH_INTRINSIC_GENERATOR(F) \
+#define FOR_EACH_INTRINSIC_GENERATOR(F, I) \
F(AsyncGeneratorHasCatchHandlerForPC, 1, 1) \
- F(AsyncGeneratorReject, 2, 1) \
- F(AsyncGeneratorResolve, 3, 1) \
- F(AsyncGeneratorYield, 3, 1) \
- F(CreateJSGeneratorObject, 2, 1) \
- F(GeneratorClose, 1, 1) \
+ I(AsyncGeneratorReject, 2, 1) \
+ I(AsyncGeneratorResolve, 3, 1) \
+ I(AsyncGeneratorYield, 3, 1) \
+ I(CreateJSGeneratorObject, 2, 1) \
+ I(GeneratorClose, 1, 1) \
F(GeneratorGetFunction, 1, 1) \
- F(GeneratorGetInputOrDebugPos, 1, 1) \
- F(GeneratorGetResumeMode, 1, 1)
+ I(GeneratorGetResumeMode, 1, 1)
#ifdef V8_INTL_SUPPORT
-#define FOR_EACH_INTRINSIC_INTL(F) \
- F(AvailableLocalesOf, 1, 1) \
- F(BreakIteratorBreakType, 1, 1) \
- F(BreakIteratorCurrent, 1, 1) \
- F(BreakIteratorFirst, 1, 1) \
- F(BreakIteratorNext, 1, 1) \
- F(CanonicalizeLanguageTag, 1, 1) \
- F(CollatorResolvedOptions, 1, 1) \
- F(CreateBreakIterator, 3, 1) \
- F(CreateDateTimeFormat, 3, 1) \
- F(CreateNumberFormat, 3, 1) \
- F(CurrencyDigits, 1, 1) \
- F(DateCacheVersion, 0, 1) \
- F(DefaultNumberOption, 5, 1) \
- F(DefineWEProperty, 3, 1) \
- F(FormatList, 2, 1) \
- F(FormatListToParts, 2, 1) \
- F(GetDefaultICULocale, 0, 1) \
- F(GetNumberOption, 5, 1) \
- F(IntlUnwrapReceiver, 5, 1) \
- F(IsInitializedIntlObjectOfType, 2, 1) \
- F(IsWellFormedCurrencyCode, 1, 1) \
- F(MarkAsInitializedIntlObjectOfType, 2, 1) \
- F(ParseExtension, 1, 1) \
- F(PluralRulesResolvedOptions, 1, 1) \
- F(PluralRulesSelect, 2, 1) \
- F(ToDateTimeOptions, 3, 1) \
- F(ToLocaleDateTime, 6, 1) \
- F(StringToLowerCaseIntl, 1, 1) \
- F(StringToUpperCaseIntl, 1, 1) \
- F(SupportedLocalesOf, 3, 1) \
-// End of macro.
+#define FOR_EACH_INTRINSIC_INTL(F, I) \
+ F(AvailableLocalesOf, 1, 1) \
+ F(CanonicalizeLanguageTag, 1, 1) \
+ F(DateCacheVersion, 0, 1) \
+ F(FormatList, 2, 1) \
+ F(FormatListToParts, 2, 1) \
+ F(GetDefaultICULocale, 0, 1) \
+ F(StringToLowerCaseIntl, 1, 1) \
+ F(StringToUpperCaseIntl, 1, 1) // End of macro.
#else
-#define FOR_EACH_INTRINSIC_INTL(F)
+#define FOR_EACH_INTRINSIC_INTL(F, I)
#endif // V8_INTL_SUPPORT
-#define FOR_EACH_INTRINSIC_INTERNAL(F) \
- F(AllocateInNewSpace, 1, 1) \
- F(AllocateInTargetSpace, 2, 1) \
- F(AllocateSeqOneByteString, 1, 1) \
- F(AllocateSeqTwoByteString, 1, 1) \
- F(AllowDynamicFunction, 1, 1) \
- F(CheckIsBootstrapping, 0, 1) \
- F(CreateAsyncFromSyncIterator, 1, 1) \
- F(CreateListFromArrayLike, 1, 1) \
- F(CreateTemplateObject, 1, 1) \
- F(DeserializeLazy, 1, 1) \
- F(ExportFromRuntime, 1, 1) \
- F(GetAndResetRuntimeCallStats, -1 /* <= 2 */, 1) \
- F(IncrementUseCounter, 1, 1) \
- F(InstallToContext, 1, 1) \
- F(Interrupt, 0, 1) \
- F(IS_VAR, 1, 1) \
- F(NewReferenceError, 2, 1) \
- F(NewSyntaxError, 2, 1) \
- F(NewTypeError, 2, 1) \
- F(OrdinaryHasInstance, 2, 1) \
- F(PromoteScheduledException, 0, 1) \
- F(ReportMessage, 1, 1) \
- F(ReThrow, 1, 1) \
- F(RunMicrotaskCallback, 2, 1) \
- F(RunMicrotasks, 0, 1) \
- F(StackGuard, 0, 1) \
- F(Throw, 1, 1) \
- F(ThrowApplyNonFunction, 1, 1) \
- F(ThrowCalledNonCallable, 1, 1) \
- F(ThrowConstructedNonConstructable, 1, 1) \
- F(ThrowConstructorReturnedNonObject, 0, 1) \
- F(ThrowInvalidStringLength, 0, 1) \
- F(ThrowInvalidTypedArrayAlignment, 2, 1) \
- F(ThrowIteratorResultNotAnObject, 1, 1) \
- F(ThrowNotConstructor, 1, 1) \
- F(ThrowRangeError, -1 /* >= 1 */, 1) \
- F(ThrowReferenceError, 1, 1) \
- F(ThrowStackOverflow, 0, 1) \
- F(ThrowSymbolAsyncIteratorInvalid, 0, 1) \
- F(ThrowSymbolIteratorInvalid, 0, 1) \
- F(ThrowThrowMethodMissing, 0, 1) \
- F(ThrowTypeError, -1 /* >= 1 */, 1) \
- F(Typeof, 1, 1) \
+#define FOR_EACH_INTRINSIC_INTERNAL(F, I) \
+ F(AllocateInNewSpace, 1, 1) \
+ F(AllocateInTargetSpace, 2, 1) \
+ F(AllocateSeqOneByteString, 1, 1) \
+ F(AllocateSeqTwoByteString, 1, 1) \
+ F(AllowDynamicFunction, 1, 1) \
+ F(CheckIsBootstrapping, 0, 1) \
+ I(CreateAsyncFromSyncIterator, 1, 1) \
+ F(CreateListFromArrayLike, 1, 1) \
+ F(CreateTemplateObject, 1, 1) \
+ F(DeserializeLazy, 1, 1) \
+ F(ExportFromRuntime, 1, 1) \
+ F(GetAndResetRuntimeCallStats, -1 /* <= 2 */, 1) \
+ F(IncrementUseCounter, 1, 1) \
+ F(InstallToContext, 1, 1) \
+ F(Interrupt, 0, 1) \
+ F(IS_VAR, 1, 1) \
+ F(NewReferenceError, 2, 1) \
+ F(NewSyntaxError, 2, 1) \
+ F(NewTypeError, 2, 1) \
+ F(OrdinaryHasInstance, 2, 1) \
+ F(PromoteScheduledException, 0, 1) \
+ F(ReportMessage, 1, 1) \
+ F(ReThrow, 1, 1) \
+ F(RunMicrotaskCallback, 2, 1) \
+ F(RunMicrotasks, 0, 1) \
+ F(StackGuard, 0, 1) \
+ F(Throw, 1, 1) \
+ F(ThrowApplyNonFunction, 1, 1) \
+ F(ThrowCalledNonCallable, 1, 1) \
+ F(ThrowConstructedNonConstructable, 1, 1) \
+ F(ThrowConstructorReturnedNonObject, 0, 1) \
+ F(ThrowInvalidStringLength, 0, 1) \
+ F(ThrowInvalidTypedArrayAlignment, 2, 1) \
+ F(ThrowIteratorError, 1, 1) \
+ F(ThrowIteratorResultNotAnObject, 1, 1) \
+ F(ThrowNotConstructor, 1, 1) \
+ F(ThrowRangeError, -1 /* >= 1 */, 1) \
+ F(ThrowReferenceError, 1, 1) \
+ F(ThrowStackOverflow, 0, 1) \
+ F(ThrowSymbolAsyncIteratorInvalid, 0, 1) \
+ F(ThrowSymbolIteratorInvalid, 0, 1) \
+ F(ThrowThrowMethodMissing, 0, 1) \
+ F(ThrowTypeError, -1 /* >= 1 */, 1) \
+ F(Typeof, 1, 1) \
F(UnwindAndFindExceptionHandler, 0, 1)
-#define FOR_EACH_INTRINSIC_LITERALS(F) \
+#define FOR_EACH_INTRINSIC_LITERALS(F, I) \
F(CreateArrayLiteral, 4, 1) \
F(CreateArrayLiteralWithoutAllocationSite, 2, 1) \
F(CreateObjectLiteral, 4, 1) \
F(CreateObjectLiteralWithoutAllocationSite, 2, 1) \
F(CreateRegExpLiteral, 4, 1)
-#define FOR_EACH_INTRINSIC_MATHS(F) F(GenerateRandomNumbers, 0, 1)
-
-#define FOR_EACH_INTRINSIC_MODULE(F) \
- F(DynamicImportCall, 2, 1) \
- F(GetImportMetaObject, 0, 1) \
+#define FOR_EACH_INTRINSIC_MODULE(F, I) \
+ F(DynamicImportCall, 2, 1) \
+ I(GetImportMetaObject, 0, 1) \
F(GetModuleNamespace, 1, 1)
-#define FOR_EACH_INTRINSIC_NUMBERS(F) \
- F(GetHoleNaNLower, 0, 1) \
- F(GetHoleNaNUpper, 0, 1) \
- F(IsSmi, 1, 1) \
- F(IsValidSmi, 1, 1) \
- F(MaxSmi, 0, 1) \
- F(NumberToString, 1, 1) \
- F(SmiLexicographicCompare, 2, 1) \
- F(StringParseFloat, 1, 1) \
- F(StringParseInt, 2, 1) \
+#define FOR_EACH_INTRINSIC_NUMBERS(F, I) \
+ F(GetHoleNaNLower, 0, 1) \
+ F(GetHoleNaNUpper, 0, 1) \
+ I(IsSmi, 1, 1) \
+ F(IsValidSmi, 1, 1) \
+ F(MaxSmi, 0, 1) \
+ F(NumberToString, 1, 1) \
+ F(SmiLexicographicCompare, 2, 1) \
+ F(StringParseFloat, 1, 1) \
+ F(StringParseInt, 2, 1) \
F(StringToNumber, 1, 1)
-#define FOR_EACH_INTRINSIC_OBJECT(F) \
+#define FOR_EACH_INTRINSIC_OBJECT(F, I) \
F(AddDictionaryProperty, 3, 1) \
F(AddElement, 3, 1) \
F(AddNamedProperty, 4, 1) \
@@ -317,8 +286,8 @@ namespace internal {
F(CompleteInobjectSlackTrackingForMap, 1, 1) \
F(CopyDataProperties, 2, 1) \
F(CopyDataPropertiesWithExcludedProperties, -1 /* >= 1 */, 1) \
- F(CreateDataProperty, 3, 1) \
- F(CreateIterResultObject, 2, 1) \
+ I(CreateDataProperty, 3, 1) \
+ I(CreateIterResultObject, 2, 1) \
F(DefineAccessorPropertyUnchecked, 5, 1) \
F(DefineDataPropertyInLiteral, 6, 1) \
F(DefineGetterPropertyUnchecked, 4, 1) \
@@ -329,13 +298,11 @@ namespace internal {
F(GetOwnPropertyDescriptor, 2, 1) \
F(GetOwnPropertyKeys, 2, 1) \
F(GetProperty, 2, 1) \
- F(GetPrototype, 1, 1) \
F(HasFastPackedElements, 1, 1) \
F(HasInPrototypeChain, 2, 1) \
- F(HasProperty, 2, 1) \
+ I(HasProperty, 2, 1) \
F(InternalSetPrototype, 2, 1) \
- F(IsJSReceiver, 1, 1) \
- F(KeyedGetProperty, 2, 1) \
+ I(IsJSReceiver, 1, 1) \
F(NewObject, 2, 1) \
F(ObjectCreate, 2, 1) \
F(ObjectEntries, 1, 1) \
@@ -347,62 +314,59 @@ namespace internal {
F(ObjectValues, 1, 1) \
F(ObjectValuesSkipFastPath, 1, 1) \
F(OptimizeObjectForAddingMultipleProperties, 2, 1) \
- F(SameValue, 2, 1) \
- F(SameValueZero, 2, 1) \
+ F(PerformSideEffectCheckForObject, 1, 1) \
F(SetDataProperties, 2, 1) \
- F(SetProperty, 4, 1) \
+ F(SetKeyedProperty, 4, 1) \
+ F(SetNamedProperty, 4, 1) \
+ F(StoreDataPropertyInLiteral, 3, 1) \
F(ShrinkPropertyDictionary, 1, 1) \
F(ToFastProperties, 1, 1) \
- F(ToInteger, 1, 1) \
- F(ToLength, 1, 1) \
+ I(ToLength, 1, 1) \
F(ToName, 1, 1) \
- F(ToNumber, 1, 1) \
+ I(ToNumber, 1, 1) \
F(ToNumeric, 1, 1) \
- F(ToObject, 1, 1) \
- F(ToPrimitive, 1, 1) \
- F(ToPrimitive_Number, 1, 1) \
- F(ToString, 1, 1) \
- F(TryMigrateInstance, 1, 1) \
- F(ValueOf, 1, 1)
-
-#define FOR_EACH_INTRINSIC_OPERATORS(F) \
- F(Add, 2, 1) \
- F(Equal, 2, 1) \
- F(GreaterThan, 2, 1) \
- F(GreaterThanOrEqual, 2, 1) \
- F(LessThan, 2, 1) \
- F(LessThanOrEqual, 2, 1) \
- F(NotEqual, 2, 1) \
- F(StrictEqual, 2, 1) \
+ I(ToObject, 1, 1) \
+ I(ToString, 1, 1) \
+ F(TryMigrateInstance, 1, 1)
+
+#define FOR_EACH_INTRINSIC_OPERATORS(F, I) \
+ F(Add, 2, 1) \
+ F(Equal, 2, 1) \
+ F(GreaterThan, 2, 1) \
+ F(GreaterThanOrEqual, 2, 1) \
+ F(LessThan, 2, 1) \
+ F(LessThanOrEqual, 2, 1) \
+ F(NotEqual, 2, 1) \
+ F(StrictEqual, 2, 1) \
F(StrictNotEqual, 2, 1)
-#define FOR_EACH_INTRINSIC_PROMISE(F) \
- F(EnqueueMicrotask, 1, 1) \
- F(PromiseHookAfter, 1, 1) \
- F(PromiseHookBefore, 1, 1) \
- F(PromiseHookInit, 2, 1) \
- F(AwaitPromisesInit, 3, 1) \
- F(PromiseMarkAsHandled, 1, 1) \
- F(PromiseRejectEventFromStack, 2, 1) \
- F(PromiseResult, 1, 1) \
- F(PromiseRevokeReject, 1, 1) \
- F(PromiseStatus, 1, 1) \
- F(RejectPromise, 3, 1) \
- F(ResolvePromise, 2, 1) \
- F(PromiseRejectAfterResolved, 2, 1) \
+#define FOR_EACH_INTRINSIC_PROMISE(F, I) \
+ F(EnqueueMicrotask, 1, 1) \
+ F(PromiseHookAfter, 1, 1) \
+ F(PromiseHookBefore, 1, 1) \
+ F(PromiseHookInit, 2, 1) \
+ F(AwaitPromisesInit, 3, 1) \
+ F(PromiseMarkAsHandled, 1, 1) \
+ F(PromiseRejectEventFromStack, 2, 1) \
+ F(PromiseResult, 1, 1) \
+ F(PromiseRevokeReject, 1, 1) \
+ F(PromiseStatus, 1, 1) \
+ I(RejectPromise, 3, 1) \
+ I(ResolvePromise, 2, 1) \
+ F(PromiseRejectAfterResolved, 2, 1) \
F(PromiseResolveAfterResolved, 2, 1)
-#define FOR_EACH_INTRINSIC_PROXY(F) \
- F(CheckProxyGetSetTrapResult, 2, 1) \
- F(CheckProxyHasTrap, 2, 1) \
- F(GetPropertyWithReceiver, 3, 1) \
- F(IsJSProxy, 1, 1) \
- F(JSProxyGetHandler, 1, 1) \
- F(JSProxyGetTarget, 1, 1) \
+#define FOR_EACH_INTRINSIC_PROXY(F, I) \
+ F(CheckProxyGetSetTrapResult, 2, 1) \
+ F(CheckProxyHasTrap, 2, 1) \
+ F(GetPropertyWithReceiver, 3, 1) \
+ F(IsJSProxy, 1, 1) \
+ F(JSProxyGetHandler, 1, 1) \
+ F(JSProxyGetTarget, 1, 1) \
F(SetPropertyWithReceiver, 5, 1)
-#define FOR_EACH_INTRINSIC_REGEXP(F) \
- F(IsRegExp, 1, 1) \
+#define FOR_EACH_INTRINSIC_REGEXP(F, I) \
+ I(IsRegExp, 1, 1) \
F(RegExpExec, 4, 1) \
F(RegExpExecMultiple, 4, 1) \
F(RegExpInitializeAndCompile, 3, 1) \
@@ -412,7 +376,7 @@ namespace internal {
F(StringReplaceNonGlobalRegExpWithFunction, 3, 1) \
F(StringSplit, 3, 1)
-#define FOR_EACH_INTRINSIC_SCOPES(F) \
+#define FOR_EACH_INTRINSIC_SCOPES(F, I) \
F(DeclareEvalFunction, 2, 1) \
F(DeclareEvalVar, 1, 1) \
F(DeclareGlobals, 3, 1) \
@@ -438,7 +402,7 @@ namespace internal {
F(StoreLookupSlot_Strict, 2, 1) \
F(ThrowConstAssignError, 0, 1)
-#define FOR_EACH_INTRINSIC_STRINGS(F) \
+#define FOR_EACH_INTRINSIC_STRINGS(F, I) \
F(FlattenString, 1, 1) \
F(GetSubstitution, 5, 1) \
F(InternalizeString, 1, 1) \
@@ -447,7 +411,6 @@ namespace internal {
F(StringBuilderConcat, 3, 1) \
F(StringBuilderJoin, 3, 1) \
F(StringCharCodeAt, 2, 1) \
- F(StringCharFromCode, 1, 1) \
F(StringEqual, 2, 1) \
F(StringGreaterThan, 2, 1) \
F(StringGreaterThanOrEqual, 2, 1) \
@@ -458,19 +421,18 @@ namespace internal {
F(StringLessThan, 2, 1) \
F(StringLessThanOrEqual, 2, 1) \
F(StringMaxLength, 0, 1) \
- F(StringNotEqual, 2, 1) \
F(StringReplaceOneCharWithString, 3, 1) \
F(StringSubstring, 3, 1) \
F(StringToArray, 2, 1) \
F(StringTrim, 2, 1)
-#define FOR_EACH_INTRINSIC_SYMBOL(F) \
+#define FOR_EACH_INTRINSIC_SYMBOL(F, I) \
F(CreatePrivateFieldSymbol, 0, 1) \
F(CreatePrivateSymbol, -1 /* <= 1 */, 1) \
F(SymbolDescriptiveString, 1, 1) \
F(SymbolIsPrivate, 1, 1)
-#define FOR_EACH_INTRINSIC_TEST(F) \
+#define FOR_EACH_INTRINSIC_TEST(F, I) \
F(Abort, 1, 1) \
F(AbortJS, 1, 1) \
F(ClearFunctionFeedback, 1, 1) \
@@ -482,7 +444,7 @@ namespace internal {
F(DebugTrace, 0, 1) \
F(DebugTrackRetainingPath, -1, 1) \
F(DeoptimizeFunction, 1, 1) \
- F(DeoptimizeNow, 0, 1) \
+ I(DeoptimizeNow, 0, 1) \
F(DeserializeWasmModule, 2, 1) \
F(DisallowCodegenFromStrings, 1, 1) \
F(DisallowWasmCodegen, 1, 1) \
@@ -490,8 +452,11 @@ namespace internal {
F(FreezeWasmLazyCompilation, 1, 1) \
F(GetCallable, 0, 1) \
F(GetDeoptCount, 1, 1) \
+ F(GetInitializerFunction, 1, 1) \
F(GetOptimizationStatus, -1, 1) \
F(GetUndetectable, 0, 1) \
+ F(GetWasmExceptionId, 2, 1) \
+ F(GetWasmExceptionValues, 1, 1) \
F(GetWasmRecoveredTrapCount, 0, 1) \
F(GlobalPrint, 1, 1) \
F(HasDictionaryElements, 1, 1) \
@@ -538,6 +503,7 @@ namespace internal {
F(ArraySpeciesProtector, 0, 1) \
F(TypedArraySpeciesProtector, 0, 1) \
F(PromiseSpeciesProtector, 0, 1) \
+ F(StringIteratorProtector, 0, 1) \
F(SystemBreak, 0, 1) \
F(TraceEnter, 0, 1) \
F(TraceExit, 1, 1) \
@@ -548,37 +514,36 @@ namespace internal {
F(WasmMemoryHasFullGuardRegion, 1, 1) \
F(SetWasmThreadsEnabled, 1, 1)
-#define FOR_EACH_INTRINSIC_TYPEDARRAY(F) \
- F(ArrayBufferNeuter, 1, 1) \
- F(ArrayBufferViewWasNeutered, 1, 1) \
- F(IsTypedArray, 1, 1) \
- F(TypedArrayCopyElements, 3, 1) \
- F(TypedArrayGetBuffer, 1, 1) \
- F(TypedArrayGetLength, 1, 1) \
- F(TypedArraySet, 2, 1) \
+#define FOR_EACH_INTRINSIC_TYPEDARRAY(F, I) \
+ F(ArrayBufferNeuter, 1, 1) \
+ F(ArrayBufferViewWasNeutered, 1, 1) \
+ I(IsTypedArray, 1, 1) \
+ F(TypedArrayCopyElements, 3, 1) \
+ F(TypedArrayGetBuffer, 1, 1) \
+ F(TypedArrayGetLength, 1, 1) \
+ F(TypedArraySet, 2, 1) \
F(TypedArraySortFast, 1, 1)
-#define FOR_EACH_INTRINSIC_WASM(F) \
- F(ThrowWasmError, 1, 1) \
- F(ThrowWasmStackOverflow, 0, 1) \
- F(WasmExceptionGetElement, 1, 1) \
- F(WasmExceptionSetElement, 2, 1) \
- F(WasmGetExceptionRuntimeId, 0, 1) \
- F(WasmGrowMemory, 2, 1) \
- F(WasmRunInterpreter, 2, 1) \
- F(WasmStackGuard, 0, 1) \
- F(WasmThrow, 0, 1) \
- F(WasmThrowCreate, 2, 1) \
- F(WasmThrowTypeError, 0, 1) \
+#define FOR_EACH_INTRINSIC_WASM(F, I) \
+ F(ThrowWasmError, 1, 1) \
+ F(ThrowWasmStackOverflow, 0, 1) \
+ F(WasmExceptionGetElement, 2, 1) \
+ F(WasmExceptionSetElement, 3, 1) \
+ F(WasmExceptionGetTag, 1, 1) \
+ F(WasmGrowMemory, 2, 1) \
+ F(WasmRunInterpreter, 2, 1) \
+ F(WasmStackGuard, 0, 1) \
+ F(WasmThrowCreate, 2, 1) \
+ F(WasmThrowTypeError, 0, 1) \
F(WasmCompileLazy, 2, 1)
-#define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \
- F(DebugBreakOnBytecode, 1, 2) \
+#define FOR_EACH_INTRINSIC_RETURN_PAIR_IMPL(F, I) \
+ F(DebugBreakOnBytecode, 1, 2) \
F(LoadLookupSlotForCall, 1, 2)
// Most intrinsics are implemented in the runtime/ directory, but ICs are
// implemented in ic.cc for now.
-#define FOR_EACH_INTRINSIC_IC(F) \
+#define FOR_EACH_INTRINSIC_IC(F, I) \
F(ElementsTransitionAndStoreIC_Miss, 6, 1) \
F(KeyedLoadIC_Miss, 4, 1) \
F(KeyedStoreIC_Miss, 5, 1) \
@@ -599,44 +564,55 @@ namespace internal {
F(CloneObjectIC_Miss, 4, 1) \
F(CloneObjectIC_Slow, 2, 1)
+#define FOR_EACH_INTRINSIC_RETURN_OBJECT_IMPL(F, I) \
+ FOR_EACH_INTRINSIC_ARRAY(F, I) \
+ FOR_EACH_INTRINSIC_ATOMICS(F, I) \
+ FOR_EACH_INTRINSIC_BIGINT(F, I) \
+ FOR_EACH_INTRINSIC_CLASSES(F, I) \
+ FOR_EACH_INTRINSIC_COLLECTIONS(F, I) \
+ FOR_EACH_INTRINSIC_COMPILER(F, I) \
+ FOR_EACH_INTRINSIC_DATE(F, I) \
+ FOR_EACH_INTRINSIC_DEBUG(F, I) \
+ FOR_EACH_INTRINSIC_FORIN(F, I) \
+ FOR_EACH_INTRINSIC_FUNCTION(F, I) \
+ FOR_EACH_INTRINSIC_GENERATOR(F, I) \
+ FOR_EACH_INTRINSIC_IC(F, I) \
+ FOR_EACH_INTRINSIC_INTERNAL(F, I) \
+ FOR_EACH_INTRINSIC_INTERPRETER(F, I) \
+ FOR_EACH_INTRINSIC_INTL(F, I) \
+ FOR_EACH_INTRINSIC_LITERALS(F, I) \
+ FOR_EACH_INTRINSIC_MODULE(F, I) \
+ FOR_EACH_INTRINSIC_NUMBERS(F, I) \
+ FOR_EACH_INTRINSIC_OBJECT(F, I) \
+ FOR_EACH_INTRINSIC_OPERATORS(F, I) \
+ FOR_EACH_INTRINSIC_PROMISE(F, I) \
+ FOR_EACH_INTRINSIC_PROXY(F, I) \
+ FOR_EACH_INTRINSIC_REGEXP(F, I) \
+ FOR_EACH_INTRINSIC_SCOPES(F, I) \
+ FOR_EACH_INTRINSIC_STRINGS(F, I) \
+ FOR_EACH_INTRINSIC_SYMBOL(F, I) \
+ FOR_EACH_INTRINSIC_TEST(F, I) \
+ FOR_EACH_INTRINSIC_TYPEDARRAY(F, I) \
+ FOR_EACH_INTRINSIC_WASM(F, I)
+
+// Defines the list of all intrinsics, coming in 2 flavors, either returning an
+// object or a pair.
+#define FOR_EACH_INTRINSIC_IMPL(F, I) \
+ FOR_EACH_INTRINSIC_RETURN_PAIR_IMPL(F, I) \
+ FOR_EACH_INTRINSIC_RETURN_OBJECT_IMPL(F, I)
+
#define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \
- FOR_EACH_INTRINSIC_ARRAY(F) \
- FOR_EACH_INTRINSIC_ATOMICS(F) \
- FOR_EACH_INTRINSIC_BIGINT(F) \
- FOR_EACH_INTRINSIC_CLASSES(F) \
- FOR_EACH_INTRINSIC_COLLECTIONS(F) \
- FOR_EACH_INTRINSIC_COMPILER(F) \
- FOR_EACH_INTRINSIC_DATE(F) \
- FOR_EACH_INTRINSIC_DEBUG(F) \
- FOR_EACH_INTRINSIC_FORIN(F) \
- FOR_EACH_INTRINSIC_FUNCTION(F) \
- FOR_EACH_INTRINSIC_GENERATOR(F) \
- FOR_EACH_INTRINSIC_IC(F) \
- FOR_EACH_INTRINSIC_INTERNAL(F) \
- FOR_EACH_INTRINSIC_INTERPRETER(F) \
- FOR_EACH_INTRINSIC_INTL(F) \
- FOR_EACH_INTRINSIC_LITERALS(F) \
- FOR_EACH_INTRINSIC_MATHS(F) \
- FOR_EACH_INTRINSIC_MODULE(F) \
- FOR_EACH_INTRINSIC_NUMBERS(F) \
- FOR_EACH_INTRINSIC_OBJECT(F) \
- FOR_EACH_INTRINSIC_OPERATORS(F) \
- FOR_EACH_INTRINSIC_PROMISE(F) \
- FOR_EACH_INTRINSIC_PROXY(F) \
- FOR_EACH_INTRINSIC_REGEXP(F) \
- FOR_EACH_INTRINSIC_SCOPES(F) \
- FOR_EACH_INTRINSIC_STRINGS(F) \
- FOR_EACH_INTRINSIC_SYMBOL(F) \
- FOR_EACH_INTRINSIC_TEST(F) \
- FOR_EACH_INTRINSIC_TYPEDARRAY(F) \
- FOR_EACH_INTRINSIC_WASM(F)
-
-// FOR_EACH_INTRINSIC defines the list of all intrinsics, coming in 2 flavors,
-// either returning an object or a pair.
-#define FOR_EACH_INTRINSIC(F) \
- FOR_EACH_INTRINSIC_RETURN_PAIR(F) \
- FOR_EACH_INTRINSIC_RETURN_OBJECT(F)
+ FOR_EACH_INTRINSIC_RETURN_OBJECT_IMPL(F, F)
+
+#define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \
+ FOR_EACH_INTRINSIC_RETURN_PAIR_IMPL(F, F)
+
+// The list of all intrinsics, including those that have inline versions, but
+// not the inline versions themselves.
+#define FOR_EACH_INTRINSIC(F) FOR_EACH_INTRINSIC_IMPL(F, F)
+// The list of all inline intrinsics only.
+#define FOR_EACH_INLINE_INTRINSIC(I) FOR_EACH_INTRINSIC_IMPL(NOTHING, I)
#define F(name, nargs, ressize) \
Object* Runtime_##name(int args_length, Object** args_object, \
@@ -652,12 +628,17 @@ class Runtime : public AllStatic {
enum FunctionId : int32_t {
#define F(name, nargs, ressize) k##name,
#define I(name, nargs, ressize) kInline##name,
- FOR_EACH_INTRINSIC(F) FOR_EACH_INTRINSIC(I)
+ FOR_EACH_INTRINSIC(F) FOR_EACH_INLINE_INTRINSIC(I)
#undef I
#undef F
kNumFunctions,
};
+ static constexpr int kNumInlineFunctions =
+#define COUNT(...) +1
+ FOR_EACH_INLINE_INTRINSIC(COUNT);
+#undef COUNT
+
enum IntrinsicType { RUNTIME, INLINE };
// Intrinsic function descriptor.
@@ -680,6 +661,11 @@ class Runtime : public AllStatic {
static const int kNotFound = -1;
+ // Checks whether the runtime function with the given {id} depends on the
+ // "current context", i.e. because it does scoped lookups, or whether it's
+ // fine to just pass any context within the same "native context".
+ static bool NeedsExactContext(FunctionId id);
+
// Checks whether the runtime function with the given {id} never returns
// to it's caller normally, i.e. whether it'll always raise an exception.
// More specifically: The C++ implementation returns the Heap::exception
@@ -704,7 +690,8 @@ class Runtime : public AllStatic {
V8_WARN_UNUSED_RESULT static MaybeHandle<Object> SetObjectProperty(
Isolate* isolate, Handle<Object> object, Handle<Object> key,
- Handle<Object> value, LanguageMode language_mode);
+ Handle<Object> value, LanguageMode language_mode,
+ StoreOrigin store_origin);
V8_WARN_UNUSED_RESULT static MaybeHandle<Object> GetObjectProperty(
Isolate* isolate, Handle<Object> object, Handle<Object> key,
@@ -739,7 +726,7 @@ class RuntimeState {
}
private:
- RuntimeState() {}
+ RuntimeState() = default;
#ifndef V8_INTL_SUPPORT
unibrow::Mapping<unibrow::ToUppercase, 128> to_upper_mapping_;
unibrow::Mapping<unibrow::ToLowercase, 128> to_lower_mapping_;
@@ -781,6 +768,8 @@ enum class OptimizationStatus {
kTopmostFrameIsTurboFanned = 1 << 11,
};
+Smi* SmiLexicographicCompare(Smi* x_value, Smi* y_value);
+
} // namespace internal
} // namespace v8