v8  3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
runtime.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_RUNTIME_H_
29 #define V8_RUNTIME_H_
30 
31 #include "allocation.h"
32 #include "zone.h"
33 
34 namespace v8 {
35 namespace internal {
36 
37 // The interface to C++ runtime functions.
38 
39 // ----------------------------------------------------------------------------
40 // RUNTIME_FUNCTION_LIST_ALWAYS defines runtime calls available in both
41 // release and debug mode.
42 // This macro should only be used by the macro RUNTIME_FUNCTION_LIST.
43 
44 // WARNING: RUNTIME_FUNCTION_LIST_ALWAYS_* is a very large macro that caused
45 // MSVC Intellisense to crash. It was broken into two macros to work around
46 // this problem. Please avoid large recursive macros whenever possible.
47 #define RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
48  /* Property access */ \
49  F(GetProperty, 2, 1) \
50  F(KeyedGetProperty, 2, 1) \
51  F(DeleteProperty, 3, 1) \
52  F(HasLocalProperty, 2, 1) \
53  F(HasProperty, 2, 1) \
54  F(HasElement, 2, 1) \
55  F(IsPropertyEnumerable, 2, 1) \
56  F(GetPropertyNames, 1, 1) \
57  F(GetPropertyNamesFast, 1, 1) \
58  F(GetLocalPropertyNames, 1, 1) \
59  F(GetLocalElementNames, 1, 1) \
60  F(GetInterceptorInfo, 1, 1) \
61  F(GetNamedInterceptorPropertyNames, 1, 1) \
62  F(GetIndexedInterceptorElementNames, 1, 1) \
63  F(GetArgumentsProperty, 1, 1) \
64  F(ToFastProperties, 1, 1) \
65  F(ToSlowProperties, 1, 1) \
66  F(FinishArrayPrototypeSetup, 1, 1) \
67  F(SpecialArrayFunctions, 1, 1) \
68  F(GetDefaultReceiver, 1, 1) \
69  \
70  F(GetPrototype, 1, 1) \
71  F(IsInPrototypeChain, 2, 1) \
72  \
73  F(GetOwnProperty, 2, 1) \
74  \
75  F(IsExtensible, 1, 1) \
76  F(PreventExtensions, 1, 1)\
77  \
78  /* Utilities */ \
79  F(CheckIsBootstrapping, 0, 1) \
80  F(GetRootNaN, 0, 1) \
81  F(Call, -1 /* >= 2 */, 1) \
82  F(Apply, 5, 1) \
83  F(GetFunctionDelegate, 1, 1) \
84  F(GetConstructorDelegate, 1, 1) \
85  F(NewArgumentsFast, 3, 1) \
86  F(NewStrictArgumentsFast, 3, 1) \
87  F(LazyCompile, 1, 1) \
88  F(LazyRecompile, 1, 1) \
89  F(NotifyDeoptimized, 1, 1) \
90  F(NotifyOSR, 0, 1) \
91  F(DeoptimizeFunction, 1, 1) \
92  F(ClearFunctionTypeFeedback, 1, 1) \
93  F(RunningInSimulator, 0, 1) \
94  F(OptimizeFunctionOnNextCall, -1, 1) \
95  F(GetOptimizationStatus, 1, 1) \
96  F(GetOptimizationCount, 1, 1) \
97  F(CompileForOnStackReplacement, 1, 1) \
98  F(SetNewFunctionAttributes, 1, 1) \
99  F(AllocateInNewSpace, 1, 1) \
100  F(SetNativeFlag, 1, 1) \
101  F(StoreArrayLiteralElement, 5, 1) \
102  F(DebugCallbackSupportsStepping, 1, 1) \
103  F(DebugPrepareStepInIfStepping, 1, 1) \
104  \
105  /* Array join support */ \
106  F(PushIfAbsent, 2, 1) \
107  F(ArrayConcat, 1, 1) \
108  \
109  /* Conversions */ \
110  F(ToBool, 1, 1) \
111  F(Typeof, 1, 1) \
112  \
113  F(StringToNumber, 1, 1) \
114  F(StringFromCharCodeArray, 1, 1) \
115  F(StringParseInt, 2, 1) \
116  F(StringParseFloat, 1, 1) \
117  F(StringToLowerCase, 1, 1) \
118  F(StringToUpperCase, 1, 1) \
119  F(StringSplit, 3, 1) \
120  F(CharFromCode, 1, 1) \
121  F(URIEscape, 1, 1) \
122  F(URIUnescape, 1, 1) \
123  F(QuoteJSONString, 1, 1) \
124  F(QuoteJSONStringComma, 1, 1) \
125  F(QuoteJSONStringArray, 1, 1) \
126  \
127  F(NumberToString, 1, 1) \
128  F(NumberToStringSkipCache, 1, 1) \
129  F(NumberToInteger, 1, 1) \
130  F(NumberToIntegerMapMinusZero, 1, 1) \
131  F(NumberToJSUint32, 1, 1) \
132  F(NumberToJSInt32, 1, 1) \
133  F(NumberToSmi, 1, 1) \
134  F(AllocateHeapNumber, 0, 1) \
135  \
136  /* Arithmetic operations */ \
137  F(NumberAdd, 2, 1) \
138  F(NumberSub, 2, 1) \
139  F(NumberMul, 2, 1) \
140  F(NumberDiv, 2, 1) \
141  F(NumberMod, 2, 1) \
142  F(NumberUnaryMinus, 1, 1) \
143  F(NumberAlloc, 0, 1) \
144  \
145  F(StringAdd, 2, 1) \
146  F(StringBuilderConcat, 3, 1) \
147  F(StringBuilderJoin, 3, 1) \
148  F(SparseJoinWithSeparator, 3, 1) \
149  \
150  /* Bit operations */ \
151  F(NumberOr, 2, 1) \
152  F(NumberAnd, 2, 1) \
153  F(NumberXor, 2, 1) \
154  F(NumberNot, 1, 1) \
155  \
156  F(NumberShl, 2, 1) \
157  F(NumberShr, 2, 1) \
158  F(NumberSar, 2, 1) \
159  \
160  /* Comparisons */ \
161  F(NumberEquals, 2, 1) \
162  F(StringEquals, 2, 1) \
163  \
164  F(NumberCompare, 3, 1) \
165  F(SmiLexicographicCompare, 2, 1) \
166  F(StringCompare, 2, 1) \
167  \
168  /* Math */ \
169  F(Math_acos, 1, 1) \
170  F(Math_asin, 1, 1) \
171  F(Math_atan, 1, 1) \
172  F(Math_atan2, 2, 1) \
173  F(Math_ceil, 1, 1) \
174  F(Math_cos, 1, 1) \
175  F(Math_exp, 1, 1) \
176  F(Math_floor, 1, 1) \
177  F(Math_log, 1, 1) \
178  F(Math_pow, 2, 1) \
179  F(Math_pow_cfunction, 2, 1) \
180  F(RoundNumber, 1, 1) \
181  F(Math_sin, 1, 1) \
182  F(Math_sqrt, 1, 1) \
183  F(Math_tan, 1, 1) \
184  \
185  /* Regular expressions */ \
186  F(RegExpCompile, 3, 1) \
187  F(RegExpExec, 4, 1) \
188  F(RegExpExecMultiple, 4, 1) \
189  F(RegExpInitializeObject, 5, 1) \
190  F(RegExpConstructResult, 3, 1) \
191  \
192  /* JSON */ \
193  F(ParseJson, 1, 1) \
194  \
195  /* Strings */ \
196  F(StringCharCodeAt, 2, 1) \
197  F(StringIndexOf, 3, 1) \
198  F(StringLastIndexOf, 3, 1) \
199  F(StringLocaleCompare, 2, 1) \
200  F(SubString, 3, 1) \
201  F(StringReplaceRegExpWithString, 4, 1) \
202  F(StringReplaceOneCharWithString, 3, 1) \
203  F(StringMatch, 3, 1) \
204  F(StringTrim, 3, 1) \
205  F(StringToArray, 2, 1) \
206  F(NewStringWrapper, 1, 1) \
207  \
208  /* Numbers */ \
209  F(NumberToRadixString, 2, 1) \
210  F(NumberToFixed, 2, 1) \
211  F(NumberToExponential, 2, 1) \
212  F(NumberToPrecision, 2, 1)
213 
214 #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
215  /* Reflection */ \
216  F(FunctionSetInstanceClassName, 2, 1) \
217  F(FunctionSetLength, 2, 1) \
218  F(FunctionSetPrototype, 2, 1) \
219  F(FunctionSetReadOnlyPrototype, 1, 1) \
220  F(FunctionGetName, 1, 1) \
221  F(FunctionSetName, 2, 1) \
222  F(FunctionNameShouldPrintAsAnonymous, 1, 1) \
223  F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \
224  F(FunctionBindArguments, 4, 1) \
225  F(BoundFunctionGetBindings, 1, 1) \
226  F(FunctionRemovePrototype, 1, 1) \
227  F(FunctionGetSourceCode, 1, 1) \
228  F(FunctionGetScript, 1, 1) \
229  F(FunctionGetScriptSourcePosition, 1, 1) \
230  F(FunctionGetPositionForOffset, 2, 1) \
231  F(FunctionIsAPIFunction, 1, 1) \
232  F(FunctionIsBuiltin, 1, 1) \
233  F(GetScript, 1, 1) \
234  F(CollectStackTrace, 3, 1) \
235  F(GetV8Version, 0, 1) \
236  \
237  F(ClassOf, 1, 1) \
238  F(SetCode, 2, 1) \
239  F(SetExpectedNumberOfProperties, 2, 1) \
240  \
241  F(CreateApiFunction, 1, 1) \
242  F(IsTemplate, 1, 1) \
243  F(GetTemplateField, 2, 1) \
244  F(DisableAccessChecks, 1, 1) \
245  F(EnableAccessChecks, 1, 1) \
246  \
247  /* Dates */ \
248  F(DateCurrentTime, 0, 1) \
249  F(DateParseString, 2, 1) \
250  F(DateLocalTimezone, 1, 1) \
251  F(DateToUTC, 1, 1) \
252  F(DateMakeDay, 2, 1) \
253  F(DateSetValue, 3, 1) \
254  \
255  /* Numbers */ \
256  \
257  /* Globals */ \
258  F(CompileString, 1, 1) \
259  F(GlobalPrint, 1, 1) \
260  \
261  /* Eval */ \
262  F(GlobalReceiver, 1, 1) \
263  F(ResolvePossiblyDirectEval, 5, 2) \
264  \
265  F(SetProperty, -1 /* 4 or 5 */, 1) \
266  F(DefineOrRedefineDataProperty, 4, 1) \
267  F(DefineOrRedefineAccessorProperty, 5, 1) \
268  F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */, 1) \
269  \
270  /* Arrays */ \
271  F(RemoveArrayHoles, 2, 1) \
272  F(GetArrayKeys, 2, 1) \
273  F(MoveArrayContents, 2, 1) \
274  F(EstimateNumberOfElements, 1, 1) \
275  \
276  /* Getters and Setters */ \
277  F(LookupAccessor, 3, 1) \
278  \
279  /* Literals */ \
280  F(MaterializeRegExpLiteral, 4, 1)\
281  F(CreateObjectLiteral, 4, 1) \
282  F(CreateObjectLiteralShallow, 4, 1) \
283  F(CreateArrayLiteral, 3, 1) \
284  F(CreateArrayLiteralShallow, 3, 1) \
285  \
286  /* Harmony proxies */ \
287  F(CreateJSProxy, 2, 1) \
288  F(CreateJSFunctionProxy, 4, 1) \
289  F(IsJSProxy, 1, 1) \
290  F(IsJSFunctionProxy, 1, 1) \
291  F(GetHandler, 1, 1) \
292  F(GetCallTrap, 1, 1) \
293  F(GetConstructTrap, 1, 1) \
294  F(Fix, 1, 1) \
295  \
296  /* Harmony sets */ \
297  F(SetInitialize, 1, 1) \
298  F(SetAdd, 2, 1) \
299  F(SetHas, 2, 1) \
300  F(SetDelete, 2, 1) \
301  \
302  /* Harmony maps */ \
303  F(MapInitialize, 1, 1) \
304  F(MapGet, 2, 1) \
305  F(MapSet, 3, 1) \
306  \
307  /* Harmony weakmaps */ \
308  F(WeakMapInitialize, 1, 1) \
309  F(WeakMapGet, 2, 1) \
310  F(WeakMapSet, 3, 1) \
311  \
312  /* Statements */ \
313  F(NewClosure, 3, 1) \
314  F(NewObject, 1, 1) \
315  F(NewObjectFromBound, 1, 1) \
316  F(FinalizeInstanceSize, 1, 1) \
317  F(Throw, 1, 1) \
318  F(ReThrow, 1, 1) \
319  F(ThrowReferenceError, 1, 1) \
320  F(StackGuard, 0, 1) \
321  F(Interrupt, 0, 1) \
322  F(PromoteScheduledException, 0, 1) \
323  \
324  /* Contexts */ \
325  F(NewFunctionContext, 1, 1) \
326  F(PushWithContext, 2, 1) \
327  F(PushCatchContext, 3, 1) \
328  F(PushBlockContext, 2, 1) \
329  F(PushModuleContext, 2, 1) \
330  F(DeleteContextSlot, 2, 1) \
331  F(LoadContextSlot, 2, 2) \
332  F(LoadContextSlotNoReferenceError, 2, 2) \
333  F(StoreContextSlot, 4, 1) \
334  \
335  /* Declarations and initialization */ \
336  F(DeclareGlobals, 3, 1) \
337  F(DeclareContextSlot, 4, 1) \
338  F(InitializeVarGlobal, -1 /* 2 or 3 */, 1) \
339  F(InitializeConstGlobal, 2, 1) \
340  F(InitializeConstContextSlot, 3, 1) \
341  F(OptimizeObjectForAddingMultipleProperties, 2, 1) \
342  \
343  /* Debugging */ \
344  F(DebugPrint, 1, 1) \
345  F(DebugTrace, 0, 1) \
346  F(TraceEnter, 0, 1) \
347  F(TraceExit, 1, 1) \
348  F(Abort, 2, 1) \
349  /* Logging */ \
350  F(Log, 2, 1) \
351  /* ES5 */ \
352  F(LocalKeys, 1, 1) \
353  /* Cache suport */ \
354  F(GetFromCache, 2, 1) \
355  \
356  /* Message objects */ \
357  F(NewMessageObject, 2, 1) \
358  F(MessageGetType, 1, 1) \
359  F(MessageGetArguments, 1, 1) \
360  F(MessageGetStartPosition, 1, 1) \
361  F(MessageGetScript, 1, 1) \
362  \
363  /* Pseudo functions - handled as macros by parser */ \
364  F(IS_VAR, 1, 1) \
365  \
366  /* expose boolean functions from objects-inl.h */ \
367  F(HasFastSmiElements, 1, 1) \
368  F(HasFastSmiOrObjectElements, 1, 1) \
369  F(HasFastObjectElements, 1, 1) \
370  F(HasFastDoubleElements, 1, 1) \
371  F(HasFastHoleyElements, 1, 1) \
372  F(HasDictionaryElements, 1, 1) \
373  F(HasExternalPixelElements, 1, 1) \
374  F(HasExternalArrayElements, 1, 1) \
375  F(HasExternalByteElements, 1, 1) \
376  F(HasExternalUnsignedByteElements, 1, 1) \
377  F(HasExternalShortElements, 1, 1) \
378  F(HasExternalUnsignedShortElements, 1, 1) \
379  F(HasExternalIntElements, 1, 1) \
380  F(HasExternalUnsignedIntElements, 1, 1) \
381  F(HasExternalFloatElements, 1, 1) \
382  F(HasExternalDoubleElements, 1, 1) \
383  F(HasFastProperties, 1, 1) \
384  F(TransitionElementsSmiToDouble, 1, 1) \
385  F(TransitionElementsDoubleToObject, 1, 1) \
386  F(HaveSameMap, 2, 1) \
387  /* profiler */ \
388  F(ProfilerResume, 0, 1) \
389  F(ProfilerPause, 0, 1)
390 
391 
392 #ifdef ENABLE_DEBUGGER_SUPPORT
393 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \
394  /* Debugger support*/ \
395  F(DebugBreak, 0, 1) \
396  F(SetDebugEventListener, 2, 1) \
397  F(Break, 0, 1) \
398  F(DebugGetPropertyDetails, 2, 1) \
399  F(DebugGetProperty, 2, 1) \
400  F(DebugPropertyTypeFromDetails, 1, 1) \
401  F(DebugPropertyAttributesFromDetails, 1, 1) \
402  F(DebugPropertyIndexFromDetails, 1, 1) \
403  F(DebugNamedInterceptorPropertyValue, 2, 1) \
404  F(DebugIndexedInterceptorElementValue, 2, 1) \
405  F(CheckExecutionState, 1, 1) \
406  F(GetFrameCount, 1, 1) \
407  F(GetFrameDetails, 2, 1) \
408  F(GetScopeCount, 2, 1) \
409  F(GetScopeDetails, 4, 1) \
410  F(GetFunctionScopeCount, 1, 1) \
411  F(GetFunctionScopeDetails, 2, 1) \
412  F(DebugPrintScopes, 0, 1) \
413  F(GetThreadCount, 1, 1) \
414  F(GetThreadDetails, 2, 1) \
415  F(SetDisableBreak, 1, 1) \
416  F(GetBreakLocations, 1, 1) \
417  F(SetFunctionBreakPoint, 3, 1) \
418  F(SetScriptBreakPoint, 3, 1) \
419  F(ClearBreakPoint, 1, 1) \
420  F(ChangeBreakOnException, 2, 1) \
421  F(IsBreakOnException, 1, 1) \
422  F(PrepareStep, 3, 1) \
423  F(ClearStepping, 0, 1) \
424  F(DebugEvaluate, 6, 1) \
425  F(DebugEvaluateGlobal, 4, 1) \
426  F(DebugGetLoadedScripts, 0, 1) \
427  F(DebugReferencedBy, 3, 1) \
428  F(DebugConstructedBy, 2, 1) \
429  F(DebugGetPrototype, 1, 1) \
430  F(DebugSetScriptSource, 2, 1) \
431  F(SystemBreak, 0, 1) \
432  F(DebugDisassembleFunction, 1, 1) \
433  F(DebugDisassembleConstructor, 1, 1) \
434  F(FunctionGetInferredName, 1, 1) \
435  F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \
436  F(LiveEditGatherCompileInfo, 2, 1) \
437  F(LiveEditReplaceScript, 3, 1) \
438  F(LiveEditReplaceFunctionCode, 2, 1) \
439  F(LiveEditFunctionSourceUpdated, 1, 1) \
440  F(LiveEditFunctionSetScript, 2, 1) \
441  F(LiveEditReplaceRefToNestedFunction, 3, 1) \
442  F(LiveEditPatchFunctionPositions, 2, 1) \
443  F(LiveEditCheckAndDropActivations, 2, 1) \
444  F(LiveEditCompareStrings, 2, 1) \
445  F(GetFunctionCodePositionFromSource, 2, 1) \
446  F(ExecuteInDebugContext, 2, 1) \
447  \
448  F(SetFlags, 1, 1) \
449  F(CollectGarbage, 1, 1) \
450  F(GetHeapUsage, 0, 1) \
451  \
452  /* LiveObjectList support*/ \
453  F(HasLOLEnabled, 0, 1) \
454  F(CaptureLOL, 0, 1) \
455  F(DeleteLOL, 1, 1) \
456  F(DumpLOL, 5, 1) \
457  F(GetLOLObj, 1, 1) \
458  F(GetLOLObjId, 1, 1) \
459  F(GetLOLObjRetainers, 6, 1) \
460  F(GetLOLPath, 3, 1) \
461  F(InfoLOL, 2, 1) \
462  F(PrintLOLObj, 1, 1) \
463  F(ResetLOL, 0, 1) \
464  F(SummarizeLOL, 3, 1)
465 
466 #else
467 #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
468 #endif
469 
470 #ifdef DEBUG
471 #define RUNTIME_FUNCTION_LIST_DEBUG(F) \
472  /* Testing */ \
473  F(ListNatives, 0, 1)
474 #else
475 #define RUNTIME_FUNCTION_LIST_DEBUG(F)
476 #endif
477 
478 // ----------------------------------------------------------------------------
479 // RUNTIME_FUNCTION_LIST defines all runtime functions accessed
480 // either directly by id (via the code generator), or indirectly
481 // via a native call by name (from within JS code).
482 
483 #define RUNTIME_FUNCTION_LIST(F) \
484  RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \
485  RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \
486  RUNTIME_FUNCTION_LIST_DEBUG(F) \
487  RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F)
488 
489 // ----------------------------------------------------------------------------
490 // INLINE_FUNCTION_LIST defines all inlined functions accessed
491 // with a native call of the form %_name from within JS code.
492 // Entries have the form F(name, number of arguments, number of return values).
493 #define INLINE_FUNCTION_LIST(F) \
494  F(IsSmi, 1, 1) \
495  F(IsNonNegativeSmi, 1, 1) \
496  F(IsArray, 1, 1) \
497  F(IsRegExp, 1, 1) \
498  F(IsConstructCall, 0, 1) \
499  F(CallFunction, -1 /* receiver + n args + function */, 1) \
500  F(ArgumentsLength, 0, 1) \
501  F(Arguments, 1, 1) \
502  F(ValueOf, 1, 1) \
503  F(SetValueOf, 2, 1) \
504  F(DateField, 2 /* date object, field index */, 1) \
505  F(StringCharFromCode, 1, 1) \
506  F(StringCharAt, 2, 1) \
507  F(ObjectEquals, 2, 1) \
508  F(RandomHeapNumber, 0, 1) \
509  F(IsObject, 1, 1) \
510  F(IsFunction, 1, 1) \
511  F(IsUndetectableObject, 1, 1) \
512  F(IsSpecObject, 1, 1) \
513  F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \
514  F(MathPow, 2, 1) \
515  F(MathSin, 1, 1) \
516  F(MathCos, 1, 1) \
517  F(MathTan, 1, 1) \
518  F(MathSqrt, 1, 1) \
519  F(MathLog, 1, 1) \
520  F(IsRegExpEquivalent, 2, 1) \
521  F(HasCachedArrayIndex, 1, 1) \
522  F(GetCachedArrayIndex, 1, 1) \
523  F(FastAsciiArrayJoin, 2, 1)
524 
525 
526 // ----------------------------------------------------------------------------
527 // INLINE_AND_RUNTIME_FUNCTION_LIST defines all inlined functions accessed
528 // with a native call of the form %_name from within JS code that also have
529 // a corresponding runtime function, that is called for slow cases.
530 // Entries have the form F(name, number of arguments, number of return values).
531 #define INLINE_RUNTIME_FUNCTION_LIST(F) \
532  F(ClassOf, 1, 1) \
533  F(StringCharCodeAt, 2, 1) \
534  F(Log, 3, 1) \
535  F(StringAdd, 2, 1) \
536  F(SubString, 3, 1) \
537  F(StringCompare, 2, 1) \
538  F(RegExpExec, 4, 1) \
539  F(RegExpConstructResult, 3, 1) \
540  F(GetFromCache, 2, 1) \
541  F(NumberToString, 1, 1)
542 
543 
544 //---------------------------------------------------------------------------
545 // Runtime provides access to all C++ runtime functions.
546 
548  public:
550  return &string_input_buffer_;
551  }
553  return &to_upper_mapping_;
554  }
556  return &to_lower_mapping_;
557  }
559  return &string_input_buffer_compare_bufx_;
560  }
562  return &string_input_buffer_compare_bufy_;
563  }
565  return &string_locale_compare_buf1_;
566  }
568  return &string_locale_compare_buf2_;
569  }
570 
571  private:
572  RuntimeState() {}
573  // Non-reentrant string buffer for efficient general use in the runtime.
574  StaticResource<StringInputBuffer> string_input_buffer_;
577  StringInputBuffer string_input_buffer_compare_bufx_;
578  StringInputBuffer string_input_buffer_compare_bufy_;
579  StringInputBuffer string_locale_compare_buf1_;
580  StringInputBuffer string_locale_compare_buf2_;
581 
582  friend class Isolate;
583  friend class Runtime;
584 
586 };
587 
588 
589 class Runtime : public AllStatic {
590  public:
591  enum FunctionId {
592 #define F(name, nargs, ressize) k##name,
594 #undef F
595 #define F(name, nargs, ressize) kInline##name,
598 #undef F
600  kFirstInlineFunction = kInlineIsSmi
601  };
602 
606  };
607 
608  // Intrinsic function descriptor.
609  struct Function {
612  // The JS name of the function.
613  const char* name;
614 
615  // The C++ (native) entry point. NULL if the function is inlined.
617 
618  // The number of arguments expected. nargs is -1 if the function takes
619  // a variable number of arguments.
620  int nargs;
621  // Size of result. Most functions return a single pointer, size 1.
623  };
624 
625  static const int kNotFound = -1;
626 
627  // Add symbols for all the intrinsic function names to a StringDictionary.
628  // Returns failure if an allocation fails. In this case, it must be
629  // retried with a new, empty StringDictionary, not with the same one.
630  // Alternatively, heap initialization can be completely restarted.
632  Heap* heap, Object* dictionary);
633 
634  // Get the intrinsic function with the given name, which must be a symbol.
636 
637  // Get the intrinsic function with the given FunctionId.
638  static const Function* FunctionForId(FunctionId id);
639 
641  Handle<String> subject,
642  Handle<String> search,
643  Handle<String> replace,
644  bool* found,
645  int recursion_limit);
646 
647  // General-purpose helper functions for runtime system.
648  static int StringMatch(Isolate* isolate,
649  Handle<String> sub,
650  Handle<String> pat,
651  int index);
652 
653  static bool IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch);
654 
655  // TODO(1240886): Some of the following methods are *not* handle safe, but
656  // accept handle arguments. This seems fragile.
657 
658  // Support getting the characters in a string using [] notation as
659  // in Firefox/SpiderMonkey, Safari and Opera.
660  MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Isolate* isolate,
661  Handle<Object> object,
662  uint32_t index);
663 
664  MUST_USE_RESULT static MaybeObject* SetObjectProperty(
665  Isolate* isolate,
666  Handle<Object> object,
667  Handle<Object> key,
668  Handle<Object> value,
669  PropertyAttributes attr,
670  StrictModeFlag strict_mode);
671 
672  MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty(
673  Isolate* isolate,
674  Handle<JSObject> object,
675  Handle<Object> key,
676  Handle<Object> value,
677  PropertyAttributes attr);
678 
679  MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty(
680  Isolate* isolate,
681  Handle<JSReceiver> object,
682  Handle<Object> key);
683 
684  MUST_USE_RESULT static MaybeObject* GetObjectProperty(
685  Isolate* isolate,
686  Handle<Object> object,
687  Handle<Object> key);
688 
689  // This function is used in FunctionNameUsing* tests.
691  Handle<Script> script,
692  int position);
693 
694  // Helper functions used stubs.
695  static void PerformGC(Object* result);
696 
697  // Used in runtime.cc and hydrogen's VisitArrayLiteral.
699  Isolate* isolate,
700  Handle<FixedArray> literals,
701  Handle<FixedArray> elements);
702 };
703 
704 
705 //---------------------------------------------------------------------------
706 // Constants used by interface to runtime functions.
707 
708 class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {};
709 class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {};
710 class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {};
711 
712 } } // namespace v8::internal
713 
714 #endif // V8_RUNTIME_H_
static Object * FindSharedFunctionInfoInScript(Isolate *isolate, Handle< Script > script, int position)
#define INLINE_FUNCTION_LIST(F)
Definition: runtime.h:493
static const int kNotFound
Definition: runtime.h:625
static const Function * FunctionForSymbol(Handle< String > name)
Definition: runtime.cc:13565
static void PerformGC(Object *result)
Definition: runtime.cc:13582
value format" "after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false, "print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false, "print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false, "report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true, "garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true, "flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true, "use incremental marking") DEFINE_bool(incremental_marking_steps, true, "do incremental marking steps") DEFINE_bool(trace_incremental_marking, false, "trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true, "Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false, "Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true, "use inline caching") DEFINE_bool(native_code_counters, false, "generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false, "Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true, "Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false, "Never perform compaction on full GC-testing only") DEFINE_bool(compact_code_space, true, "Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true, "Flush inline caches prior to mark compact collection and" "flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0, "Default seed for initializing random generator" "(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true, "allows verbose printing") DEFINE_bool(allow_natives_syntax, false, "allow natives syntax") DEFINE_bool(trace_sim, false, "Trace simulator execution") DEFINE_bool(check_icache, false, "Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0, "Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8, "Stack alingment in bytes in simulator(4 or 8, 8 is default)") DEFINE_bool(trace_exception, false, "print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false, "preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true, "randomize hashes to avoid predictable hash collisions" "(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0, "Fixed seed to use to hash property keys(0 means random)" "(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false, "activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true, "generate optimized regexp code") DEFINE_bool(testing_bool_flag, true, "testing_bool_flag") DEFINE_int(testing_int_flag, 13, "testing_int_flag") DEFINE_float(testing_float_flag, 2.5, "float-flag") DEFINE_string(testing_string_flag, "Hello, world!", "string-flag") DEFINE_int(testing_prng_seed, 42, "Seed used for threading test randomness") DEFINE_string(testing_serialization_file, "/tmp/serdes", "file in which to serialize heap") DEFINE_bool(help, false, "Print usage message, including flags, on console") DEFINE_bool(dump_counters, false, "Dump counters on exit") DEFINE_string(map_counters, "", "Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT, "Pass all remaining arguments to the script.Alias for\"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#43"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2#define FLAG_MODE_DEFINE_DEFAULTS#1"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flag-definitions.h"1#define FLAG_FULL(ftype, ctype, nam, def, cmt)#define FLAG_READONLY(ftype, ctype, nam, def, cmt)#define DEFINE_implication(whenflag, thenflag)#define DEFINE_bool(nam, def, cmt)#define DEFINE_int(nam, def, cmt)#define DEFINE_float(nam, def, cmt)#define DEFINE_string(nam, def, cmt)#define DEFINE_args(nam, def, cmt)#define FLAG DEFINE_bool(use_strict, false,"enforce strict mode") DEFINE_bool(es5_readonly, false,"activate correct semantics for inheriting readonliness") DEFINE_bool(es52_globals, false,"activate new semantics for global var declarations") DEFINE_bool(harmony_typeof, false,"enable harmony semantics for typeof") DEFINE_bool(harmony_scoping, false,"enable harmony block scoping") DEFINE_bool(harmony_modules, false,"enable harmony modules (implies block scoping)") DEFINE_bool(harmony_proxies, false,"enable harmony proxies") DEFINE_bool(harmony_collections, false,"enable harmony collections (sets, maps, and weak maps)") DEFINE_bool(harmony, false,"enable all harmony features (except typeof)") DEFINE_implication(harmony, harmony_scoping) DEFINE_implication(harmony, harmony_modules) DEFINE_implication(harmony, harmony_proxies) DEFINE_implication(harmony, harmony_collections) DEFINE_implication(harmony_modules, harmony_scoping) DEFINE_bool(packed_arrays, false,"optimizes arrays that have no holes") DEFINE_bool(smi_only_arrays, true,"tracks arrays with only smi values") DEFINE_bool(clever_optimizations, true,"Optimize object size, Array shift, DOM strings and string +") DEFINE_bool(unbox_double_arrays, true,"automatically unbox arrays of doubles") DEFINE_bool(string_slices, true,"use string slices") DEFINE_bool(crankshaft, true,"use crankshaft") DEFINE_string(hydrogen_filter,"","optimization filter") DEFINE_bool(use_range, true,"use hydrogen range analysis") DEFINE_bool(eliminate_dead_phis, true,"eliminate dead phis") DEFINE_bool(use_gvn, true,"use hydrogen global value numbering") DEFINE_bool(use_canonicalizing, true,"use hydrogen instruction canonicalizing") DEFINE_bool(use_inlining, true,"use function inlining") DEFINE_int(max_inlined_source_size, 600,"maximum source size in bytes considered for a single inlining") DEFINE_int(max_inlined_nodes, 196,"maximum number of AST nodes considered for a single inlining") DEFINE_int(max_inlined_nodes_cumulative, 196,"maximum cumulative number of AST nodes considered for inlining") DEFINE_bool(loop_invariant_code_motion, true,"loop invariant code motion") DEFINE_bool(collect_megamorphic_maps_from_stub_cache, true,"crankshaft harvests type feedback from stub cache") DEFINE_bool(hydrogen_stats, false,"print statistics for hydrogen") DEFINE_bool(trace_hydrogen, false,"trace generated hydrogen to file") DEFINE_string(trace_phase,"Z","trace generated IR for specified phases") DEFINE_bool(trace_inlining, false,"trace inlining decisions") DEFINE_bool(trace_alloc, false,"trace register allocator") DEFINE_bool(trace_all_uses, false,"trace all use positions") DEFINE_bool(trace_range, false,"trace range analysis") DEFINE_bool(trace_gvn, false,"trace global value numbering") DEFINE_bool(trace_representation, false,"trace representation types") DEFINE_bool(stress_pointer_maps, false,"pointer map for every instruction") DEFINE_bool(stress_environments, false,"environment for every instruction") DEFINE_int(deopt_every_n_times, 0,"deoptimize every n times a deopt point is passed") DEFINE_bool(trap_on_deopt, false,"put a break point before deoptimizing") DEFINE_bool(deoptimize_uncommon_cases, true,"deoptimize uncommon cases") DEFINE_bool(polymorphic_inlining, true,"polymorphic inlining") DEFINE_bool(use_osr, true,"use on-stack replacement") DEFINE_bool(array_bounds_checks_elimination, false,"perform array bounds checks elimination") DEFINE_bool(array_index_dehoisting, false,"perform array index dehoisting") DEFINE_bool(trace_osr, false,"trace on-stack replacement") DEFINE_int(stress_runs, 0,"number of stress runs") DEFINE_bool(optimize_closures, true,"optimize closures") DEFINE_bool(inline_construct, true,"inline constructor calls") DEFINE_bool(inline_arguments, true,"inline functions with arguments object") DEFINE_int(loop_weight, 1,"loop weight for representation inference") DEFINE_bool(optimize_for_in, true,"optimize functions containing for-in loops") DEFINE_bool(experimental_profiler, true,"enable all profiler experiments") DEFINE_bool(watch_ic_patching, false,"profiler considers IC stability") DEFINE_int(frame_count, 1,"number of stack frames inspected by the profiler") DEFINE_bool(self_optimization, false,"primitive functions trigger their own optimization") DEFINE_bool(direct_self_opt, false,"call recompile stub directly when self-optimizing") DEFINE_bool(retry_self_opt, false,"re-try self-optimization if it failed") DEFINE_bool(count_based_interrupts, false,"trigger profiler ticks based on counting instead of timing") DEFINE_bool(interrupt_at_exit, false,"insert an interrupt check at function exit") DEFINE_bool(weighted_back_edges, false,"weight back edges by jump distance for interrupt triggering") DEFINE_int(interrupt_budget, 5900,"execution budget before interrupt is triggered") DEFINE_int(type_info_threshold, 15,"percentage of ICs that must have type info to allow optimization") DEFINE_int(self_opt_count, 130,"call count before self-optimization") DEFINE_implication(experimental_profiler, watch_ic_patching) DEFINE_implication(experimental_profiler, self_optimization) DEFINE_implication(experimental_profiler, retry_self_opt) DEFINE_implication(experimental_profiler, count_based_interrupts) DEFINE_implication(experimental_profiler, interrupt_at_exit) DEFINE_implication(experimental_profiler, weighted_back_edges) DEFINE_bool(trace_opt_verbose, false,"extra verbose compilation tracing") DEFINE_implication(trace_opt_verbose, trace_opt) DEFINE_bool(debug_code, false,"generate extra code (assertions) for debugging") DEFINE_bool(code_comments, false,"emit comments in code disassembly") DEFINE_bool(enable_sse2, true,"enable use of SSE2 instructions if available") DEFINE_bool(enable_sse3, true,"enable use of SSE3 instructions if available") DEFINE_bool(enable_sse4_1, true,"enable use of SSE4.1 instructions if available") DEFINE_bool(enable_cmov, true,"enable use of CMOV instruction if available") DEFINE_bool(enable_rdtsc, true,"enable use of RDTSC instruction if available") DEFINE_bool(enable_sahf, true,"enable use of SAHF instruction if available (X64 only)") DEFINE_bool(enable_vfp3, true,"enable use of VFP3 instructions if available - this implies ""enabling ARMv7 instructions (ARM only)") DEFINE_bool(enable_armv7, true,"enable use of ARMv7 instructions if available (ARM only)") DEFINE_bool(enable_fpu, true,"enable use of MIPS FPU instructions if available (MIPS only)") DEFINE_string(expose_natives_as, NULL,"expose natives in global object") DEFINE_string(expose_debug_as, NULL,"expose debug in global object") DEFINE_bool(expose_gc, false,"expose gc extension") DEFINE_bool(expose_externalize_string, false,"expose externalize string extension") DEFINE_int(stack_trace_limit, 10,"number of stack frames to capture") DEFINE_bool(builtins_in_stack_traces, false,"show built-in functions in stack traces") DEFINE_bool(disable_native_files, false,"disable builtin natives files") DEFINE_bool(inline_new, true,"use fast inline allocation") DEFINE_bool(stack_trace_on_abort, true,"print a stack trace if an assertion failure occurs") DEFINE_bool(trace, false,"trace function calls") DEFINE_bool(mask_constants_with_cookie, true,"use random jit cookie to mask large constants") DEFINE_bool(lazy, true,"use lazy compilation") DEFINE_bool(trace_opt, false,"trace lazy optimization") DEFINE_bool(trace_opt_stats, false,"trace lazy optimization statistics") DEFINE_bool(opt, true,"use adaptive optimizations") DEFINE_bool(always_opt, false,"always try to optimize functions") DEFINE_bool(prepare_always_opt, false,"prepare for turning on always opt") DEFINE_bool(trace_deopt, false,"trace deoptimization") DEFINE_int(min_preparse_length, 1024,"minimum length for automatic enable preparsing") DEFINE_bool(always_full_compiler, false,"try to use the dedicated run-once backend for all code") DEFINE_bool(trace_bailout, false,"print reasons for falling back to using the classic V8 backend") DEFINE_bool(compilation_cache, true,"enable compilation cache") DEFINE_bool(cache_prototype_transitions, true,"cache prototype transitions") DEFINE_bool(trace_debug_json, false,"trace debugging JSON request/response") DEFINE_bool(debugger_auto_break, true,"automatically set the debug break flag when debugger commands are ""in the queue") DEFINE_bool(enable_liveedit, true,"enable liveedit experimental feature") DEFINE_bool(break_on_abort, true,"always cause a debug break before aborting") DEFINE_int(stack_size, kPointerSize *123,"default size of stack region v8 is allowed to use (in kBytes)") DEFINE_int(max_stack_trace_source_length, 300,"maximum length of function source code printed in a stack trace.") DEFINE_bool(always_inline_smi_code, false,"always inline smi code in non-opt code") DEFINE_int(max_new_space_size, 0,"max size of the new generation (in kBytes)") DEFINE_int(max_old_space_size, 0,"max size of the old generation (in Mbytes)") DEFINE_int(max_executable_size, 0,"max size of executable memory (in Mbytes)") DEFINE_bool(gc_global, false,"always perform global GCs") DEFINE_int(gc_interval,-1,"garbage collect after <n> allocations") DEFINE_bool(trace_gc, false,"print one trace line following each garbage collection") DEFINE_bool(trace_gc_nvp, false,"print one detailed trace line in name=value format ""after each garbage collection") DEFINE_bool(print_cumulative_gc_stat, false,"print cumulative GC statistics in name=value format on exit") DEFINE_bool(trace_gc_verbose, false,"print more details following each garbage collection") DEFINE_bool(trace_fragmentation, false,"report fragmentation for old pointer and data pages") DEFINE_bool(collect_maps, true,"garbage collect maps from which no objects can be reached") DEFINE_bool(flush_code, true,"flush code that we expect not to use again before full gc") DEFINE_bool(incremental_marking, true,"use incremental marking") DEFINE_bool(incremental_marking_steps, true,"do incremental marking steps") DEFINE_bool(trace_incremental_marking, false,"trace progress of the incremental marking") DEFINE_bool(use_idle_notification, true,"Use idle notification to reduce memory footprint.") DEFINE_bool(send_idle_notification, false,"Send idle notifcation between stress runs.") DEFINE_bool(use_ic, true,"use inline caching") DEFINE_bool(native_code_counters, false,"generate extra code for manipulating stats counters") DEFINE_bool(always_compact, false,"Perform compaction on every full GC") DEFINE_bool(lazy_sweeping, true,"Use lazy sweeping for old pointer and data spaces") DEFINE_bool(never_compact, false,"Never perform compaction on full GC - testing only") DEFINE_bool(compact_code_space, true,"Compact code space on full non-incremental collections") DEFINE_bool(cleanup_code_caches_at_gc, true,"Flush inline caches prior to mark compact collection and ""flush code caches in maps during mark compact cycle.") DEFINE_int(random_seed, 0,"Default seed for initializing random generator ""(0, the default, means to use system random).") DEFINE_bool(use_verbose_printer, true,"allows verbose printing") DEFINE_bool(allow_natives_syntax, false,"allow natives syntax") DEFINE_bool(trace_sim, false,"Trace simulator execution") DEFINE_bool(check_icache, false,"Check icache flushes in ARM and MIPS simulator") DEFINE_int(stop_sim_at, 0,"Simulator stop after x number of instructions") DEFINE_int(sim_stack_alignment, 8,"Stack alingment in bytes in simulator (4 or 8, 8 is default)") DEFINE_bool(trace_exception, false,"print stack trace when throwing exceptions") DEFINE_bool(preallocate_message_memory, false,"preallocate some memory to build stack traces.") DEFINE_bool(randomize_hashes, true,"randomize hashes to avoid predictable hash collisions ""(with snapshots this option cannot override the baked-in seed)") DEFINE_int(hash_seed, 0,"Fixed seed to use to hash property keys (0 means random)""(with snapshots this option cannot override the baked-in seed)") DEFINE_bool(preemption, false,"activate a 100ms timer that switches between V8 threads") DEFINE_bool(regexp_optimization, true,"generate optimized regexp code") DEFINE_bool(testing_bool_flag, true,"testing_bool_flag") DEFINE_int(testing_int_flag, 13,"testing_int_flag") DEFINE_float(testing_float_flag, 2.5,"float-flag") DEFINE_string(testing_string_flag,"Hello, world!","string-flag") DEFINE_int(testing_prng_seed, 42,"Seed used for threading test randomness") DEFINE_string(testing_serialization_file,"/tmp/serdes","file in which to serialize heap") DEFINE_bool(help, false,"Print usage message, including flags, on console") DEFINE_bool(dump_counters, false,"Dump counters on exit") DEFINE_string(map_counters,"","Map counters to a file") DEFINE_args(js_arguments, JSARGUMENTS_INIT,"Pass all remaining arguments to the script. Alias for \"--\".") DEFINE_bool(debug_compile_events, true,"Enable debugger compile events") DEFINE_bool(debug_script_collected_events, true,"Enable debugger script collected events") DEFINE_bool(gdbjit, false,"enable GDBJIT interface (disables compacting GC)") DEFINE_bool(gdbjit_full, false,"enable GDBJIT interface for all code objects") DEFINE_bool(gdbjit_dump, false,"dump elf objects with debug info to disk") DEFINE_string(gdbjit_dump_filter,"","dump only objects containing this substring") DEFINE_bool(force_marking_deque_overflows, false,"force overflows of marking deque by reducing it's size ""to 64 words") DEFINE_bool(stress_compaction, false,"stress the GC compactor to flush out bugs (implies ""--force_marking_deque_overflows)")#define FLAG DEFINE_bool(enable_slow_asserts, false,"enable asserts that are slow to execute") DEFINE_bool(trace_codegen, false,"print name of functions for which code is generated") DEFINE_bool(print_source, false,"pretty print source code") DEFINE_bool(print_builtin_source, false,"pretty print source code for builtins") DEFINE_bool(print_ast, false,"print source AST") DEFINE_bool(print_builtin_ast, false,"print source AST for builtins") DEFINE_string(stop_at,"","function name where to insert a breakpoint") DEFINE_bool(print_builtin_scopes, false,"print scopes for builtins") DEFINE_bool(print_scopes, false,"print scopes") DEFINE_bool(trace_contexts, false,"trace contexts operations") DEFINE_bool(gc_greedy, false,"perform GC prior to some allocations") DEFINE_bool(gc_verbose, false,"print stuff during garbage collection") DEFINE_bool(heap_stats, false,"report heap statistics before and after GC") DEFINE_bool(code_stats, false,"report code statistics after GC") DEFINE_bool(verify_heap, false,"verify heap pointers before and after GC") DEFINE_bool(print_handles, false,"report handles after GC") DEFINE_bool(print_global_handles, false,"report global handles after GC") DEFINE_bool(trace_ic, false,"trace inline cache state transitions") DEFINE_bool(print_interfaces, false,"print interfaces") DEFINE_bool(print_interface_details, false,"print interface inference details") DEFINE_int(print_interface_depth, 5,"depth for printing interfaces") DEFINE_bool(trace_normalization, false,"prints when objects are turned into dictionaries.") DEFINE_bool(trace_lazy, false,"trace lazy compilation") DEFINE_bool(collect_heap_spill_statistics, false,"report heap spill statistics along with heap_stats ""(requires heap_stats)") DEFINE_bool(trace_isolates, false,"trace isolate state changes") DEFINE_bool(log_state_changes, false,"Log state changes.") DEFINE_bool(regexp_possessive_quantifier, false,"enable possessive quantifier syntax for testing") DEFINE_bool(trace_regexp_bytecodes, false,"trace regexp bytecode execution") DEFINE_bool(trace_regexp_assembler, false,"trace regexp macro assembler calls.")#define FLAG DEFINE_bool(log, false,"Minimal logging (no API, code, GC, suspect, or handles samples).") DEFINE_bool(log_all, false,"Log all events to the log file.") DEFINE_bool(log_runtime, false,"Activate runtime system %Log call.") DEFINE_bool(log_api, false,"Log API events to the log file.") DEFINE_bool(log_code, false,"Log code events to the log file without profiling.") DEFINE_bool(log_gc, false,"Log heap samples on garbage collection for the hp2ps tool.") DEFINE_bool(log_handles, false,"Log global handle events.") DEFINE_bool(log_snapshot_positions, false,"log positions of (de)serialized objects in the snapshot.") DEFINE_bool(log_suspect, false,"Log suspect operations.") DEFINE_bool(prof, false,"Log statistical profiling information (implies --log-code).") DEFINE_bool(prof_auto, true,"Used with --prof, starts profiling automatically") DEFINE_bool(prof_lazy, false,"Used with --prof, only does sampling and logging"" when profiler is active (implies --noprof_auto).") DEFINE_bool(prof_browser_mode, true,"Used with --prof, turns on browser-compatible mode for profiling.") DEFINE_bool(log_regexp, false,"Log regular expression execution.") DEFINE_bool(sliding_state_window, false,"Update sliding state window counters.") DEFINE_string(logfile,"v8.log","Specify the name of the log file.") DEFINE_bool(ll_prof, false,"Enable low-level linux profiler.")#define FLAG DEFINE_bool(trace_elements_transitions, false,"trace elements transitions") DEFINE_bool(print_code_stubs, false,"print code stubs") DEFINE_bool(test_secondary_stub_cache, false,"test secondary stub cache by disabling the primary one") DEFINE_bool(test_primary_stub_cache, false,"test primary stub cache by disabling the secondary one") DEFINE_bool(print_code, false,"print generated code") DEFINE_bool(print_opt_code, false,"print optimized code") DEFINE_bool(print_unopt_code, false,"print unoptimized code before ""printing optimized code based on it") DEFINE_bool(print_code_verbose, false,"print more information for code") DEFINE_bool(print_builtin_code, false,"print generated code for builtins")#47"/Users/thlorenz/dev/dx/v8-perf/build/v8/src/flags.cc"2 namespace{struct Flag{enum FlagType{TYPE_BOOL, TYPE_INT, TYPE_FLOAT, TYPE_STRING, TYPE_ARGS} name
Definition: flags.cc:1349
static MUST_USE_RESULT MaybeObject * ForceDeleteObjectProperty(Isolate *isolate, Handle< JSReceiver > object, Handle< Object > key)
Definition: runtime.cc:4675
static MUST_USE_RESULT MaybeObject * SetObjectProperty(Isolate *isolate, Handle< Object > object, Handle< Object > key, Handle< Object > value, PropertyAttributes attr, StrictModeFlag strict_mode)
Definition: runtime.cc:4540
static const Function * FunctionForId(FunctionId id)
Definition: runtime.cc:13577
unsigned short uint16_t
Definition: unicode.cc:46
StringInputBuffer * string_input_buffer_compare_bufy()
Definition: runtime.h:561
PropertyAttributes
#define RUNTIME_FUNCTION_LIST(F)
Definition: runtime.h:483
static MUST_USE_RESULT MaybeObject * InitializeIntrinsicFunctionNames(Heap *heap, Object *dictionary)
Definition: runtime.cc:13538
uint8_t byte
Definition: globals.h:171
static Handle< String > StringReplaceOneCharWithString(Isolate *isolate, Handle< String > subject, Handle< String > search, Handle< String > replace, bool *found, int recursion_limit)
Definition: runtime.cc:3417
StringInputBuffer * string_locale_compare_buf2()
Definition: runtime.h:567
#define MUST_USE_RESULT
Definition: globals.h:360
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: globals.h:321
IntrinsicType intrinsic_type
Definition: runtime.h:611
unibrow::Mapping< unibrow::ToUppercase, 128 > * to_upper_mapping()
Definition: runtime.h:552
static int StringMatch(Isolate *isolate, Handle< String > sub, Handle< String > pat, int index)
Definition: runtime.cc:3493
static bool IsUpperCaseChar(RuntimeState *runtime_state, uint16_t ch)
Definition: runtime.cc:6616
static Handle< Object > CreateArrayLiteralBoilerplate(Isolate *isolate, Handle< FixedArray > literals, Handle< FixedArray > elements)
Definition: runtime.cc:461
StringInputBuffer * string_input_buffer_compare_bufx()
Definition: runtime.h:558
static MUST_USE_RESULT MaybeObject * GetObjectProperty(Isolate *isolate, Handle< Object > object, Handle< Object > key)
Definition: runtime.cc:4288
static MUST_USE_RESULT MaybeObject * ForceSetObjectProperty(Isolate *isolate, Handle< JSObject > object, Handle< Object > key, Handle< Object > value, PropertyAttributes attr)
Definition: runtime.cc:4622
StaticResource< StringInputBuffer > * string_input_buffer()
Definition: runtime.h:549
unibrow::Mapping< unibrow::ToLowercase, 128 > * to_lower_mapping()
Definition: runtime.h:555
#define INLINE_RUNTIME_FUNCTION_LIST(F)
Definition: runtime.h:531
StringInputBuffer * string_locale_compare_buf1()
Definition: runtime.h:564
static MUST_USE_RESULT MaybeObject * GetElementOrCharAt(Isolate *isolate, Handle< Object > object, uint32_t index)
Definition: runtime.cc:4263