OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_RUNTIME_RUNTIME_H_ | 5 #ifndef V8_RUNTIME_RUNTIME_H_ |
6 #define V8_RUNTIME_RUNTIME_H_ | 6 #define V8_RUNTIME_RUNTIME_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 #include "src/zone.h" | 10 #include "src/zone.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 // The interface to C++ runtime functions. | 15 // * Each intrinsic is consistently exposed in JavaScript via 2 names: |
16 | 16 // * %#name, which is always a runtime call. |
17 // ---------------------------------------------------------------------------- | 17 // * %_#name, which can be inlined or just a runtime call, the compiler in |
18 // WARNING: RUNTIME_FUNCTION_LIST_ALWAYS_* is a very large macro that caused | 18 // question decides. |
19 // MSVC Intellisense to crash. It was broken into two macros to work around | 19 // |
20 // this problem. Please avoid large recursive macros whenever possible. | 20 // * IntrinsicTypes are Runtime::RUNTIME and Runtime::INLINE, respectively. |
21 #define RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ | 21 // |
22 /* Property access */ \ | 22 // * IDs are Runtime::k##name and Runtime::kInline##name, respectively. |
23 F(GetProperty, 2, 1) \ | 23 // |
24 F(KeyedGetProperty, 2, 1) \ | 24 // * All intrinsics have a C++ implementation Runtime_##name. |
25 F(DeleteProperty, 3, 1) \ | 25 // |
26 F(HasOwnProperty, 2, 1) \ | 26 // * Each compiler has an explicit list of intrisics it supports, falling back |
27 F(HasProperty, 2, 1) \ | 27 // to a simple runtime call if necessary. |
28 F(HasElement, 2, 1) \ | 28 |
29 F(IsPropertyEnumerable, 2, 1) \ | 29 |
30 F(GetPropertyNames, 1, 1) \ | 30 // Entries have the form F(name, number of arguments, number of values): |
31 F(GetPropertyNamesFast, 1, 1) \ | 31 |
32 F(GetOwnPropertyNames, 2, 1) \ | 32 #define FOR_EACH_INTRINSIC_ARRAY(F) \ |
33 F(GetOwnElementNames, 1, 1) \ | 33 F(FinishArrayPrototypeSetup, 1, 1) \ |
34 F(GetInterceptorInfo, 1, 1) \ | 34 F(SpecialArrayFunctions, 0, 1) \ |
35 F(GetNamedInterceptorPropertyNames, 1, 1) \ | 35 F(TransitionElementsKind, 2, 1) \ |
36 F(GetIndexedInterceptorElementNames, 1, 1) \ | 36 F(PushIfAbsent, 2, 1) \ |
37 F(GetArgumentsProperty, 1, 1) \ | 37 F(ArrayConcat, 1, 1) \ |
38 F(ToFastProperties, 1, 1) \ | 38 F(RemoveArrayHoles, 2, 1) \ |
39 F(FinishArrayPrototypeSetup, 1, 1) \ | 39 F(MoveArrayContents, 2, 1) \ |
40 F(SpecialArrayFunctions, 0, 1) \ | 40 F(EstimateNumberOfElements, 1, 1) \ |
41 F(IsSloppyModeFunction, 1, 1) \ | 41 F(GetArrayKeys, 2, 1) \ |
42 F(GetDefaultReceiver, 1, 1) \ | 42 F(ArrayConstructor, -1, 1) \ |
43 \ | 43 F(ArrayConstructorWithSubclassing, -1, 1) \ |
44 F(SetPrototype, 2, 1) \ | 44 F(InternalArrayConstructor, -1, 1) \ |
45 F(InternalSetPrototype, 2, 1) \ | 45 F(NormalizeElements, 1, 1) \ |
46 F(IsInPrototypeChain, 2, 1) \ | 46 F(HasComplexElements, 1, 1) \ |
47 \ | 47 F(ForInCacheArrayLength, 2, 1) /* TODO(turbofan): Only temporary */ \ |
48 F(GetOwnProperty, 2, 1) \ | 48 F(IsArray, 1, 1) \ |
49 \ | 49 F(HasCachedArrayIndex, 1, 1) \ |
50 F(IsExtensible, 1, 1) \ | 50 F(GetCachedArrayIndex, 1, 1) \ |
51 F(PreventExtensions, 1, 1) \ | 51 F(FastOneByteArrayJoin, 2, 1) |
52 \ | 52 |
53 /* Utilities */ \ | 53 |
54 F(CheckIsBootstrapping, 0, 1) \ | 54 #define FOR_EACH_INTRINSIC_CLASSES(F) \ |
55 F(GetRootNaN, 0, 1) \ | 55 F(ThrowNonMethodError, 0, 1) \ |
56 F(Call, -1 /* >= 2 */, 1) \ | 56 F(ThrowUnsupportedSuperError, 0, 1) \ |
57 F(Apply, 5, 1) \ | 57 F(ThrowConstructorNonCallableError, 0, 1) \ |
58 F(GetFunctionDelegate, 1, 1) \ | 58 F(ThrowArrayNotSubclassableError, 0, 1) \ |
59 F(GetConstructorDelegate, 1, 1) \ | 59 F(ThrowStaticPrototypeError, 0, 1) \ |
60 F(DeoptimizeFunction, 1, 1) \ | 60 F(ThrowIfStaticPrototype, 1, 1) \ |
61 F(DeoptimizeNow, 0, 1) \ | 61 F(ToMethod, 2, 1) \ |
62 F(ClearFunctionTypeFeedback, 1, 1) \ | 62 F(HomeObjectSymbol, 0, 1) \ |
63 F(RunningInSimulator, 0, 1) \ | 63 F(DefineClass, 6, 1) \ |
64 F(IsConcurrentRecompilationSupported, 0, 1) \ | 64 F(DefineClassMethod, 3, 1) \ |
65 F(OptimizeFunctionOnNextCall, -1, 1) \ | 65 F(ClassGetSourceCode, 1, 1) \ |
66 F(OptimizeOsr, -1, 1) \ | 66 F(LoadFromSuper, 3, 1) \ |
67 F(NeverOptimizeFunction, 1, 1) \ | 67 F(LoadKeyedFromSuper, 3, 1) \ |
68 F(GetOptimizationStatus, -1, 1) \ | 68 F(StoreToSuper_Strict, 4, 1) \ |
69 F(GetOptimizationCount, 1, 1) \ | 69 F(StoreToSuper_Sloppy, 4, 1) \ |
70 F(UnblockConcurrentRecompilation, 0, 1) \ | 70 F(StoreKeyedToSuper_Strict, 4, 1) \ |
71 F(CompileForOnStackReplacement, 1, 1) \ | 71 F(StoreKeyedToSuper_Sloppy, 4, 1) \ |
72 F(SetAllocationTimeout, -1 /* 2 || 3 */, 1) \ | 72 F(HandleStepInForDerivedConstructors, 1, 1) \ |
73 F(SetNativeFlag, 1, 1) \ | 73 F(DefaultConstructorCallSuper, 0, 1) |
74 F(IsConstructor, 1, 1) \ | 74 |
75 F(SetInlineBuiltinFlag, 1, 1) \ | 75 |
76 F(StoreArrayLiteralElement, 5, 1) \ | 76 #define FOR_EACH_INTRINSIC_COLLECTIONS(F) \ |
| 77 F(StringGetRawHashField, 1, 1) \ |
| 78 F(TheHole, 0, 1) \ |
| 79 F(FixedArrayGet, 2, 1) \ |
| 80 F(FixedArraySet, 3, 1) \ |
| 81 F(JSCollectionGetTable, 1, 1) \ |
| 82 F(GenericHash, 1, 1) \ |
| 83 F(SetInitialize, 1, 1) \ |
| 84 F(SetGrow, 1, 1) \ |
| 85 F(SetShrink, 1, 1) \ |
| 86 F(SetClear, 1, 1) \ |
| 87 F(SetIteratorInitialize, 3, 1) \ |
| 88 F(SetIteratorClone, 1, 1) \ |
| 89 F(SetIteratorNext, 2, 1) \ |
| 90 F(SetIteratorDetails, 1, 1) \ |
| 91 F(MapInitialize, 1, 1) \ |
| 92 F(MapShrink, 1, 1) \ |
| 93 F(MapClear, 1, 1) \ |
| 94 F(MapGrow, 1, 1) \ |
| 95 F(MapIteratorInitialize, 3, 1) \ |
| 96 F(MapIteratorClone, 1, 1) \ |
| 97 F(MapIteratorDetails, 1, 1) \ |
| 98 F(GetWeakMapEntries, 2, 1) \ |
| 99 F(MapIteratorNext, 2, 1) \ |
| 100 F(WeakCollectionInitialize, 1, 1) \ |
| 101 F(WeakCollectionGet, 2, 1) \ |
| 102 F(WeakCollectionHas, 2, 1) \ |
| 103 F(WeakCollectionDelete, 2, 1) \ |
| 104 F(WeakCollectionSet, 3, 1) \ |
| 105 F(GetWeakSetValues, 2, 1) \ |
| 106 F(ObservationWeakMapCreate, 0, 1) |
| 107 |
| 108 |
| 109 #define FOR_EACH_INTRINSIC_COMPILER(F) \ |
| 110 F(CompileLazy, 1, 1) \ |
| 111 F(CompileOptimized, 2, 1) \ |
| 112 F(NotifyStubFailure, 0, 1) \ |
| 113 F(NotifyDeoptimized, 1, 1) \ |
| 114 F(CompileForOnStackReplacement, 1, 1) \ |
| 115 F(TryInstallOptimizedCode, 1, 1) \ |
| 116 F(CompileString, 2, 1) |
| 117 |
| 118 |
| 119 #define FOR_EACH_INTRINSIC_DATE(F) \ |
| 120 F(DateMakeDay, 2, 1) \ |
| 121 F(DateSetValue, 3, 1) \ |
| 122 F(ThrowNotDateError, 0, 1) \ |
| 123 F(DateCurrentTime, 0, 1) \ |
| 124 F(DateParseString, 2, 1) \ |
| 125 F(DateLocalTimezone, 1, 1) \ |
| 126 F(DateToUTC, 1, 1) \ |
| 127 F(DateCacheVersion, 0, 1) \ |
| 128 F(DateField, 2 /* date object, field index */, 1) |
| 129 |
| 130 |
| 131 #define FOR_EACH_INTRINSIC_DEBUG(F) \ |
| 132 F(DebugBreak, 0, 1) \ |
| 133 F(SetDebugEventListener, 2, 1) \ |
| 134 F(ScheduleBreak, 0, 1) \ |
| 135 F(DebugGetPropertyDetails, 2, 1) \ |
| 136 F(DebugGetProperty, 2, 1) \ |
| 137 F(DebugPropertyTypeFromDetails, 1, 1) \ |
| 138 F(DebugPropertyAttributesFromDetails, 1, 1) \ |
| 139 F(DebugPropertyIndexFromDetails, 1, 1) \ |
| 140 F(DebugNamedInterceptorPropertyValue, 2, 1) \ |
| 141 F(DebugIndexedInterceptorElementValue, 2, 1) \ |
| 142 F(CheckExecutionState, 1, 1) \ |
| 143 F(GetFrameCount, 1, 1) \ |
| 144 F(GetFrameDetails, 2, 1) \ |
| 145 F(GetScopeCount, 2, 1) \ |
| 146 F(GetStepInPositions, 2, 1) \ |
| 147 F(GetScopeDetails, 4, 1) \ |
| 148 F(GetAllScopesDetails, 4, 1) \ |
| 149 F(GetFunctionScopeCount, 1, 1) \ |
| 150 F(GetFunctionScopeDetails, 2, 1) \ |
| 151 F(SetScopeVariableValue, 6, 1) \ |
| 152 F(DebugPrintScopes, 0, 1) \ |
| 153 F(GetThreadCount, 1, 1) \ |
| 154 F(GetThreadDetails, 2, 1) \ |
| 155 F(SetDisableBreak, 1, 1) \ |
| 156 F(GetBreakLocations, 2, 1) \ |
| 157 F(SetFunctionBreakPoint, 3, 1) \ |
| 158 F(SetScriptBreakPoint, 4, 1) \ |
| 159 F(ClearBreakPoint, 1, 1) \ |
| 160 F(ChangeBreakOnException, 2, 1) \ |
| 161 F(IsBreakOnException, 1, 1) \ |
| 162 F(PrepareStep, 4, 1) \ |
| 163 F(ClearStepping, 0, 1) \ |
| 164 F(DebugEvaluate, 6, 1) \ |
| 165 F(DebugEvaluateGlobal, 4, 1) \ |
| 166 F(DebugGetLoadedScripts, 0, 1) \ |
| 167 F(DebugReferencedBy, 3, 1) \ |
| 168 F(DebugConstructedBy, 2, 1) \ |
| 169 F(DebugGetPrototype, 1, 1) \ |
| 170 F(DebugSetScriptSource, 2, 1) \ |
| 171 F(FunctionGetInferredName, 1, 1) \ |
| 172 F(FunctionGetDebugName, 1, 1) \ |
| 173 F(GetFunctionCodePositionFromSource, 2, 1) \ |
| 174 F(ExecuteInDebugContext, 1, 1) \ |
| 175 F(GetDebugContext, 0, 1) \ |
| 176 F(CollectGarbage, 1, 1) \ |
| 177 F(GetHeapUsage, 0, 1) \ |
| 178 F(GetScript, 1, 1) \ |
| 179 F(DebugCallbackSupportsStepping, 1, 1) \ |
77 F(DebugPrepareStepInIfStepping, 1, 1) \ | 180 F(DebugPrepareStepInIfStepping, 1, 1) \ |
78 F(DebugPushPromise, 2, 1) \ | 181 F(DebugPushPromise, 2, 1) \ |
79 F(DebugPopPromise, 0, 1) \ | 182 F(DebugPopPromise, 0, 1) \ |
80 F(DebugPromiseEvent, 1, 1) \ | 183 F(DebugPromiseEvent, 1, 1) \ |
81 F(DebugAsyncTaskEvent, 1, 1) \ | 184 F(DebugAsyncTaskEvent, 1, 1) \ |
82 F(PromiseRejectEvent, 3, 1) \ | 185 F(DebugIsActive, 0, 1) \ |
83 F(PromiseRevokeReject, 1, 1) \ | 186 F(DebugBreakInOptimizedCode, 0, 1) |
84 F(PromiseHasHandlerSymbol, 0, 1) \ | 187 |
85 F(FlattenString, 1, 1) \ | 188 |
86 F(LoadMutableDouble, 2, 1) \ | 189 #define FOR_EACH_INTRINSIC_FUNCTION(F) \ |
87 F(TryMigrateInstance, 1, 1) \ | 190 F(IsSloppyModeFunction, 1, 1) \ |
88 F(NotifyContextDisposed, 0, 1) \ | 191 F(GetDefaultReceiver, 1, 1) \ |
89 F(ThrowIteratorResultNotAnObject, 1, 1) \ | 192 F(FunctionGetName, 1, 1) \ |
90 F(IncrementStatsCounter, 1, 1) \ | 193 F(FunctionSetName, 2, 1) \ |
91 F(Likely, 1, 1) \ | 194 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ |
92 F(Unlikely, 1, 1) \ | 195 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ |
93 \ | 196 F(FunctionIsArrow, 1, 1) \ |
94 /* Array join support */ \ | 197 F(FunctionIsConciseMethod, 1, 1) \ |
95 F(PushIfAbsent, 2, 1) \ | 198 F(FunctionRemovePrototype, 1, 1) \ |
96 F(ArrayConcat, 1, 1) \ | 199 F(FunctionGetScript, 1, 1) \ |
97 \ | 200 F(FunctionGetSourceCode, 1, 1) \ |
98 /* Conversions */ \ | 201 F(FunctionGetScriptSourcePosition, 1, 1) \ |
99 F(ToBool, 1, 1) \ | 202 F(FunctionGetPositionForOffset, 2, 1) \ |
100 F(Typeof, 1, 1) \ | 203 F(FunctionSetInstanceClassName, 2, 1) \ |
101 \ | 204 F(FunctionSetLength, 2, 1) \ |
102 F(StringToNumber, 1, 1) \ | 205 F(FunctionSetPrototype, 2, 1) \ |
103 F(StringParseInt, 2, 1) \ | 206 F(FunctionIsAPIFunction, 1, 1) \ |
104 F(StringParseFloat, 1, 1) \ | 207 F(FunctionIsBuiltin, 1, 1) \ |
105 F(StringToLowerCase, 1, 1) \ | 208 F(SetCode, 2, 1) \ |
106 F(StringToUpperCase, 1, 1) \ | 209 F(SetNativeFlag, 1, 1) \ |
| 210 F(IsConstructor, 1, 1) \ |
| 211 F(SetInlineBuiltinFlag, 1, 1) \ |
| 212 F(FunctionBindArguments, 4, 1) \ |
| 213 F(BoundFunctionGetBindings, 1, 1) \ |
| 214 F(NewObjectFromBound, 1, 1) \ |
| 215 F(Call, -1 /* >= 2 */, 1) \ |
| 216 F(Apply, 5, 1) \ |
| 217 F(GetFunctionDelegate, 1, 1) \ |
| 218 F(GetConstructorDelegate, 1, 1) \ |
| 219 F(CallFunction, -1 /* receiver + n args + function */, 1) \ |
| 220 F(IsConstructCall, 0, 1) \ |
| 221 F(IsFunction, 1, 1) |
| 222 |
| 223 |
| 224 #define FOR_EACH_INTRINSIC_GENERATOR(F) \ |
| 225 F(CreateJSGeneratorObject, 0, 1) \ |
| 226 F(SuspendJSGeneratorObject, -1, 1) \ |
| 227 F(ResumeJSGeneratorObject, 3, 1) \ |
| 228 F(GeneratorClose, 1, 1) \ |
| 229 F(GeneratorGetFunction, 1, 1) \ |
| 230 F(GeneratorGetContext, 1, 1) \ |
| 231 F(GeneratorGetReceiver, 1, 1) \ |
| 232 F(GeneratorGetContinuation, 1, 1) \ |
| 233 F(GeneratorGetSourcePosition, 1, 1) \ |
| 234 F(FunctionIsGenerator, 1, 1) \ |
| 235 F(GeneratorNext, 2, 1) \ |
| 236 F(GeneratorThrow, 2, 1) |
| 237 |
| 238 |
| 239 #ifdef V8_I18N_SUPPORT |
| 240 #define FOR_EACH_INTRINSIC_I18N(F) \ |
| 241 F(CanonicalizeLanguageTag, 1, 1) \ |
| 242 F(AvailableLocalesOf, 1, 1) \ |
| 243 F(GetDefaultICULocale, 0, 1) \ |
| 244 F(GetLanguageTagVariants, 1, 1) \ |
| 245 F(IsInitializedIntlObject, 1, 1) \ |
| 246 F(IsInitializedIntlObjectOfType, 2, 1) \ |
| 247 F(MarkAsInitializedIntlObjectOfType, 3, 1) \ |
| 248 F(GetImplFromInitializedIntlObject, 1, 1) \ |
| 249 F(CreateDateTimeFormat, 3, 1) \ |
| 250 F(InternalDateFormat, 2, 1) \ |
| 251 F(InternalDateParse, 2, 1) \ |
| 252 F(CreateNumberFormat, 3, 1) \ |
| 253 F(InternalNumberFormat, 2, 1) \ |
| 254 F(InternalNumberParse, 2, 1) \ |
| 255 F(CreateCollator, 3, 1) \ |
| 256 F(InternalCompare, 3, 1) \ |
| 257 F(StringNormalize, 2, 1) \ |
| 258 F(CreateBreakIterator, 3, 1) \ |
| 259 F(BreakIteratorAdoptText, 2, 1) \ |
| 260 F(BreakIteratorFirst, 1, 1) \ |
| 261 F(BreakIteratorNext, 1, 1) \ |
| 262 F(BreakIteratorCurrent, 1, 1) \ |
| 263 F(BreakIteratorBreakType, 1, 1) |
| 264 #else |
| 265 #define FOR_EACH_INTRINSIC_I18N(F) |
| 266 #endif |
| 267 |
| 268 |
| 269 #define FOR_EACH_INTRINSIC_INTERNAL(F) \ |
| 270 F(CheckIsBootstrapping, 0, 1) \ |
| 271 F(Throw, 1, 1) \ |
| 272 F(ReThrow, 1, 1) \ |
| 273 F(FindExceptionHandler, 0, 1) \ |
| 274 F(PromoteScheduledException, 0, 1) \ |
| 275 F(ThrowReferenceError, 1, 1) \ |
| 276 F(ThrowIteratorResultNotAnObject, 1, 1) \ |
| 277 F(PromiseRejectEvent, 3, 1) \ |
| 278 F(PromiseRevokeReject, 1, 1) \ |
| 279 F(PromiseHasHandlerSymbol, 0, 1) \ |
| 280 F(StackGuard, 0, 1) \ |
| 281 F(Interrupt, 0, 1) \ |
| 282 F(AllocateInNewSpace, 1, 1) \ |
| 283 F(AllocateInTargetSpace, 2, 1) \ |
| 284 F(CollectStackTrace, 2, 1) \ |
| 285 F(RenderCallSite, 0, 1) \ |
| 286 F(GetFromCacheRT, 2, 1) \ |
| 287 F(MessageGetStartPosition, 1, 1) \ |
| 288 F(MessageGetScript, 1, 1) \ |
| 289 F(IS_VAR, 1, 1) \ |
| 290 F(GetFromCache, 2, 1) \ |
| 291 F(IncrementStatsCounter, 1, 1) \ |
| 292 F(Likely, 1, 1) \ |
| 293 F(Unlikely, 1, 1) |
| 294 |
| 295 |
| 296 #define FOR_EACH_INTRINSIC_JSON(F) \ |
| 297 F(QuoteJSONString, 1, 1) \ |
| 298 F(BasicJSONStringify, 1, 1) \ |
| 299 F(ParseJson, 1, 1) |
| 300 |
| 301 |
| 302 #define FOR_EACH_INTRINSIC_LITERALS(F) \ |
| 303 F(CreateObjectLiteral, 4, 1) \ |
| 304 F(CreateArrayLiteral, 4, 1) \ |
| 305 F(CreateArrayLiteralStubBailout, 3, 1) \ |
| 306 F(StoreArrayLiteralElement, 5, 1) |
| 307 |
| 308 |
| 309 #define FOR_EACH_INTRINSIC_LIVEEDIT(F) \ |
| 310 F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \ |
| 311 F(LiveEditGatherCompileInfo, 2, 1) \ |
| 312 F(LiveEditReplaceScript, 3, 1) \ |
| 313 F(LiveEditFunctionSourceUpdated, 1, 1) \ |
| 314 F(LiveEditReplaceFunctionCode, 2, 1) \ |
| 315 F(LiveEditFunctionSetScript, 2, 1) \ |
| 316 F(LiveEditReplaceRefToNestedFunction, 3, 1) \ |
| 317 F(LiveEditPatchFunctionPositions, 2, 1) \ |
| 318 F(LiveEditCheckAndDropActivations, 2, 1) \ |
| 319 F(LiveEditCompareStrings, 2, 1) \ |
| 320 F(LiveEditRestartFrame, 2, 1) |
| 321 |
| 322 |
| 323 #define FOR_EACH_INTRINSIC_MATHS(F) \ |
| 324 F(MathAcos, 1, 1) \ |
| 325 F(MathAsin, 1, 1) \ |
| 326 F(MathAtan, 1, 1) \ |
| 327 F(MathLogRT, 1, 1) \ |
| 328 F(DoubleHi, 1, 1) \ |
| 329 F(DoubleLo, 1, 1) \ |
| 330 F(ConstructDouble, 2, 1) \ |
| 331 F(RemPiO2, 2, 1) \ |
| 332 F(MathAtan2, 2, 1) \ |
| 333 F(MathExpRT, 1, 1) \ |
| 334 F(MathClz32, 1, 1) \ |
| 335 F(MathFloor, 1, 1) \ |
| 336 F(MathPowSlow, 2, 1) \ |
| 337 F(MathPowRT, 2, 1) \ |
| 338 F(RoundNumber, 1, 1) \ |
| 339 F(MathSqrt, 1, 1) \ |
| 340 F(MathFround, 1, 1) \ |
| 341 F(MathPow, 2, 1) \ |
| 342 F(IsMinusZero, 1, 1) |
| 343 |
| 344 |
| 345 #define FOR_EACH_INTRINSIC_NUMBERS(F) \ |
| 346 F(NumberToRadixString, 2, 1) \ |
| 347 F(NumberToFixed, 2, 1) \ |
| 348 F(NumberToExponential, 2, 1) \ |
| 349 F(NumberToPrecision, 2, 1) \ |
| 350 F(IsValidSmi, 1, 1) \ |
| 351 F(StringToNumber, 1, 1) \ |
| 352 F(StringParseInt, 2, 1) \ |
| 353 F(StringParseFloat, 1, 1) \ |
| 354 F(NumberToStringRT, 1, 1) \ |
| 355 F(NumberToStringSkipCache, 1, 1) \ |
| 356 F(NumberToInteger, 1, 1) \ |
| 357 F(NumberToIntegerMapMinusZero, 1, 1) \ |
| 358 F(NumberToJSUint32, 1, 1) \ |
| 359 F(NumberToJSInt32, 1, 1) \ |
| 360 F(NumberToSmi, 1, 1) \ |
| 361 F(NumberAdd, 2, 1) \ |
| 362 F(NumberSub, 2, 1) \ |
| 363 F(NumberMul, 2, 1) \ |
| 364 F(NumberUnaryMinus, 1, 1) \ |
| 365 F(NumberDiv, 2, 1) \ |
| 366 F(NumberMod, 2, 1) \ |
| 367 F(NumberImul, 2, 1) \ |
| 368 F(NumberOr, 2, 1) \ |
| 369 F(NumberAnd, 2, 1) \ |
| 370 F(NumberXor, 2, 1) \ |
| 371 F(NumberShl, 2, 1) \ |
| 372 F(NumberShr, 2, 1) \ |
| 373 F(NumberSar, 2, 1) \ |
| 374 F(NumberEquals, 2, 1) \ |
| 375 F(NumberCompare, 3, 1) \ |
| 376 F(SmiLexicographicCompare, 2, 1) \ |
| 377 F(GetRootNaN, 0, 1) \ |
| 378 F(MaxSmi, 0, 1) \ |
| 379 F(NumberToString, 1, 1) \ |
| 380 F(IsSmi, 1, 1) \ |
| 381 F(IsNonNegativeSmi, 1, 1) |
| 382 |
| 383 |
| 384 #define FOR_EACH_INTRINSIC_OBJECT(F) \ |
| 385 F(GetPrototype, 1, 1) \ |
| 386 F(InternalSetPrototype, 2, 1) \ |
| 387 F(SetPrototype, 2, 1) \ |
| 388 F(IsInPrototypeChain, 2, 1) \ |
| 389 F(GetOwnProperty, 2, 1) \ |
| 390 F(PreventExtensions, 1, 1) \ |
| 391 F(IsExtensible, 1, 1) \ |
| 392 F(DisableAccessChecks, 1, 1) \ |
| 393 F(EnableAccessChecks, 1, 1) \ |
| 394 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ |
| 395 F(ObjectFreeze, 1, 1) \ |
| 396 F(ObjectSeal, 1, 1) \ |
| 397 F(GetProperty, 2, 1) \ |
| 398 F(KeyedGetProperty, 2, 1) \ |
| 399 F(AddNamedProperty, 4, 1) \ |
| 400 F(SetProperty, 4, 1) \ |
| 401 F(AddElement, 4, 1) \ |
| 402 F(DeleteProperty, 3, 1) \ |
| 403 F(HasOwnProperty, 2, 1) \ |
| 404 F(HasProperty, 2, 1) \ |
| 405 F(HasElement, 2, 1) \ |
| 406 F(IsPropertyEnumerable, 2, 1) \ |
| 407 F(GetPropertyNames, 1, 1) \ |
| 408 F(GetPropertyNamesFast, 1, 1) \ |
| 409 F(GetOwnPropertyNames, 2, 1) \ |
| 410 F(GetOwnElementNames, 1, 1) \ |
| 411 F(GetInterceptorInfo, 1, 1) \ |
| 412 F(GetNamedInterceptorPropertyNames, 1, 1) \ |
| 413 F(GetIndexedInterceptorElementNames, 1, 1) \ |
| 414 F(OwnKeys, 1, 1) \ |
| 415 F(ToFastProperties, 1, 1) \ |
| 416 F(ToBool, 1, 1) \ |
| 417 F(Typeof, 1, 1) \ |
| 418 F(NewStringWrapper, 1, 1) \ |
| 419 F(AllocateHeapNumber, 0, 1) \ |
| 420 F(NewObject, 2, 1) \ |
| 421 F(NewObjectWithAllocationSite, 3, 1) \ |
| 422 F(FinalizeInstanceSize, 1, 1) \ |
| 423 F(GlobalProxy, 1, 1) \ |
| 424 F(LookupAccessor, 3, 1) \ |
| 425 F(LoadMutableDouble, 2, 1) \ |
| 426 F(TryMigrateInstance, 1, 1) \ |
| 427 F(IsJSGlobalProxy, 1, 1) \ |
| 428 F(DefineAccessorPropertyUnchecked, 5, 1) \ |
| 429 F(DefineDataPropertyUnchecked, 4, 1) \ |
| 430 F(GetDataProperty, 2, 1) \ |
| 431 F(HasFastPackedElements, 1, 1) \ |
| 432 F(ValueOf, 1, 1) \ |
| 433 F(SetValueOf, 2, 1) \ |
| 434 F(JSValueGetValue, 1, 1) \ |
| 435 F(HeapObjectGetMap, 1, 1) \ |
| 436 F(MapGetInstanceType, 1, 1) \ |
| 437 F(ObjectEquals, 2, 1) \ |
| 438 F(IsObject, 1, 1) \ |
| 439 F(IsUndetectableObject, 1, 1) \ |
| 440 F(IsSpecObject, 1, 1) \ |
| 441 F(ClassOf, 1, 1) \ |
| 442 F(DefineGetterPropertyUnchecked, 4, 1) \ |
| 443 F(DefineSetterPropertyUnchecked, 4, 1) |
| 444 |
| 445 |
| 446 #define FOR_EACH_INTRINSIC_OBSERVE(F) \ |
| 447 F(IsObserved, 1, 1) \ |
| 448 F(SetIsObserved, 1, 1) \ |
| 449 F(EnqueueMicrotask, 1, 1) \ |
| 450 F(RunMicrotasks, 0, 1) \ |
| 451 F(DeliverObservationChangeRecords, 2, 1) \ |
| 452 F(GetObservationState, 0, 1) \ |
| 453 F(ObserverObjectAndRecordHaveSameOrigin, 3, 1) \ |
| 454 F(ObjectWasCreatedInCurrentOrigin, 1, 1) \ |
| 455 F(GetObjectContextObjectObserve, 1, 1) \ |
| 456 F(GetObjectContextObjectGetNotifier, 1, 1) \ |
| 457 F(GetObjectContextNotifierPerformChange, 1, 1) |
| 458 |
| 459 |
| 460 #define FOR_EACH_INTRINSIC_PROXY(F) \ |
| 461 F(CreateJSProxy, 2, 1) \ |
| 462 F(CreateJSFunctionProxy, 4, 1) \ |
| 463 F(IsJSProxy, 1, 1) \ |
| 464 F(IsJSFunctionProxy, 1, 1) \ |
| 465 F(GetHandler, 1, 1) \ |
| 466 F(GetCallTrap, 1, 1) \ |
| 467 F(GetConstructTrap, 1, 1) \ |
| 468 F(Fix, 1, 1) |
| 469 |
| 470 |
| 471 #define FOR_EACH_INTRINSIC_REGEXP(F) \ |
| 472 F(StringReplaceGlobalRegExpWithString, 4, 1) \ |
107 F(StringSplit, 3, 1) \ | 473 F(StringSplit, 3, 1) \ |
108 F(CharFromCode, 1, 1) \ | 474 F(RegExpExec, 4, 1) \ |
109 F(URIEscape, 1, 1) \ | 475 F(RegExpConstructResultRT, 3, 1) \ |
110 F(URIUnescape, 1, 1) \ | 476 F(RegExpConstructResult, 3, 1) \ |
111 \ | |
112 F(NumberToInteger, 1, 1) \ | |
113 F(NumberToIntegerMapMinusZero, 1, 1) \ | |
114 F(NumberToJSUint32, 1, 1) \ | |
115 F(NumberToJSInt32, 1, 1) \ | |
116 \ | |
117 /* Arithmetic operations */ \ | |
118 F(NumberAdd, 2, 1) \ | |
119 F(NumberSub, 2, 1) \ | |
120 F(NumberMul, 2, 1) \ | |
121 F(NumberDiv, 2, 1) \ | |
122 F(NumberMod, 2, 1) \ | |
123 F(NumberUnaryMinus, 1, 1) \ | |
124 F(NumberImul, 2, 1) \ | |
125 \ | |
126 F(StringBuilderConcat, 3, 1) \ | |
127 F(StringBuilderJoin, 3, 1) \ | |
128 F(SparseJoinWithSeparator, 3, 1) \ | |
129 \ | |
130 /* Bit operations */ \ | |
131 F(NumberOr, 2, 1) \ | |
132 F(NumberAnd, 2, 1) \ | |
133 F(NumberXor, 2, 1) \ | |
134 \ | |
135 F(NumberShl, 2, 1) \ | |
136 F(NumberShr, 2, 1) \ | |
137 F(NumberSar, 2, 1) \ | |
138 \ | |
139 /* Comparisons */ \ | |
140 F(NumberEquals, 2, 1) \ | |
141 F(StringEquals, 2, 1) \ | |
142 \ | |
143 F(NumberCompare, 3, 1) \ | |
144 F(SmiLexicographicCompare, 2, 1) \ | |
145 \ | |
146 /* Math */ \ | |
147 F(MathAcos, 1, 1) \ | |
148 F(MathAsin, 1, 1) \ | |
149 F(MathAtan, 1, 1) \ | |
150 F(MathAtan2, 2, 1) \ | |
151 F(MathExpRT, 1, 1) \ | |
152 F(RoundNumber, 1, 1) \ | |
153 F(MathFround, 1, 1) \ | |
154 F(RemPiO2, 2, 1) \ | |
155 \ | |
156 /* Regular expressions */ \ | |
157 F(RegExpInitializeAndCompile, 3, 1) \ | 477 F(RegExpInitializeAndCompile, 3, 1) \ |
| 478 F(MaterializeRegExpLiteral, 4, 1) \ |
158 F(RegExpExecMultiple, 4, 1) \ | 479 F(RegExpExecMultiple, 4, 1) \ |
159 F(RegExpExecReThrow, 4, 1) \ | 480 F(RegExpExecReThrow, 4, 1) \ |
160 \ | 481 F(IsRegExp, 1, 1) |
161 /* JSON */ \ | 482 |
162 F(ParseJson, 1, 1) \ | 483 |
163 F(BasicJSONStringify, 1, 1) \ | 484 #define FOR_EACH_INTRINSIC_SCOPES(F) \ |
164 F(QuoteJSONString, 1, 1) \ | 485 F(ThrowConstAssignError, 0, 1) \ |
165 \ | 486 F(DeclareGlobals, 3, 1) \ |
166 /* Strings */ \ | 487 F(InitializeVarGlobal, 3, 1) \ |
167 F(StringIndexOf, 3, 1) \ | 488 F(InitializeConstGlobal, 2, 1) \ |
168 F(StringLastIndexOf, 3, 1) \ | 489 F(DeclareLookupSlot, 4, 1) \ |
169 F(StringLocaleCompare, 2, 1) \ | 490 F(InitializeLegacyConstLookupSlot, 3, 1) \ |
170 F(StringReplaceGlobalRegExpWithString, 4, 1) \ | |
171 F(StringReplaceOneCharWithString, 3, 1) \ | |
172 F(StringMatch, 3, 1) \ | |
173 F(StringTrim, 3, 1) \ | |
174 F(StringToArray, 2, 1) \ | |
175 F(NewStringWrapper, 1, 1) \ | |
176 F(NewString, 2, 1) \ | |
177 F(NewConsString, 4, 1) \ | |
178 F(TruncateString, 2, 1) \ | |
179 \ | |
180 /* Numbers */ \ | |
181 F(NumberToRadixString, 2, 1) \ | |
182 F(NumberToFixed, 2, 1) \ | |
183 F(NumberToExponential, 2, 1) \ | |
184 F(NumberToPrecision, 2, 1) \ | |
185 F(IsValidSmi, 1, 1) \ | |
186 \ | |
187 /* Classes support */ \ | |
188 F(ClassGetSourceCode, 1, 1) \ | |
189 F(DefineClass, 6, 1) \ | |
190 F(DefineClassMethod, 3, 1) \ | |
191 F(HandleStepInForDerivedConstructors, 1, 1) \ | |
192 F(HomeObjectSymbol, 0, 1) \ | |
193 F(LoadFromSuper, 3, 1) \ | |
194 F(LoadKeyedFromSuper, 3, 1) \ | |
195 F(StoreKeyedToSuper_Sloppy, 4, 1) \ | |
196 F(StoreKeyedToSuper_Strict, 4, 1) \ | |
197 F(StoreToSuper_Sloppy, 4, 1) \ | |
198 F(StoreToSuper_Strict, 4, 1) \ | |
199 F(ThrowArrayNotSubclassableError, 0, 1) \ | |
200 F(ThrowConstructorNonCallableError, 0, 1) \ | |
201 F(ThrowIfStaticPrototype, 1, 1) \ | |
202 F(ThrowNonMethodError, 0, 1) \ | |
203 F(ThrowStaticPrototypeError, 0, 1) \ | |
204 F(ThrowUnsupportedSuperError, 0, 1) \ | |
205 F(ToMethod, 2, 1) | |
206 | |
207 | |
208 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ | |
209 /* Reflection */ \ | |
210 F(FunctionSetInstanceClassName, 2, 1) \ | |
211 F(FunctionSetLength, 2, 1) \ | |
212 F(FunctionSetPrototype, 2, 1) \ | |
213 F(FunctionGetName, 1, 1) \ | |
214 F(FunctionSetName, 2, 1) \ | |
215 F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ | |
216 F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ | |
217 F(FunctionIsGenerator, 1, 1) \ | |
218 F(FunctionIsArrow, 1, 1) \ | |
219 F(FunctionIsConciseMethod, 1, 1) \ | |
220 F(FunctionBindArguments, 4, 1) \ | |
221 F(BoundFunctionGetBindings, 1, 1) \ | |
222 F(FunctionRemovePrototype, 1, 1) \ | |
223 F(FunctionGetSourceCode, 1, 1) \ | |
224 F(FunctionGetScript, 1, 1) \ | |
225 F(FunctionGetScriptSourcePosition, 1, 1) \ | |
226 F(FunctionGetPositionForOffset, 2, 1) \ | |
227 F(FunctionIsAPIFunction, 1, 1) \ | |
228 F(FunctionIsBuiltin, 1, 1) \ | |
229 F(GetScript, 1, 1) \ | |
230 F(CollectStackTrace, 2, 1) \ | |
231 F(GetV8Version, 0, 1) \ | |
232 F(GeneratorGetFunction, 1, 1) \ | |
233 F(GeneratorGetContext, 1, 1) \ | |
234 F(GeneratorGetReceiver, 1, 1) \ | |
235 F(GeneratorGetContinuation, 1, 1) \ | |
236 F(GeneratorGetSourcePosition, 1, 1) \ | |
237 \ | |
238 F(SetCode, 2, 1) \ | |
239 \ | |
240 F(DisableAccessChecks, 1, 1) \ | |
241 F(EnableAccessChecks, 1, 1) \ | |
242 \ | |
243 /* Dates */ \ | |
244 F(DateCurrentTime, 0, 1) \ | |
245 F(DateParseString, 2, 1) \ | |
246 F(DateLocalTimezone, 1, 1) \ | |
247 F(DateToUTC, 1, 1) \ | |
248 F(DateMakeDay, 2, 1) \ | |
249 F(DateSetValue, 3, 1) \ | |
250 F(DateCacheVersion, 0, 1) \ | |
251 \ | |
252 /* Globals */ \ | |
253 F(CompileString, 2, 1) \ | |
254 \ | |
255 /* Eval */ \ | |
256 F(GlobalProxy, 1, 1) \ | |
257 \ | |
258 F(AddNamedProperty, 4, 1) \ | |
259 F(SetProperty, 4, 1) \ | |
260 F(AddElement, 4, 1) \ | |
261 F(DefineDataPropertyUnchecked, 4, 1) \ | |
262 F(DefineAccessorPropertyUnchecked, 5, 1) \ | |
263 F(GetDataProperty, 2, 1) \ | |
264 F(DefineGetterPropertyUnchecked, 4, 1) \ | |
265 F(DefineSetterPropertyUnchecked, 4, 1) \ | |
266 \ | |
267 /* Arrays */ \ | |
268 F(RemoveArrayHoles, 2, 1) \ | |
269 F(GetArrayKeys, 2, 1) \ | |
270 F(MoveArrayContents, 2, 1) \ | |
271 F(EstimateNumberOfElements, 1, 1) \ | |
272 F(NormalizeElements, 1, 1) \ | |
273 F(HasComplexElements, 1, 1) \ | |
274 \ | |
275 /* Getters and Setters */ \ | |
276 F(LookupAccessor, 3, 1) \ | |
277 \ | |
278 /* ES5 */ \ | |
279 F(ObjectSeal, 1, 1) \ | |
280 F(ObjectFreeze, 1, 1) \ | |
281 \ | |
282 /* Harmony modules */ \ | |
283 F(IsJSModule, 1, 1) \ | |
284 \ | |
285 /* Harmony symbols */ \ | |
286 F(CreateSymbol, 1, 1) \ | |
287 F(CreatePrivateSymbol, 1, 1) \ | |
288 F(CreateGlobalPrivateOwnSymbol, 1, 1) \ | |
289 F(CreatePrivateOwnSymbol, 1, 1) \ | |
290 F(NewSymbolWrapper, 1, 1) \ | |
291 F(SymbolDescription, 1, 1) \ | |
292 F(SymbolRegistry, 0, 1) \ | |
293 F(SymbolIsPrivate, 1, 1) \ | |
294 \ | |
295 /* Harmony proxies */ \ | |
296 F(CreateJSProxy, 2, 1) \ | |
297 F(CreateJSFunctionProxy, 4, 1) \ | |
298 F(IsJSFunctionProxy, 1, 1) \ | |
299 F(GetHandler, 1, 1) \ | |
300 F(GetCallTrap, 1, 1) \ | |
301 F(GetConstructTrap, 1, 1) \ | |
302 F(Fix, 1, 1) \ | |
303 \ | |
304 /* ES6 collections */ \ | |
305 F(MapGrow, 1, 1) \ | |
306 F(MapShrink, 1, 1) \ | |
307 F(SetGrow, 1, 1) \ | |
308 F(SetShrink, 1, 1) \ | |
309 F(GenericHash, 1, 1) \ | |
310 \ | |
311 /* ES6 collection iterators */ \ | |
312 F(SetIteratorInitialize, 3, 1) \ | |
313 F(SetIteratorClone, 1, 1) \ | |
314 F(SetIteratorNext, 2, 1) \ | |
315 F(SetIteratorDetails, 1, 1) \ | |
316 F(MapIteratorInitialize, 3, 1) \ | |
317 F(MapIteratorClone, 1, 1) \ | |
318 F(MapIteratorNext, 2, 1) \ | |
319 F(MapIteratorDetails, 1, 1) \ | |
320 \ | |
321 /* Harmony weak maps and sets */ \ | |
322 F(WeakCollectionInitialize, 1, 1) \ | |
323 F(WeakCollectionGet, 2, 1) \ | |
324 F(WeakCollectionHas, 2, 1) \ | |
325 F(WeakCollectionDelete, 2, 1) \ | |
326 F(WeakCollectionSet, 3, 1) \ | |
327 \ | |
328 F(GetWeakMapEntries, 2, 1) \ | |
329 F(GetWeakSetValues, 2, 1) \ | |
330 \ | |
331 /* Harmony events */ \ | |
332 F(EnqueueMicrotask, 1, 1) \ | |
333 F(RunMicrotasks, 0, 1) \ | |
334 \ | |
335 /* Harmony observe */ \ | |
336 F(IsObserved, 1, 1) \ | |
337 F(SetIsObserved, 1, 1) \ | |
338 F(GetObservationState, 0, 1) \ | |
339 F(ObservationWeakMapCreate, 0, 1) \ | |
340 F(ObserverObjectAndRecordHaveSameOrigin, 3, 1) \ | |
341 F(ObjectWasCreatedInCurrentOrigin, 1, 1) \ | |
342 F(GetObjectContextObjectObserve, 1, 1) \ | |
343 F(GetObjectContextObjectGetNotifier, 1, 1) \ | |
344 F(GetObjectContextNotifierPerformChange, 1, 1) \ | |
345 F(DeliverObservationChangeRecords, 2, 1) \ | |
346 \ | |
347 /* Harmony typed arrays */ \ | |
348 F(ArrayBufferInitialize, 2, 1) \ | |
349 F(ArrayBufferSliceImpl, 3, 1) \ | |
350 F(ArrayBufferIsView, 1, 1) \ | |
351 F(ArrayBufferNeuter, 1, 1) \ | |
352 \ | |
353 F(IsTypedArray, 1, 1) \ | |
354 F(TypedArrayInitializeFromArrayLike, 4, 1) \ | |
355 F(TypedArrayGetBuffer, 1, 1) \ | |
356 F(TypedArraySetFastCases, 3, 1) \ | |
357 \ | |
358 F(DataViewGetBuffer, 1, 1) \ | |
359 F(DataViewGetInt8, 3, 1) \ | |
360 F(DataViewGetUint8, 3, 1) \ | |
361 F(DataViewGetInt16, 3, 1) \ | |
362 F(DataViewGetUint16, 3, 1) \ | |
363 F(DataViewGetInt32, 3, 1) \ | |
364 F(DataViewGetUint32, 3, 1) \ | |
365 F(DataViewGetFloat32, 3, 1) \ | |
366 F(DataViewGetFloat64, 3, 1) \ | |
367 \ | |
368 F(DataViewSetInt8, 4, 1) \ | |
369 F(DataViewSetUint8, 4, 1) \ | |
370 F(DataViewSetInt16, 4, 1) \ | |
371 F(DataViewSetUint16, 4, 1) \ | |
372 F(DataViewSetInt32, 4, 1) \ | |
373 F(DataViewSetUint32, 4, 1) \ | |
374 F(DataViewSetFloat32, 4, 1) \ | |
375 F(DataViewSetFloat64, 4, 1) \ | |
376 \ | |
377 /* Statements */ \ | |
378 F(NewObjectFromBound, 1, 1) \ | |
379 \ | |
380 /* Declarations and initialization */ \ | |
381 F(InitializeVarGlobal, 3, 1) \ | |
382 F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ | |
383 \ | |
384 /* Debugging */ \ | |
385 F(DebugPrint, 1, 1) \ | |
386 F(GlobalPrint, 1, 1) \ | |
387 F(DebugTrace, 0, 1) \ | |
388 F(TraceEnter, 0, 1) \ | |
389 F(TraceExit, 1, 1) \ | |
390 F(Abort, 1, 1) \ | |
391 F(AbortJS, 1, 1) \ | |
392 F(NativeScriptsCount, 0, 1) \ | |
393 F(RenderCallSite, 0, 1) \ | |
394 /* ES5 */ \ | |
395 F(OwnKeys, 1, 1) \ | |
396 \ | |
397 /* Message objects */ \ | |
398 F(MessageGetStartPosition, 1, 1) \ | |
399 F(MessageGetScript, 1, 1) \ | |
400 \ | |
401 /* Pseudo functions - handled as macros by parser */ \ | |
402 F(IS_VAR, 1, 1) \ | |
403 \ | |
404 /* expose boolean functions from objects-inl.h */ \ | |
405 F(HasFastSmiElements, 1, 1) \ | |
406 F(HasFastSmiOrObjectElements, 1, 1) \ | |
407 F(HasFastObjectElements, 1, 1) \ | |
408 F(HasFastDoubleElements, 1, 1) \ | |
409 F(HasFastHoleyElements, 1, 1) \ | |
410 F(HasDictionaryElements, 1, 1) \ | |
411 F(HasSloppyArgumentsElements, 1, 1) \ | |
412 F(HasExternalUint8ClampedElements, 1, 1) \ | |
413 F(HasExternalArrayElements, 1, 1) \ | |
414 F(HasExternalInt8Elements, 1, 1) \ | |
415 F(HasExternalUint8Elements, 1, 1) \ | |
416 F(HasExternalInt16Elements, 1, 1) \ | |
417 F(HasExternalUint16Elements, 1, 1) \ | |
418 F(HasExternalInt32Elements, 1, 1) \ | |
419 F(HasExternalUint32Elements, 1, 1) \ | |
420 F(HasExternalFloat32Elements, 1, 1) \ | |
421 F(HasExternalFloat64Elements, 1, 1) \ | |
422 F(HasFixedUint8ClampedElements, 1, 1) \ | |
423 F(HasFixedInt8Elements, 1, 1) \ | |
424 F(HasFixedUint8Elements, 1, 1) \ | |
425 F(HasFixedInt16Elements, 1, 1) \ | |
426 F(HasFixedUint16Elements, 1, 1) \ | |
427 F(HasFixedInt32Elements, 1, 1) \ | |
428 F(HasFixedUint32Elements, 1, 1) \ | |
429 F(HasFixedFloat32Elements, 1, 1) \ | |
430 F(HasFixedFloat64Elements, 1, 1) \ | |
431 F(HasFastProperties, 1, 1) \ | |
432 F(TransitionElementsKind, 2, 1) \ | |
433 F(HaveSameMap, 2, 1) \ | |
434 F(DisassembleFunction, 1, 1) \ | |
435 F(IsJSGlobalProxy, 1, 1) \ | |
436 F(ForInCacheArrayLength, 2, 1) /* TODO(turbofan): Only temporary */ | |
437 | |
438 | |
439 #define RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ | |
440 /* String and Regexp */ \ | |
441 F(NumberToStringRT, 1, 1) \ | |
442 F(RegExpConstructResultRT, 3, 1) \ | |
443 F(StringAddRT, 2, 1) \ | |
444 F(SubStringRT, 3, 1) \ | |
445 F(InternalizeString, 1, 1) \ | |
446 F(StringCompareRT, 2, 1) \ | |
447 F(StringCharCodeAtRT, 2, 1) \ | |
448 F(GetFromCacheRT, 2, 1) \ | |
449 \ | |
450 /* Compilation */ \ | |
451 F(CompileLazy, 1, 1) \ | |
452 F(CompileOptimized, 2, 1) \ | |
453 F(TryInstallOptimizedCode, 1, 1) \ | |
454 F(NotifyDeoptimized, 1, 1) \ | |
455 F(NotifyStubFailure, 0, 1) \ | |
456 \ | |
457 /* Utilities */ \ | |
458 F(AllocateInNewSpace, 1, 1) \ | |
459 F(AllocateInTargetSpace, 2, 1) \ | |
460 F(AllocateHeapNumber, 0, 1) \ | |
461 F(NumberToSmi, 1, 1) \ | |
462 F(NumberToStringSkipCache, 1, 1) \ | |
463 \ | |
464 F(NewArguments, 1, 1) /* TODO(turbofan): Only temporary */ \ | 491 F(NewArguments, 1, 1) /* TODO(turbofan): Only temporary */ \ |
465 F(NewSloppyArguments, 3, 1) \ | 492 F(NewSloppyArguments, 3, 1) \ |
466 F(NewStrictArguments, 3, 1) \ | 493 F(NewStrictArguments, 3, 1) \ |
467 F(NewRestParam, 3, 1) \ | 494 F(NewRestParam, 3, 1) \ |
468 F(NewRestParamSlow, 1, 1) \ | 495 F(NewRestParamSlow, 1, 1) \ |
469 \ | 496 F(NewClosureFromStubFailure, 1, 1) \ |
470 /* Harmony generators */ \ | |
471 F(CreateJSGeneratorObject, 0, 1) \ | |
472 F(SuspendJSGeneratorObject, -1, 1) \ | |
473 F(ResumeJSGeneratorObject, 3, 1) \ | |
474 F(GeneratorClose, 1, 1) \ | |
475 \ | |
476 /* Arrays */ \ | |
477 F(ArrayConstructor, -1, 1) \ | |
478 F(ArrayConstructorWithSubclassing, -1, 1) \ | |
479 F(InternalArrayConstructor, -1, 1) \ | |
480 \ | |
481 /* Literals */ \ | |
482 F(MaterializeRegExpLiteral, 4, 1) \ | |
483 F(CreateObjectLiteral, 4, 1) \ | |
484 F(CreateArrayLiteral, 4, 1) \ | |
485 F(CreateArrayLiteralStubBailout, 3, 1) \ | |
486 \ | |
487 /* Statements */ \ | |
488 F(NewClosure, 3, 1) \ | 497 F(NewClosure, 3, 1) \ |
489 F(NewClosureFromStubFailure, 1, 1) \ | |
490 F(NewObject, 2, 1) \ | |
491 F(NewObjectWithAllocationSite, 3, 1) \ | |
492 F(FinalizeInstanceSize, 1, 1) \ | |
493 F(Throw, 1, 1) \ | |
494 F(ReThrow, 1, 1) \ | |
495 F(ThrowReferenceError, 1, 1) \ | |
496 F(ThrowNotDateError, 0, 1) \ | |
497 F(ThrowConstAssignError, 0, 1) \ | |
498 F(StackGuard, 0, 1) \ | |
499 F(Interrupt, 0, 1) \ | |
500 F(FindExceptionHandler, 0, 1) \ | |
501 F(PromoteScheduledException, 0, 1) \ | |
502 \ | |
503 /* Contexts */ \ | |
504 F(NewScriptContext, 2, 1) \ | 498 F(NewScriptContext, 2, 1) \ |
505 F(NewFunctionContext, 1, 1) \ | 499 F(NewFunctionContext, 1, 1) \ |
506 F(PushWithContext, 2, 1) \ | 500 F(PushWithContext, 2, 1) \ |
507 F(PushCatchContext, 3, 1) \ | 501 F(PushCatchContext, 3, 1) \ |
508 F(PushBlockContext, 2, 1) \ | 502 F(PushBlockContext, 2, 1) \ |
| 503 F(IsJSModule, 1, 1) \ |
509 F(PushModuleContext, 2, 1) \ | 504 F(PushModuleContext, 2, 1) \ |
| 505 F(DeclareModules, 1, 1) \ |
510 F(DeleteLookupSlot, 2, 1) \ | 506 F(DeleteLookupSlot, 2, 1) \ |
511 F(StoreLookupSlot, 4, 1) \ | 507 F(StoreLookupSlot, 4, 1) \ |
512 \ | 508 F(GetArgumentsProperty, 1, 1) \ |
513 /* Declarations and initialization */ \ | 509 F(ArgumentsLength, 0, 1) \ |
514 F(DeclareGlobals, 3, 1) \ | 510 F(Arguments, 1, 1) |
515 F(DeclareModules, 1, 1) \ | 511 |
516 F(DeclareLookupSlot, 4, 1) \ | 512 |
517 F(InitializeConstGlobal, 2, 1) \ | 513 #define FOR_EACH_INTRINSIC_STRINGS(F) \ |
518 F(InitializeLegacyConstLookupSlot, 3, 1) \ | 514 F(StringReplaceOneCharWithString, 3, 1) \ |
519 \ | 515 F(StringIndexOf, 3, 1) \ |
520 /* Maths */ \ | 516 F(StringLastIndexOf, 3, 1) \ |
521 F(MathPowSlow, 2, 1) \ | 517 F(StringLocaleCompare, 2, 1) \ |
522 F(MathPowRT, 2, 1) | 518 F(SubStringRT, 3, 1) \ |
| 519 F(SubString, 3, 1) \ |
| 520 F(StringAddRT, 2, 1) \ |
| 521 F(StringAdd, 2, 1) \ |
| 522 F(InternalizeString, 1, 1) \ |
| 523 F(StringMatch, 3, 1) \ |
| 524 F(StringCharCodeAtRT, 2, 1) \ |
| 525 F(CharFromCode, 1, 1) \ |
| 526 F(StringCompareRT, 2, 1) \ |
| 527 F(StringCompare, 2, 1) \ |
| 528 F(StringBuilderConcat, 3, 1) \ |
| 529 F(StringBuilderJoin, 3, 1) \ |
| 530 F(SparseJoinWithSeparator, 3, 1) \ |
| 531 F(StringToArray, 2, 1) \ |
| 532 F(StringToLowerCase, 1, 1) \ |
| 533 F(StringToUpperCase, 1, 1) \ |
| 534 F(StringTrim, 3, 1) \ |
| 535 F(TruncateString, 2, 1) \ |
| 536 F(NewString, 2, 1) \ |
| 537 F(NewConsString, 4, 1) \ |
| 538 F(StringEquals, 2, 1) \ |
| 539 F(FlattenString, 1, 1) \ |
| 540 F(StringCharFromCode, 1, 1) \ |
| 541 F(StringCharAt, 2, 1) \ |
| 542 F(OneByteSeqStringGetChar, 2, 1) \ |
| 543 F(OneByteSeqStringSetChar, 3, 1) \ |
| 544 F(TwoByteSeqStringGetChar, 2, 1) \ |
| 545 F(TwoByteSeqStringSetChar, 3, 1) \ |
| 546 F(StringCharCodeAt, 2, 1) \ |
| 547 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \ |
| 548 F(StringGetLength, 1, 1) |
| 549 |
| 550 |
| 551 #define FOR_EACH_INTRINSIC_SYMBOL(F) \ |
| 552 F(CreateSymbol, 1, 1) \ |
| 553 F(CreatePrivateSymbol, 1, 1) \ |
| 554 F(CreatePrivateOwnSymbol, 1, 1) \ |
| 555 F(CreateGlobalPrivateOwnSymbol, 1, 1) \ |
| 556 F(NewSymbolWrapper, 1, 1) \ |
| 557 F(SymbolDescription, 1, 1) \ |
| 558 F(SymbolRegistry, 0, 1) \ |
| 559 F(SymbolIsPrivate, 1, 1) |
| 560 |
| 561 |
| 562 #define FOR_EACH_INTRINSIC_TEST(F) \ |
| 563 F(DeoptimizeFunction, 1, 1) \ |
| 564 F(DeoptimizeNow, 0, 1) \ |
| 565 F(RunningInSimulator, 0, 1) \ |
| 566 F(IsConcurrentRecompilationSupported, 0, 1) \ |
| 567 F(OptimizeFunctionOnNextCall, -1, 1) \ |
| 568 F(OptimizeOsr, -1, 1) \ |
| 569 F(NeverOptimizeFunction, 1, 1) \ |
| 570 F(GetOptimizationStatus, -1, 1) \ |
| 571 F(UnblockConcurrentRecompilation, 0, 1) \ |
| 572 F(GetOptimizationCount, 1, 1) \ |
| 573 F(ClearFunctionTypeFeedback, 1, 1) \ |
| 574 F(NotifyContextDisposed, 0, 1) \ |
| 575 F(SetAllocationTimeout, -1 /* 2 || 3 */, 1) \ |
| 576 F(DebugPrint, 1, 1) \ |
| 577 F(DebugTrace, 0, 1) \ |
| 578 F(GlobalPrint, 1, 1) \ |
| 579 F(SystemBreak, 0, 1) \ |
| 580 F(SetFlags, 1, 1) \ |
| 581 F(Abort, 1, 1) \ |
| 582 F(AbortJS, 1, 1) \ |
| 583 F(NativeScriptsCount, 0, 1) \ |
| 584 F(GetV8Version, 0, 1) \ |
| 585 F(DisassembleFunction, 1, 1) \ |
| 586 F(TraceEnter, 0, 1) \ |
| 587 F(TraceExit, 1, 1) \ |
| 588 F(HaveSameMap, 2, 1) \ |
| 589 F(HasFastSmiElements, 1, 1) \ |
| 590 F(HasFastObjectElements, 1, 1) \ |
| 591 F(HasFastSmiOrObjectElements, 1, 1) \ |
| 592 F(HasFastDoubleElements, 1, 1) \ |
| 593 F(HasFastHoleyElements, 1, 1) \ |
| 594 F(HasDictionaryElements, 1, 1) \ |
| 595 F(HasSloppyArgumentsElements, 1, 1) \ |
| 596 F(HasExternalArrayElements, 1, 1) \ |
| 597 F(HasFastProperties, 1, 1) \ |
| 598 F(HasExternalUint8Elements, 1, 1) \ |
| 599 F(HasExternalInt8Elements, 1, 1) \ |
| 600 F(HasExternalUint16Elements, 1, 1) \ |
| 601 F(HasExternalInt16Elements, 1, 1) \ |
| 602 F(HasExternalUint32Elements, 1, 1) \ |
| 603 F(HasExternalInt32Elements, 1, 1) \ |
| 604 F(HasExternalFloat32Elements, 1, 1) \ |
| 605 F(HasExternalFloat64Elements, 1, 1) \ |
| 606 F(HasExternalUint8ClampedElements, 1, 1) \ |
| 607 F(HasFixedUint8Elements, 1, 1) \ |
| 608 F(HasFixedInt8Elements, 1, 1) \ |
| 609 F(HasFixedUint16Elements, 1, 1) \ |
| 610 F(HasFixedInt16Elements, 1, 1) \ |
| 611 F(HasFixedUint32Elements, 1, 1) \ |
| 612 F(HasFixedInt32Elements, 1, 1) \ |
| 613 F(HasFixedFloat32Elements, 1, 1) \ |
| 614 F(HasFixedFloat64Elements, 1, 1) \ |
| 615 F(HasFixedUint8ClampedElements, 1, 1) |
| 616 |
| 617 |
| 618 #define FOR_EACH_INTRINSIC_TYPEDARRAY(F) \ |
| 619 F(ArrayBufferInitialize, 2, 1) \ |
| 620 F(ArrayBufferGetByteLength, 1, 1) \ |
| 621 F(ArrayBufferSliceImpl, 3, 1) \ |
| 622 F(ArrayBufferIsView, 1, 1) \ |
| 623 F(ArrayBufferNeuter, 1, 1) \ |
| 624 F(TypedArrayInitialize, 5, 1) \ |
| 625 F(TypedArrayInitializeFromArrayLike, 4, 1) \ |
| 626 F(ArrayBufferViewGetByteLength, 1, 1) \ |
| 627 F(ArrayBufferViewGetByteOffset, 1, 1) \ |
| 628 F(TypedArrayGetLength, 1, 1) \ |
| 629 F(DataViewGetBuffer, 1, 1) \ |
| 630 F(TypedArrayGetBuffer, 1, 1) \ |
| 631 F(TypedArraySetFastCases, 3, 1) \ |
| 632 F(TypedArrayMaxSizeInHeap, 0, 1) \ |
| 633 F(IsTypedArray, 1, 1) \ |
| 634 F(DataViewInitialize, 4, 1) \ |
| 635 F(DataViewGetUint8, 3, 1) \ |
| 636 F(DataViewGetInt8, 3, 1) \ |
| 637 F(DataViewGetUint16, 3, 1) \ |
| 638 F(DataViewGetInt16, 3, 1) \ |
| 639 F(DataViewGetUint32, 3, 1) \ |
| 640 F(DataViewGetInt32, 3, 1) \ |
| 641 F(DataViewGetFloat32, 3, 1) \ |
| 642 F(DataViewGetFloat64, 3, 1) \ |
| 643 F(DataViewSetUint8, 4, 1) \ |
| 644 F(DataViewSetInt8, 4, 1) \ |
| 645 F(DataViewSetUint16, 4, 1) \ |
| 646 F(DataViewSetInt16, 4, 1) \ |
| 647 F(DataViewSetUint32, 4, 1) \ |
| 648 F(DataViewSetInt32, 4, 1) \ |
| 649 F(DataViewSetFloat32, 4, 1) \ |
| 650 F(DataViewSetFloat64, 4, 1) |
| 651 |
| 652 |
| 653 #define FOR_EACH_INTRINSIC_URI(F) \ |
| 654 F(URIEscape, 1, 1) \ |
| 655 F(URIUnescape, 1, 1) |
523 | 656 |
524 | 657 |
525 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ | 658 #define FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ |
526 F(LoadLookupSlot, 2, 2) \ | 659 F(LoadLookupSlot, 2, 2) \ |
527 F(LoadLookupSlotNoReferenceError, 2, 2) \ | 660 F(LoadLookupSlotNoReferenceError, 2, 2) \ |
528 F(ResolvePossiblyDirectEval, 6, 2) \ | 661 F(ResolvePossiblyDirectEval, 6, 2) \ |
529 F(ForInInit, 2, 2) /* TODO(turbofan): Only temporary */ \ | 662 F(ForInInit, 2, 2) /* TODO(turbofan): Only temporary */ \ |
530 F(ForInNext, 4, 2) /* TODO(turbofan): Only temporary */ | 663 F(ForInNext, 4, 2) /* TODO(turbofan): Only temporary */ |
531 | 664 |
532 | 665 |
533 #define RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ | |
534 /* Debugger support*/ \ | |
535 F(DebugBreak, 0, 1) \ | |
536 F(SetDebugEventListener, 2, 1) \ | |
537 F(ScheduleBreak, 0, 1) \ | |
538 F(DebugGetPropertyDetails, 2, 1) \ | |
539 F(DebugGetProperty, 2, 1) \ | |
540 F(DebugPropertyTypeFromDetails, 1, 1) \ | |
541 F(DebugPropertyAttributesFromDetails, 1, 1) \ | |
542 F(DebugPropertyIndexFromDetails, 1, 1) \ | |
543 F(DebugNamedInterceptorPropertyValue, 2, 1) \ | |
544 F(DebugIndexedInterceptorElementValue, 2, 1) \ | |
545 F(CheckExecutionState, 1, 1) \ | |
546 F(GetFrameCount, 1, 1) \ | |
547 F(GetFrameDetails, 2, 1) \ | |
548 F(GetScopeCount, 2, 1) \ | |
549 F(GetStepInPositions, 2, 1) \ | |
550 F(GetScopeDetails, 4, 1) \ | |
551 F(GetAllScopesDetails, 4, 1) \ | |
552 F(GetFunctionScopeCount, 1, 1) \ | |
553 F(GetFunctionScopeDetails, 2, 1) \ | |
554 F(SetScopeVariableValue, 6, 1) \ | |
555 F(DebugPrintScopes, 0, 1) \ | |
556 F(GetThreadCount, 1, 1) \ | |
557 F(GetThreadDetails, 2, 1) \ | |
558 F(SetDisableBreak, 1, 1) \ | |
559 F(GetBreakLocations, 2, 1) \ | |
560 F(SetFunctionBreakPoint, 3, 1) \ | |
561 F(SetScriptBreakPoint, 4, 1) \ | |
562 F(ClearBreakPoint, 1, 1) \ | |
563 F(ChangeBreakOnException, 2, 1) \ | |
564 F(IsBreakOnException, 1, 1) \ | |
565 F(PrepareStep, 4, 1) \ | |
566 F(ClearStepping, 0, 1) \ | |
567 F(DebugEvaluate, 6, 1) \ | |
568 F(DebugEvaluateGlobal, 4, 1) \ | |
569 F(DebugGetLoadedScripts, 0, 1) \ | |
570 F(DebugReferencedBy, 3, 1) \ | |
571 F(DebugConstructedBy, 2, 1) \ | |
572 F(DebugGetPrototype, 1, 1) \ | |
573 F(DebugSetScriptSource, 2, 1) \ | |
574 F(DebugCallbackSupportsStepping, 1, 1) \ | |
575 F(SystemBreak, 0, 1) \ | |
576 F(FunctionGetInferredName, 1, 1) \ | |
577 F(FunctionGetDebugName, 1, 1) \ | |
578 F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \ | |
579 F(LiveEditGatherCompileInfo, 2, 1) \ | |
580 F(LiveEditReplaceScript, 3, 1) \ | |
581 F(LiveEditReplaceFunctionCode, 2, 1) \ | |
582 F(LiveEditFunctionSourceUpdated, 1, 1) \ | |
583 F(LiveEditFunctionSetScript, 2, 1) \ | |
584 F(LiveEditReplaceRefToNestedFunction, 3, 1) \ | |
585 F(LiveEditPatchFunctionPositions, 2, 1) \ | |
586 F(LiveEditCheckAndDropActivations, 2, 1) \ | |
587 F(LiveEditCompareStrings, 2, 1) \ | |
588 F(LiveEditRestartFrame, 2, 1) \ | |
589 F(GetFunctionCodePositionFromSource, 2, 1) \ | |
590 F(ExecuteInDebugContext, 1, 1) \ | |
591 F(GetDebugContext, 0, 1) \ | |
592 F(SetFlags, 1, 1) \ | |
593 F(CollectGarbage, 1, 1) \ | |
594 F(GetHeapUsage, 0, 1) | |
595 | |
596 | |
597 #ifdef V8_I18N_SUPPORT | |
598 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \ | |
599 /* i18n support */ \ | |
600 /* Standalone, helper methods. */ \ | |
601 F(CanonicalizeLanguageTag, 1, 1) \ | |
602 F(AvailableLocalesOf, 1, 1) \ | |
603 F(GetDefaultICULocale, 0, 1) \ | |
604 F(GetLanguageTagVariants, 1, 1) \ | |
605 F(IsInitializedIntlObject, 1, 1) \ | |
606 F(IsInitializedIntlObjectOfType, 2, 1) \ | |
607 F(MarkAsInitializedIntlObjectOfType, 3, 1) \ | |
608 F(GetImplFromInitializedIntlObject, 1, 1) \ | |
609 \ | |
610 /* Date format and parse. */ \ | |
611 F(CreateDateTimeFormat, 3, 1) \ | |
612 F(InternalDateFormat, 2, 1) \ | |
613 F(InternalDateParse, 2, 1) \ | |
614 \ | |
615 /* Number format and parse. */ \ | |
616 F(CreateNumberFormat, 3, 1) \ | |
617 F(InternalNumberFormat, 2, 1) \ | |
618 F(InternalNumberParse, 2, 1) \ | |
619 \ | |
620 /* Collator. */ \ | |
621 F(CreateCollator, 3, 1) \ | |
622 F(InternalCompare, 3, 1) \ | |
623 \ | |
624 /* String.prototype.normalize. */ \ | |
625 F(StringNormalize, 2, 1) \ | |
626 \ | |
627 /* Break iterator. */ \ | |
628 F(CreateBreakIterator, 3, 1) \ | |
629 F(BreakIteratorAdoptText, 2, 1) \ | |
630 F(BreakIteratorFirst, 1, 1) \ | |
631 F(BreakIteratorNext, 1, 1) \ | |
632 F(BreakIteratorCurrent, 1, 1) \ | |
633 F(BreakIteratorBreakType, 1, 1) | |
634 | |
635 #else | |
636 #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) | |
637 #endif | |
638 | |
639 | |
640 // ---------------------------------------------------------------------------- | |
641 // INLINE_FUNCTION_LIST defines the intrinsics typically handled specially by | |
642 // the various compilers. | |
643 // Entries have the form F(name, number of arguments, number of return values). | |
644 #define INLINE_FUNCTION_LIST(F) \ | |
645 F(IsSmi, 1, 1) \ | |
646 F(IsNonNegativeSmi, 1, 1) \ | |
647 F(IsArray, 1, 1) \ | |
648 F(IsRegExp, 1, 1) \ | |
649 F(IsJSProxy, 1, 1) \ | |
650 F(IsConstructCall, 0, 1) \ | |
651 F(CallFunction, -1 /* receiver + n args + function */, 1) \ | |
652 F(DefaultConstructorCallSuper, 0, 1) \ | |
653 F(ArgumentsLength, 0, 1) \ | |
654 F(Arguments, 1, 1) \ | |
655 F(ValueOf, 1, 1) \ | |
656 F(SetValueOf, 2, 1) \ | |
657 F(DateField, 2 /* date object, field index */, 1) \ | |
658 F(StringCharFromCode, 1, 1) \ | |
659 F(StringCharAt, 2, 1) \ | |
660 F(OneByteSeqStringGetChar, 2, 1) \ | |
661 F(OneByteSeqStringSetChar, 3, 1) \ | |
662 F(TwoByteSeqStringGetChar, 2, 1) \ | |
663 F(TwoByteSeqStringSetChar, 3, 1) \ | |
664 F(ObjectEquals, 2, 1) \ | |
665 F(IsObject, 1, 1) \ | |
666 F(IsFunction, 1, 1) \ | |
667 F(IsUndetectableObject, 1, 1) \ | |
668 F(IsSpecObject, 1, 1) \ | |
669 F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \ | |
670 F(MathPow, 2, 1) \ | |
671 F(IsMinusZero, 1, 1) \ | |
672 F(HasCachedArrayIndex, 1, 1) \ | |
673 F(GetCachedArrayIndex, 1, 1) \ | |
674 F(FastOneByteArrayJoin, 2, 1) \ | |
675 F(GeneratorNext, 2, 1) \ | |
676 F(GeneratorThrow, 2, 1) \ | |
677 F(DebugBreakInOptimizedCode, 0, 1) \ | |
678 F(ClassOf, 1, 1) \ | |
679 F(StringCharCodeAt, 2, 1) \ | |
680 F(StringAdd, 2, 1) \ | |
681 F(SubString, 3, 1) \ | |
682 F(StringCompare, 2, 1) \ | |
683 F(RegExpExec, 4, 1) \ | |
684 F(RegExpConstructResult, 3, 1) \ | |
685 F(GetFromCache, 2, 1) \ | |
686 F(NumberToString, 1, 1) \ | |
687 F(DebugIsActive, 0, 1) | |
688 | |
689 | |
690 // ---------------------------------------------------------------------------- | |
691 // INLINE_OPTIMIZED_FUNCTION_LIST defines the intrinsics typically handled | |
692 // specially by Crankshaft. | |
693 // Entries have the form F(name, number of arguments, number of return values). | |
694 #define INLINE_OPTIMIZED_FUNCTION_LIST(F) \ | |
695 /* Typed Arrays */ \ | |
696 F(TypedArrayInitialize, 5, 1) \ | |
697 F(DataViewInitialize, 4, 1) \ | |
698 F(MaxSmi, 0, 1) \ | |
699 F(TypedArrayMaxSizeInHeap, 0, 1) \ | |
700 F(ArrayBufferViewGetByteLength, 1, 1) \ | |
701 F(ArrayBufferViewGetByteOffset, 1, 1) \ | |
702 F(TypedArrayGetLength, 1, 1) \ | |
703 /* ArrayBuffer */ \ | |
704 F(ArrayBufferGetByteLength, 1, 1) \ | |
705 /* Maths */ \ | |
706 F(ConstructDouble, 2, 1) \ | |
707 F(DoubleHi, 1, 1) \ | |
708 F(DoubleLo, 1, 1) \ | |
709 F(MathClz32, 1, 1) \ | |
710 F(MathFloor, 1, 1) \ | |
711 F(MathSqrt, 1, 1) \ | |
712 F(MathLogRT, 1, 1) \ | |
713 /* ES6 Collections */ \ | |
714 F(MapClear, 1, 1) \ | |
715 F(MapInitialize, 1, 1) \ | |
716 F(SetClear, 1, 1) \ | |
717 F(SetInitialize, 1, 1) \ | |
718 F(FixedArrayGet, 2, 1) \ | |
719 F(FixedArraySet, 3, 1) \ | |
720 F(JSCollectionGetTable, 1, 1) \ | |
721 F(StringGetRawHashField, 1, 1) \ | |
722 F(TheHole, 0, 1) \ | |
723 /* Arrays */ \ | |
724 F(HasFastPackedElements, 1, 1) \ | |
725 F(GetPrototype, 1, 1) \ | |
726 /* Strings */ \ | |
727 F(StringGetLength, 1, 1) \ | |
728 /* JSValue */ \ | |
729 F(JSValueGetValue, 1, 1) \ | |
730 /* HeapObject */ \ | |
731 F(HeapObjectGetMap, 1, 1) \ | |
732 /* Map */ \ | |
733 F(MapGetInstanceType, 1, 1) | |
734 | |
735 | |
736 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ | 666 #define FOR_EACH_INTRINSIC_RETURN_OBJECT(F) \ |
737 RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ | 667 FOR_EACH_INTRINSIC_ARRAY(F) \ |
738 RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ | 668 FOR_EACH_INTRINSIC_CLASSES(F) \ |
739 RUNTIME_FUNCTION_LIST_ALWAYS_3(F) \ | 669 FOR_EACH_INTRINSIC_COLLECTIONS(F) \ |
740 RUNTIME_FUNCTION_LIST_DEBUGGER(F) \ | 670 FOR_EACH_INTRINSIC_COMPILER(F) \ |
741 RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \ | 671 FOR_EACH_INTRINSIC_DATE(F) \ |
742 INLINE_FUNCTION_LIST(F) \ | 672 FOR_EACH_INTRINSIC_DEBUG(F) \ |
743 INLINE_OPTIMIZED_FUNCTION_LIST(F) | 673 FOR_EACH_INTRINSIC_FUNCTION(F) \ |
744 | 674 FOR_EACH_INTRINSIC_GENERATOR(F) \ |
| 675 FOR_EACH_INTRINSIC_I18N(F) \ |
| 676 FOR_EACH_INTRINSIC_INTERNAL(F) \ |
| 677 FOR_EACH_INTRINSIC_JSON(F) \ |
| 678 FOR_EACH_INTRINSIC_LITERALS(F) \ |
| 679 FOR_EACH_INTRINSIC_LIVEEDIT(F) \ |
| 680 FOR_EACH_INTRINSIC_MATHS(F) \ |
| 681 FOR_EACH_INTRINSIC_NUMBERS(F) \ |
| 682 FOR_EACH_INTRINSIC_OBJECT(F) \ |
| 683 FOR_EACH_INTRINSIC_OBSERVE(F) \ |
| 684 FOR_EACH_INTRINSIC_PROXY(F) \ |
| 685 FOR_EACH_INTRINSIC_REGEXP(F) \ |
| 686 FOR_EACH_INTRINSIC_SCOPES(F) \ |
| 687 FOR_EACH_INTRINSIC_STRINGS(F) \ |
| 688 FOR_EACH_INTRINSIC_SYMBOL(F) \ |
| 689 FOR_EACH_INTRINSIC_TEST(F) \ |
| 690 FOR_EACH_INTRINSIC_TYPEDARRAY(F) \ |
| 691 FOR_EACH_INTRINSIC_URI(F) |
745 | 692 |
746 // FOR_EACH_INTRINSIC defines the list of all intrinsics, coming in 2 flavors, | 693 // FOR_EACH_INTRINSIC defines the list of all intrinsics, coming in 2 flavors, |
747 // either returning an object or a pair. | 694 // either returning an object or a pair. |
748 // Entries have the form F(name, number of arguments, number of values). | |
749 #define FOR_EACH_INTRINSIC(F) \ | 695 #define FOR_EACH_INTRINSIC(F) \ |
750 FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ | 696 FOR_EACH_INTRINSIC_RETURN_PAIR(F) \ |
751 FOR_EACH_INTRINSIC_RETURN_OBJECT(F) | 697 FOR_EACH_INTRINSIC_RETURN_OBJECT(F) |
752 | 698 |
753 | 699 |
754 //--------------------------------------------------------------------------- | 700 //--------------------------------------------------------------------------- |
755 // Runtime provides access to all C++ runtime functions. | 701 // Runtime provides access to all C++ runtime functions. |
756 | 702 |
757 class RuntimeState { | 703 class RuntimeState { |
758 public: | 704 public: |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 | 856 |
911 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; | 857 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; |
912 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; | 858 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; |
913 STATIC_ASSERT(LANGUAGE_END == 3); | 859 STATIC_ASSERT(LANGUAGE_END == 3); |
914 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {}; | 860 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {}; |
915 | 861 |
916 } // namespace internal | 862 } // namespace internal |
917 } // namespace v8 | 863 } // namespace v8 |
918 | 864 |
919 #endif // V8_RUNTIME_RUNTIME_H_ | 865 #endif // V8_RUNTIME_RUNTIME_H_ |
OLD | NEW |