Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1260)

Side by Side Diff: src/runtime/runtime.h

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

Powered by Google App Engine
This is Rietveld 408576698