5 #ifndef V8_RUNTIME_RUNTIME_H_ 6 #define V8_RUNTIME_RUNTIME_H_ 10 #include "src/allocation.h" 11 #include "src/base/platform/time.h" 12 #include "src/elements-kind.h" 13 #include "src/globals.h" 15 #include "src/zone/zone.h" 40 #define FOR_EACH_INTRINSIC_ARRAY(F, I) \ 41 F(ArrayIncludes_Slow, 3, 1) \ 42 F(ArrayIndexOf, 3, 1) \ 43 F(ArrayIsArray, 1, 1) \ 44 F(ArraySpeciesConstructor, 1, 1) \ 45 F(EstimateNumberOfElements, 1, 1) \ 46 F(GetArrayKeys, 2, 1) \ 47 F(GrowArrayElements, 2, 1) \ 48 F(HasComplexElements, 1, 1) \ 51 F(NormalizeElements, 1, 1) \ 52 F(PrepareElementsForSort, 2, 1) \ 53 F(TransitionElementsKind, 2, 1) \ 54 F(TransitionElementsKindWithKind, 2, 1) \ 55 F(TrySliceSimpleNonFastElements, 3, 1) 57 #define FOR_EACH_INTRINSIC_ATOMICS(F, I) \ 58 F(AtomicsLoad64, 2, 1) \ 59 F(AtomicsStore64, 3, 1) \ 62 F(AtomicsCompareExchange, 4, 1) \ 63 F(AtomicsExchange, 3, 1) \ 64 F(AtomicsNumWaitersForTesting, 2, 1) \ 68 F(SetAllowAtomicsWait, 1, 1) 70 #define FOR_EACH_INTRINSIC_BIGINT(F, I) \ 71 F(BigIntBinaryOp, 3, 1) \ 72 F(BigIntCompareToBigInt, 3, 1) \ 73 F(BigIntCompareToNumber, 3, 1) \ 74 F(BigIntCompareToString, 3, 1) \ 75 F(BigIntEqualToBigInt, 2, 1) \ 76 F(BigIntEqualToNumber, 2, 1) \ 77 F(BigIntEqualToString, 2, 1) \ 78 F(BigIntToBoolean, 1, 1) \ 79 F(BigIntToNumber, 1, 1) \ 80 F(BigIntUnaryOp, 2, 1) \ 83 #define FOR_EACH_INTRINSIC_CLASSES(F, I) \ 84 F(DefineClass, -1 , 1) \ 85 F(HomeObjectSymbol, 0, 1) \ 86 F(LoadFromSuper, 3, 1) \ 87 F(LoadKeyedFromSuper, 3, 1) \ 88 F(StoreKeyedToSuper_Sloppy, 4, 1) \ 89 F(StoreKeyedToSuper_Strict, 4, 1) \ 90 F(StoreToSuper_Sloppy, 4, 1) \ 91 F(StoreToSuper_Strict, 4, 1) \ 92 F(ThrowConstructorNonCallableError, 1, 1) \ 93 F(ThrowNotSuperConstructor, 2, 1) \ 94 F(ThrowStaticPrototypeError, 0, 1) \ 95 F(ThrowSuperAlreadyCalledError, 0, 1) \ 96 F(ThrowSuperNotCalled, 0, 1) \ 97 F(ThrowUnsupportedSuperError, 0, 1) 99 #define FOR_EACH_INTRINSIC_COLLECTIONS(F, I) \ 105 F(WeakCollectionDelete, 3, 1) \ 106 F(WeakCollectionSet, 4, 1) 108 #define FOR_EACH_INTRINSIC_COMPILER(F, I) \ 109 F(CompileForOnStackReplacement, 1, 1) \ 110 F(CompileLazy, 1, 1) \ 111 F(CompileOptimized_Concurrent, 1, 1) \ 112 F(CompileOptimized_NotConcurrent, 1, 1) \ 113 F(EvictOptimizedCodeSlot, 1, 1) \ 114 F(FunctionFirstExecution, 1, 1) \ 115 F(InstantiateAsmJs, 4, 1) \ 116 F(NotifyDeoptimized, 0, 1) \ 117 F(ResolvePossiblyDirectEval, 6, 1) 119 #define FOR_EACH_INTRINSIC_DATE(F, I) F(DateCurrentTime, 0, 1) 121 #define FOR_EACH_INTRINSIC_DEBUG(F, I) \ 122 F(ClearStepping, 0, 1) \ 123 F(CollectGarbage, 1, 1) \ 124 F(DebugBreakAtEntry, 1, 1) \ 125 F(DebugCollectCoverage, 0, 1) \ 126 F(DebugGetLoadedScriptIds, 0, 1) \ 127 F(DebugOnFunctionCall, 2, 1) \ 128 F(DebugPopPromise, 0, 1) \ 129 F(DebugPrepareStepInSuspendedGenerator, 0, 1) \ 130 F(DebugPushPromise, 1, 1) \ 131 F(DebugAsyncFunctionEntered, 1, 1) \ 132 F(DebugAsyncFunctionFinished, 2, 1) \ 133 F(DebugAsyncFunctionSuspended, 1, 1) \ 134 F(DebugToggleBlockCoverage, 1, 1) \ 135 F(DebugTogglePreciseCoverage, 1, 1) \ 136 F(FunctionGetInferredName, 1, 1) \ 137 F(GetBreakLocations, 1, 1) \ 138 F(GetGeneratorScopeCount, 1, 1) \ 139 F(GetGeneratorScopeDetails, 2, 1) \ 140 F(GetHeapUsage, 0, 1) \ 141 F(HandleDebuggerStatement, 0, 1) \ 142 F(IncBlockCounter, 2, 1) \ 143 F(IsBreakOnException, 1, 1) \ 144 F(ScheduleBreak, 0, 1) \ 145 F(ScriptLocationFromLine2, 4, 1) \ 146 F(SetGeneratorScopeVariableValue, 4, 1) \ 147 F(LiveEditPatchScript, 2, 1) 149 #define FOR_EACH_INTRINSIC_FORIN(F, I) \ 150 F(ForInEnumerate, 1, 1) \ 151 F(ForInHasProperty, 2, 1) 153 #ifdef V8_TRACE_IGNITION 154 #define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) \ 155 F(InterpreterTraceBytecodeEntry, 3, 1) \ 156 F(InterpreterTraceBytecodeExit, 3, 1) 158 #define FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) 161 #ifdef V8_TRACE_FEEDBACK_UPDATES 162 #define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) \ 163 F(InterpreterTraceUpdateFeedback, 3, 1) 165 #define FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) 168 #define FOR_EACH_INTRINSIC_INTERPRETER(F, I) \ 169 FOR_EACH_INTRINSIC_INTERPRETER_TRACE(F, I) \ 170 FOR_EACH_INTRINSIC_INTERPRETER_TRACE_FEEDBACK(F, I) 172 #define FOR_EACH_INTRINSIC_FUNCTION(F, I) \ 174 F(FunctionGetScriptSource, 1, 1) \ 175 F(FunctionGetScriptId, 1, 1) \ 176 F(FunctionGetScriptSourcePosition, 1, 1) \ 177 F(FunctionGetSourceCode, 1, 1) \ 178 F(FunctionIsAPIFunction, 1, 1) \ 179 F(IsFunction, 1, 1) \ 180 F(SetNativeFlag, 1, 1) 182 #define FOR_EACH_INTRINSIC_GENERATOR(F, I) \ 183 I(AsyncFunctionAwaitCaught, 2, 1) \ 184 I(AsyncFunctionAwaitUncaught, 2, 1) \ 185 I(AsyncFunctionEnter, 2, 1) \ 186 I(AsyncFunctionReject, 3, 1) \ 187 I(AsyncFunctionResolve, 3, 1) \ 188 I(AsyncGeneratorAwaitCaught, 2, 1) \ 189 I(AsyncGeneratorAwaitUncaught, 2, 1) \ 190 F(AsyncGeneratorHasCatchHandlerForPC, 1, 1) \ 191 I(AsyncGeneratorReject, 2, 1) \ 192 I(AsyncGeneratorResolve, 3, 1) \ 193 I(AsyncGeneratorYield, 3, 1) \ 194 I(CreateJSGeneratorObject, 2, 1) \ 195 I(GeneratorClose, 1, 1) \ 196 F(GeneratorGetFunction, 1, 1) \ 197 I(GeneratorGetResumeMode, 1, 1) 199 #ifdef V8_INTL_SUPPORT 200 #define FOR_EACH_INTRINSIC_INTL(F, I) \ 201 F(CanonicalizeLanguageTag, 1, 1) \ 202 F(FormatList, 2, 1) \ 203 F(FormatListToParts, 2, 1) \ 204 F(GetDefaultICULocale, 0, 1) \ 205 F(StringToLowerCaseIntl, 1, 1) \ 206 F(StringToUpperCaseIntl, 1, 1) // End of macro. 208 #define FOR_EACH_INTRINSIC_INTL(F, I) 209 #endif // V8_INTL_SUPPORT 211 #define FOR_EACH_INTRINSIC_INTERNAL(F, I) \ 212 F(AllocateInNewSpace, 1, 1) \ 213 F(AllocateInTargetSpace, 2, 1) \ 214 F(AllocateSeqOneByteString, 1, 1) \ 215 F(AllocateSeqTwoByteString, 1, 1) \ 216 F(AllowDynamicFunction, 1, 1) \ 217 F(CheckIsBootstrapping, 0, 1) \ 218 I(CreateAsyncFromSyncIterator, 1, 1) \ 219 F(CreateListFromArrayLike, 1, 1) \ 220 F(CreateTemplateObject, 1, 1) \ 221 F(ExportFromRuntime, 1, 1) \ 222 F(GetAndResetRuntimeCallStats, -1 , 1) \ 223 F(IncrementUseCounter, 1, 1) \ 224 F(InstallToContext, 1, 1) \ 226 F(NewReferenceError, 2, 1) \ 227 F(NewSyntaxError, 2, 1) \ 228 F(NewTypeError, 2, 1) \ 229 F(OrdinaryHasInstance, 2, 1) \ 230 F(PromoteScheduledException, 0, 1) \ 231 F(ReportMessage, 1, 1) \ 233 F(RunMicrotaskCallback, 2, 1) \ 234 F(RunMicrotasks, 0, 1) \ 235 F(StackGuard, 0, 1) \ 237 F(ThrowApplyNonFunction, 1, 1) \ 238 F(ThrowCalledNonCallable, 1, 1) \ 239 F(ThrowConstructedNonConstructable, 1, 1) \ 240 F(ThrowConstructorReturnedNonObject, 0, 1) \ 241 F(ThrowInvalidStringLength, 0, 1) \ 242 F(ThrowInvalidTypedArrayAlignment, 2, 1) \ 243 F(ThrowIteratorError, 1, 1) \ 244 F(ThrowIteratorResultNotAnObject, 1, 1) \ 245 F(ThrowNotConstructor, 1, 1) \ 246 F(ThrowRangeError, -1 , 1) \ 247 F(ThrowReferenceError, 1, 1) \ 248 F(ThrowStackOverflow, 0, 1) \ 249 F(ThrowSymbolAsyncIteratorInvalid, 0, 1) \ 250 F(ThrowSymbolIteratorInvalid, 0, 1) \ 251 F(ThrowThrowMethodMissing, 0, 1) \ 252 F(ThrowTypeError, -1 , 1) \ 254 F(UnwindAndFindExceptionHandler, 0, 1) \ 255 F(WeakFactoryCleanupJob, 1, 1) 257 #define FOR_EACH_INTRINSIC_LITERALS(F, I) \ 258 F(CreateArrayLiteral, 4, 1) \ 259 F(CreateArrayLiteralWithoutAllocationSite, 2, 1) \ 260 F(CreateObjectLiteral, 4, 1) \ 261 F(CreateObjectLiteralWithoutAllocationSite, 2, 1) \ 262 F(CreateRegExpLiteral, 4, 1) 264 #define FOR_EACH_INTRINSIC_MODULE(F, I) \ 265 F(DynamicImportCall, 2, 1) \ 266 I(GetImportMetaObject, 0, 1) \ 267 F(GetModuleNamespace, 1, 1) 269 #define FOR_EACH_INTRINSIC_NUMBERS(F, I) \ 270 F(GetHoleNaNLower, 0, 1) \ 271 F(GetHoleNaNUpper, 0, 1) \ 273 F(IsValidSmi, 1, 1) \ 275 F(NumberToString, 1, 1) \ 276 F(SmiLexicographicCompare, 2, 1) \ 277 F(StringParseFloat, 1, 1) \ 278 F(StringParseInt, 2, 1) \ 279 F(StringToNumber, 1, 1) 281 #define FOR_EACH_INTRINSIC_OBJECT(F, I) \ 282 F(AddDictionaryProperty, 3, 1) \ 283 F(AddElement, 3, 1) \ 284 F(AddNamedProperty, 4, 1) \ 285 F(AddPrivateField, 3, 1) \ 286 F(AllocateHeapNumber, 0, 1) \ 288 F(CollectTypeProfile, 3, 1) \ 289 F(CompleteInobjectSlackTrackingForMap, 1, 1) \ 290 F(CopyDataProperties, 2, 1) \ 291 F(CopyDataPropertiesWithExcludedProperties, -1 , 1) \ 292 I(CreateDataProperty, 3, 1) \ 293 I(CreateIterResultObject, 2, 1) \ 294 F(DefineAccessorPropertyUnchecked, 5, 1) \ 295 F(DefineDataPropertyInLiteral, 6, 1) \ 296 F(DefineGetterPropertyUnchecked, 4, 1) \ 297 F(DefineMethodsInternal, 3, 1) \ 298 F(DefineSetterPropertyUnchecked, 4, 1) \ 299 F(DeleteProperty, 3, 1) \ 300 F(GetFunctionName, 1, 1) \ 301 F(GetOwnPropertyDescriptor, 2, 1) \ 302 F(GetOwnPropertyKeys, 2, 1) \ 303 F(GetProperty, 2, 1) \ 304 F(HasFastPackedElements, 1, 1) \ 305 F(HasInPrototypeChain, 2, 1) \ 306 I(HasProperty, 2, 1) \ 307 F(InternalSetPrototype, 2, 1) \ 308 I(IsJSReceiver, 1, 1) \ 310 F(ObjectCreate, 2, 1) \ 311 F(ObjectEntries, 1, 1) \ 312 F(ObjectEntriesSkipFastPath, 1, 1) \ 313 F(ObjectHasOwnProperty, 2, 1) \ 314 F(ObjectKeys, 1, 1) \ 315 F(ObjectGetOwnPropertyNames, 1, 1) \ 316 F(ObjectGetOwnPropertyNamesTryFast, 1, 1) \ 317 F(ObjectValues, 1, 1) \ 318 F(ObjectValuesSkipFastPath, 1, 1) \ 319 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ 320 F(PerformSideEffectCheckForObject, 1, 1) \ 321 F(SetDataProperties, 2, 1) \ 322 F(SetKeyedProperty, 4, 1) \ 323 F(SetNamedProperty, 4, 1) \ 324 F(StoreDataPropertyInLiteral, 3, 1) \ 325 F(ShrinkPropertyDictionary, 1, 1) \ 326 F(ToFastProperties, 1, 1) \ 333 F(TryMigrateInstance, 1, 1) 335 #define FOR_EACH_INTRINSIC_OPERATORS(F, I) \ 338 F(GreaterThan, 2, 1) \ 339 F(GreaterThanOrEqual, 2, 1) \ 341 F(LessThanOrEqual, 2, 1) \ 343 F(StrictEqual, 2, 1) \ 344 F(StrictNotEqual, 2, 1) 346 #define FOR_EACH_INTRINSIC_PROMISE(F, I) \ 347 F(EnqueueMicrotask, 1, 1) \ 348 F(PromiseHookAfter, 1, 1) \ 349 F(PromiseHookBefore, 1, 1) \ 350 F(PromiseHookInit, 2, 1) \ 351 F(AwaitPromisesInit, 5, 1) \ 352 F(AwaitPromisesInitOld, 5, 1) \ 353 F(PromiseMarkAsHandled, 1, 1) \ 354 F(PromiseRejectEventFromStack, 2, 1) \ 355 F(PromiseRevokeReject, 1, 1) \ 356 F(PromiseStatus, 1, 1) \ 357 F(RejectPromise, 3, 1) \ 358 F(ResolvePromise, 2, 1) \ 359 F(PromiseRejectAfterResolved, 2, 1) \ 360 F(PromiseResolveAfterResolved, 2, 1) 362 #define FOR_EACH_INTRINSIC_PROXY(F, I) \ 363 F(CheckProxyGetSetTrapResult, 2, 1) \ 364 F(CheckProxyHasTrap, 2, 1) \ 365 F(GetPropertyWithReceiver, 3, 1) \ 367 F(JSProxyGetHandler, 1, 1) \ 368 F(JSProxyGetTarget, 1, 1) \ 369 F(SetPropertyWithReceiver, 5, 1) 371 #define FOR_EACH_INTRINSIC_REGEXP(F, I) \ 373 F(RegExpExec, 4, 1) \ 374 F(RegExpExecMultiple, 4, 1) \ 375 F(RegExpInitializeAndCompile, 3, 1) \ 376 F(RegExpInternalReplace, 3, 1) \ 377 F(RegExpReplace, 3, 1) \ 378 F(RegExpSplit, 3, 1) \ 379 F(StringReplaceNonGlobalRegExpWithFunction, 3, 1) \ 382 #define FOR_EACH_INTRINSIC_SCOPES(F, I) \ 383 F(DeclareEvalFunction, 2, 1) \ 384 F(DeclareEvalVar, 1, 1) \ 385 F(DeclareGlobals, 3, 1) \ 386 F(DeleteLookupSlot, 1, 1) \ 387 F(LoadLookupSlot, 1, 1) \ 388 F(LoadLookupSlotInsideTypeof, 1, 1) \ 389 F(NewArgumentsElements, 3, 1) \ 391 F(NewClosure, 2, 1) \ 392 F(NewClosure_Tenured, 2, 1) \ 393 F(NewFunctionContext, 1, 1) \ 394 F(NewRestParameter, 1, 1) \ 395 F(NewScriptContext, 1, 1) \ 396 F(NewSloppyArguments, 3, 1) \ 397 F(NewSloppyArguments_Generic, 1, 1) \ 398 F(NewStrictArguments, 1, 1) \ 399 F(PushBlockContext, 1, 1) \ 400 F(PushCatchContext, 2, 1) \ 401 F(PushModuleContext, 2, 1) \ 402 F(PushWithContext, 2, 1) \ 403 F(StoreLookupSlot_Sloppy, 2, 1) \ 404 F(StoreLookupSlot_SloppyHoisting, 2, 1) \ 405 F(StoreLookupSlot_Strict, 2, 1) \ 406 F(ThrowConstAssignError, 0, 1) 408 #define FOR_EACH_INTRINSIC_STRINGS(F, I) \ 409 F(FlattenString, 1, 1) \ 410 F(GetSubstitution, 5, 1) \ 411 F(InternalizeString, 1, 1) \ 412 F(SparseJoinWithSeparator, 3, 1) \ 414 F(StringBuilderConcat, 3, 1) \ 415 F(StringBuilderJoin, 3, 1) \ 416 F(StringCharCodeAt, 2, 1) \ 417 F(StringEqual, 2, 1) \ 418 F(StringGreaterThan, 2, 1) \ 419 F(StringGreaterThanOrEqual, 2, 1) \ 420 F(StringIncludes, 3, 1) \ 421 F(StringIndexOf, 3, 1) \ 422 F(StringIndexOfUnchecked, 3, 1) \ 423 F(StringLastIndexOf, 2, 1) \ 424 F(StringLessThan, 2, 1) \ 425 F(StringLessThanOrEqual, 2, 1) \ 426 F(StringMaxLength, 0, 1) \ 427 F(StringReplaceOneCharWithString, 3, 1) \ 428 F(StringSubstring, 3, 1) \ 429 F(StringToArray, 2, 1) \ 432 #define FOR_EACH_INTRINSIC_SYMBOL(F, I) \ 433 F(CreatePrivateNameSymbol, 0, 1) \ 434 F(CreatePrivateSymbol, -1 , 1) \ 435 F(SymbolDescriptiveString, 1, 1) \ 436 F(SymbolIsPrivate, 1, 1) 438 #define FOR_EACH_INTRINSIC_TEST(F, I) \ 441 F(ClearFunctionFeedback, 1, 1) \ 442 F(CompleteInobjectSlackTracking, 1, 1) \ 443 F(ConstructConsString, 2, 1) \ 444 F(ConstructSlicedString, 2, 1) \ 445 F(ConstructDouble, 2, 1) \ 446 F(DebugPrint, 1, 1) \ 447 F(DebugTrace, 0, 1) \ 448 F(DebugTrackRetainingPath, -1, 1) \ 449 F(DeoptimizeFunction, 1, 1) \ 450 I(DeoptimizeNow, 0, 1) \ 451 F(DeserializeWasmModule, 2, 1) \ 452 F(DisallowCodegenFromStrings, 1, 1) \ 453 F(DisallowWasmCodegen, 1, 1) \ 454 F(DisassembleFunction, 1, 1) \ 455 F(FreezeWasmLazyCompilation, 1, 1) \ 456 F(GetCallable, 0, 1) \ 457 F(GetDeoptCount, 1, 1) \ 458 F(GetInitializerFunction, 1, 1) \ 459 F(GetOptimizationStatus, -1, 1) \ 460 F(GetUndetectable, 0, 1) \ 461 F(GetWasmExceptionId, 2, 1) \ 462 F(GetWasmExceptionValues, 1, 1) \ 463 F(GetWasmRecoveredTrapCount, 0, 1) \ 464 F(GlobalPrint, 1, 1) \ 465 F(HasDictionaryElements, 1, 1) \ 466 F(HasDoubleElements, 1, 1) \ 467 F(HasFastElements, 1, 1) \ 468 F(HasFastProperties, 1, 1) \ 469 F(HasFixedBigInt64Elements, 1, 1) \ 470 F(HasFixedBigUint64Elements, 1, 1) \ 471 F(HasFixedFloat32Elements, 1, 1) \ 472 F(HasFixedFloat64Elements, 1, 1) \ 473 F(HasFixedInt16Elements, 1, 1) \ 474 F(HasFixedInt32Elements, 1, 1) \ 475 F(HasFixedInt8Elements, 1, 1) \ 476 F(HasFixedUint16Elements, 1, 1) \ 477 F(HasFixedUint32Elements, 1, 1) \ 478 F(HasFixedUint8ClampedElements, 1, 1) \ 479 F(HasFixedUint8Elements, 1, 1) \ 480 F(HasHoleyElements, 1, 1) \ 481 F(HasObjectElements, 1, 1) \ 482 F(HasSloppyArgumentsElements, 1, 1) \ 483 F(HasSmiElements, 1, 1) \ 484 F(HasSmiOrObjectElements, 1, 1) \ 485 F(HaveSameMap, 2, 1) \ 486 F(HeapObjectVerify, 1, 1) \ 487 F(ICsAreEnabled, 0, 1) \ 488 F(InNewSpace, 1, 1) \ 489 F(IsAsmWasmCode, 1, 1) \ 490 F(IsConcurrentRecompilationSupported, 0, 1) \ 491 F(WasmTierUpFunction, 2, 1) \ 492 F(IsLiftoffFunction, 1, 1) \ 493 F(IsWasmCode, 1, 1) \ 494 F(IsWasmTrapHandlerEnabled, 0, 1) \ 495 F(IsThreadInWasm, 0, 1) \ 496 F(NeverOptimizeFunction, 1, 1) \ 497 F(NotifyContextDisposed, 0, 1) \ 498 F(OptimizeFunctionOnNextCall, -1, 1) \ 499 F(OptimizeOsr, -1, 1) \ 500 F(PrintWithNameForAssert, 2, 1) \ 501 F(RedirectToWasmInterpreter, 2, 1) \ 502 F(RunningInSimulator, 0, 1) \ 503 F(SerializeWasmModule, 1, 1) \ 504 F(SetAllocationTimeout, -1 , 1) \ 505 F(SetForceSlowPath, 1, 1) \ 506 F(SetWasmCompileControls, 2, 1) \ 507 F(SetWasmInstantiateControls, 0, 1) \ 508 F(ArraySpeciesProtector, 0, 1) \ 509 F(MapIteratorProtector, 0, 1) \ 510 F(SetIteratorProtector, 0, 1) \ 511 F(StringIteratorProtector, 0, 1) \ 512 F(SystemBreak, 0, 1) \ 513 F(TraceEnter, 0, 1) \ 515 F(UnblockConcurrentRecompilation, 0, 1) \ 516 F(WasmGetNumberOfInstances, 1, 1) \ 517 F(WasmNumInterpretedCalls, 1, 1) \ 518 F(WasmTraceMemory, 1, 1) \ 519 F(WasmMemoryHasFullGuardRegion, 1, 1) \ 520 F(SetWasmThreadsEnabled, 1, 1) 522 #define FOR_EACH_INTRINSIC_TYPEDARRAY(F, I) \ 523 F(ArrayBufferNeuter, 1, 1) \ 524 F(ArrayBufferViewWasNeutered, 1, 1) \ 525 I(IsTypedArray, 1, 1) \ 526 F(TypedArrayCopyElements, 3, 1) \ 527 F(TypedArrayGetBuffer, 1, 1) \ 528 F(TypedArrayGetLength, 1, 1) \ 529 F(TypedArraySet, 2, 1) \ 530 F(TypedArraySortFast, 1, 1) 532 #define FOR_EACH_INTRINSIC_WASM(F, I) \ 533 F(ThrowWasmError, 1, 1) \ 534 F(ThrowWasmStackOverflow, 0, 1) \ 535 F(WasmI32AtomicWait, 4, 1) \ 536 F(WasmAtomicWake, 3, 1) \ 537 F(WasmExceptionGetValues, 1, 1) \ 538 F(WasmExceptionGetTag, 1, 1) \ 539 F(WasmMemoryGrow, 2, 1) \ 540 F(WasmRunInterpreter, 2, 1) \ 541 F(WasmStackGuard, 0, 1) \ 542 F(WasmThrowCreate, 2, 1) \ 543 F(WasmThrowTypeError, 0, 1) \ 544 F(WasmCompileLazy, 2, 1) 546 #define FOR_EACH_INTRINSIC_RETURN_PAIR_IMPL(F, I) \ 547 F(DebugBreakOnBytecode, 1, 2) \ 548 F(LoadLookupSlotForCall, 1, 2) 552 #define FOR_EACH_INTRINSIC_IC(F, I) \ 553 F(ElementsTransitionAndStoreIC_Miss, 6, 1) \ 554 F(KeyedLoadIC_Miss, 4, 1) \ 555 F(KeyedStoreIC_Miss, 5, 1) \ 556 F(KeyedStoreIC_Slow, 5, 1) \ 557 F(LoadAccessorProperty, 4, 1) \ 558 F(LoadCallbackProperty, 4, 1) \ 559 F(LoadElementWithInterceptor, 2, 1) \ 560 F(LoadGlobalIC_Miss, 3, 1) \ 561 F(LoadGlobalIC_Slow, 3, 1) \ 562 F(LoadIC_Miss, 4, 1) \ 563 F(LoadPropertyWithInterceptor, 5, 1) \ 564 F(StoreCallbackProperty, 6, 1) \ 565 F(StoreGlobalIC_Miss, 4, 1) \ 566 F(StoreGlobalIC_Slow, 5, 1) \ 567 F(StoreIC_Miss, 5, 1) \ 568 F(StoreInArrayLiteralIC_Slow, 5, 1) \ 569 F(StorePropertyWithInterceptor, 5, 1) \ 570 F(CloneObjectIC_Miss, 4, 1) 572 #define FOR_EACH_INTRINSIC_RETURN_OBJECT_IMPL(F, I) \ 573 FOR_EACH_INTRINSIC_ARRAY(F, I) \ 574 FOR_EACH_INTRINSIC_ATOMICS(F, I) \ 575 FOR_EACH_INTRINSIC_BIGINT(F, I) \ 576 FOR_EACH_INTRINSIC_CLASSES(F, I) \ 577 FOR_EACH_INTRINSIC_COLLECTIONS(F, I) \ 578 FOR_EACH_INTRINSIC_COMPILER(F, I) \ 579 FOR_EACH_INTRINSIC_DATE(F, I) \ 580 FOR_EACH_INTRINSIC_DEBUG(F, I) \ 581 FOR_EACH_INTRINSIC_FORIN(F, I) \ 582 FOR_EACH_INTRINSIC_FUNCTION(F, I) \ 583 FOR_EACH_INTRINSIC_GENERATOR(F, I) \ 584 FOR_EACH_INTRINSIC_IC(F, I) \ 585 FOR_EACH_INTRINSIC_INTERNAL(F, I) \ 586 FOR_EACH_INTRINSIC_INTERPRETER(F, I) \ 587 FOR_EACH_INTRINSIC_INTL(F, I) \ 588 FOR_EACH_INTRINSIC_LITERALS(F, I) \ 589 FOR_EACH_INTRINSIC_MODULE(F, I) \ 590 FOR_EACH_INTRINSIC_NUMBERS(F, I) \ 591 FOR_EACH_INTRINSIC_OBJECT(F, I) \ 592 FOR_EACH_INTRINSIC_OPERATORS(F, I) \ 593 FOR_EACH_INTRINSIC_PROMISE(F, I) \ 594 FOR_EACH_INTRINSIC_PROXY(F, I) \ 595 FOR_EACH_INTRINSIC_REGEXP(F, I) \ 596 FOR_EACH_INTRINSIC_SCOPES(F, I) \ 597 FOR_EACH_INTRINSIC_STRINGS(F, I) \ 598 FOR_EACH_INTRINSIC_SYMBOL(F, I) \ 599 FOR_EACH_INTRINSIC_TEST(F, I) \ 600 FOR_EACH_INTRINSIC_TYPEDARRAY(F, I) \ 601 FOR_EACH_INTRINSIC_WASM(F, I) 605 #define FOR_EACH_INTRINSIC_IMPL(F, I) \ 606 FOR_EACH_INTRINSIC_RETURN_PAIR_IMPL(F, I) \ 607 FOR_EACH_INTRINSIC_RETURN_OBJECT_IMPL(F, I) 609 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ 610 FOR_EACH_INTRINSIC_RETURN_OBJECT_IMPL(F, F) 612 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ 613 FOR_EACH_INTRINSIC_RETURN_PAIR_IMPL(F, F) 617 #define FOR_EACH_INTRINSIC(F) FOR_EACH_INTRINSIC_IMPL(F, F) 620 #define FOR_EACH_INLINE_INTRINSIC(I) FOR_EACH_INTRINSIC_IMPL(NOTHING, I) 622 #define F(name, nargs, ressize) \ 623 Object* Runtime_##name(int args_length, Address* args_object, \ 625 FOR_EACH_INTRINSIC_RETURN_OBJECT(F)
633 enum FunctionId : int32_t {
634 #define F(name, nargs, ressize) k##name, 635 #define I(name, nargs, ressize) kInline##name, 636 FOR_EACH_INTRINSIC(F) FOR_EACH_INLINE_INTRINSIC(I)
642 static constexpr
int kNumInlineFunctions =
643 #define COUNT(...) +1 644 FOR_EACH_INLINE_INTRINSIC(COUNT);
647 enum IntrinsicType { RUNTIME, INLINE };
651 FunctionId function_id;
652 IntrinsicType intrinsic_type;
667 static const int kNotFound = -1;
672 static bool NeedsExactContext(FunctionId
id);
678 static bool IsNonReturning(FunctionId
id);
681 static const Function* FunctionForName(
const unsigned char* name,
int length);
684 V8_EXPORT_PRIVATE
static const Function* FunctionForId(FunctionId
id);
692 V8_WARN_UNUSED_RESULT
static Maybe<bool> DeleteObjectProperty(
694 LanguageMode language_mode);
699 StoreOrigin store_origin);
703 bool* is_found_out =
nullptr);
715 #ifndef V8_INTL_SUPPORT 717 return &to_upper_mapping_;
720 return &to_lower_mapping_;
725 return redirected_intrinsic_functions_.get();
728 void set_redirected_intrinsic_functions(
730 redirected_intrinsic_functions_.reset(redirected_intrinsic_functions);
735 #ifndef V8_INTL_SUPPORT 740 std::unique_ptr<Runtime::Function[]> redirected_intrinsic_functions_;
748 V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, Runtime::FunctionId);
761 enum class OptimizationStatus {
762 kIsFunction = 1 << 0,
763 kNeverOptimize = 1 << 1,
764 kAlwaysOptimize = 1 << 2,
765 kMaybeDeopted = 1 << 3,
767 kTurboFanned = 1 << 5,
768 kInterpreted = 1 << 6,
769 kMarkedForOptimization = 1 << 7,
770 kMarkedForConcurrentOptimization = 1 << 8,
771 kOptimizingConcurrently = 1 << 9,
772 kIsExecuting = 1 << 10,
773 kTopmostFrameIsTurboFanned = 1 << 11,
780 #endif // V8_RUNTIME_RUNTIME_H_