yangguo@chromium.org | 5645471 | 2012-02-16 15:33:53 +0000 | [diff] [blame] | 1 | // Copyright 2012 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 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 | |
lrn@chromium.org | 1c09276 | 2011-05-09 09:42:16 +0000 | [diff] [blame] | 31 | #include "allocation.h" |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 32 | #include "zone.h" |
| 33 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 34 | namespace v8 { |
| 35 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 36 | |
| 37 | // The interface to C++ runtime functions. |
| 38 | |
| 39 | // ---------------------------------------------------------------------------- |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 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. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 43 | |
ager@chromium.org | ce58e17 | 2009-05-13 07:11:48 +0000 | [diff] [blame] | 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) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 48 | /* Property access */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 49 | F(GetProperty, 2, 1) \ |
| 50 | F(KeyedGetProperty, 2, 1) \ |
kmillikin@chromium.org | 49edbdf | 2011-02-16 12:32:18 +0000 | [diff] [blame] | 51 | F(DeleteProperty, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 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) \ |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 58 | F(GetLocalPropertyNames, 2, 1) \ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 59 | F(GetLocalElementNames, 1, 1) \ |
| 60 | F(GetInterceptorInfo, 1, 1) \ |
| 61 | F(GetNamedInterceptorPropertyNames, 1, 1) \ |
| 62 | F(GetIndexedInterceptorElementNames, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 63 | F(GetArgumentsProperty, 1, 1) \ |
| 64 | F(ToFastProperties, 1, 1) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 65 | F(FinishArrayPrototypeSetup, 1, 1) \ |
vegorov@chromium.org | f837290 | 2010-03-15 10:26:20 +0000 | [diff] [blame] | 66 | F(SpecialArrayFunctions, 1, 1) \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 67 | F(IsClassicModeFunction, 1, 1) \ |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 68 | F(GetDefaultReceiver, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 69 | \ |
erik.corry@gmail.com | d6076d9 | 2011-06-06 09:39:18 +0000 | [diff] [blame] | 70 | F(GetPrototype, 1, 1) \ |
ulan@chromium.org | 750145a | 2013-03-07 15:14:13 +0000 | [diff] [blame] | 71 | F(SetPrototype, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 72 | F(IsInPrototypeChain, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 73 | \ |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 74 | F(GetOwnProperty, 2, 1) \ |
| 75 | \ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 76 | F(IsExtensible, 1, 1) \ |
kmillikin@chromium.org | 69ea396 | 2010-07-05 11:01:40 +0000 | [diff] [blame] | 77 | F(PreventExtensions, 1, 1)\ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 78 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 79 | /* Utilities */ \ |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 80 | F(CheckIsBootstrapping, 0, 1) \ |
mstarzinger@chromium.org | 88d326b | 2012-04-23 12:57:22 +0000 | [diff] [blame] | 81 | F(GetRootNaN, 0, 1) \ |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 82 | F(Call, -1 /* >= 2 */, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 83 | F(Apply, 5, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 84 | F(GetFunctionDelegate, 1, 1) \ |
| 85 | F(GetConstructorDelegate, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 86 | F(NewArgumentsFast, 3, 1) \ |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 87 | F(NewStrictArgumentsFast, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 88 | F(LazyCompile, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 89 | F(LazyRecompile, 1, 1) \ |
rossberg@chromium.org | 9259716 | 2013-08-23 13:28:00 +0000 | [diff] [blame] | 90 | F(ConcurrentRecompile, 1, 1) \ |
dslomov@chromium.org | 4a35c5a | 2013-09-13 07:28:52 +0000 | [diff] [blame] | 91 | F(TryInstallRecompiledCode, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 92 | F(NotifyDeoptimized, 1, 1) \ |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 93 | F(NotifyStubFailure, 0, 1) \ |
ager@chromium.org | a9aa5fa | 2011-04-13 08:46:07 +0000 | [diff] [blame] | 94 | F(DeoptimizeFunction, 1, 1) \ |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 95 | F(ClearFunctionTypeFeedback, 1, 1) \ |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 96 | F(RunningInSimulator, 0, 1) \ |
rossberg@chromium.org | 9259716 | 2013-08-23 13:28:00 +0000 | [diff] [blame] | 97 | F(IsConcurrentRecompilationSupported, 0, 1) \ |
kmillikin@chromium.org | be6bd10 | 2012-02-23 08:45:21 +0000 | [diff] [blame] | 98 | F(OptimizeFunctionOnNextCall, -1, 1) \ |
jkummerow@chromium.org | ba72ec8 | 2013-07-22 09:21:20 +0000 | [diff] [blame] | 99 | F(NeverOptimizeFunction, 1, 1) \ |
| 100 | F(GetOptimizationStatus, -1, 1) \ |
lrn@chromium.org | 1c09276 | 2011-05-09 09:42:16 +0000 | [diff] [blame] | 101 | F(GetOptimizationCount, 1, 1) \ |
mstarzinger@chromium.org | a2e1a40 | 2013-10-15 08:25:05 +0000 | [diff] [blame] | 102 | F(UnblockConcurrentRecompilation, 0, 1) \ |
dslomov@chromium.org | e97852d | 2013-09-12 09:02:59 +0000 | [diff] [blame] | 103 | F(CompileForOnStackReplacement, 2, 1) \ |
rossberg@chromium.org | ebeba02 | 2013-08-19 09:36:44 +0000 | [diff] [blame] | 104 | F(SetAllocationTimeout, 2, 1) \ |
lrn@chromium.org | c4e51ac | 2010-08-09 09:47:21 +0000 | [diff] [blame] | 105 | F(AllocateInNewSpace, 1, 1) \ |
svenpanne@chromium.org | 2bda543 | 2013-03-15 12:39:50 +0000 | [diff] [blame] | 106 | F(AllocateInOldPointerSpace, 1, 1) \ |
jkummerow@chromium.org | c118402 | 2013-05-28 16:58:15 +0000 | [diff] [blame] | 107 | F(AllocateInOldDataSpace, 1, 1) \ |
ricow@chromium.org | d2be901 | 2011-06-01 06:00:58 +0000 | [diff] [blame] | 108 | F(SetNativeFlag, 1, 1) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 109 | F(StoreArrayLiteralElement, 5, 1) \ |
mstarzinger@chromium.org | 88d326b | 2012-04-23 12:57:22 +0000 | [diff] [blame] | 110 | F(DebugCallbackSupportsStepping, 1, 1) \ |
| 111 | F(DebugPrepareStepInIfStepping, 1, 1) \ |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 112 | F(FlattenString, 1, 1) \ |
danno@chromium.org | 5940060 | 2013-08-13 17:09:37 +0000 | [diff] [blame] | 113 | F(MigrateInstance, 1, 1) \ |
verwaest@chromium.org | ec6855e | 2013-08-22 12:26:58 +0000 | [diff] [blame] | 114 | F(NotifyContextDisposed, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 115 | \ |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 116 | /* Array join support */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 117 | F(PushIfAbsent, 2, 1) \ |
| 118 | F(ArrayConcat, 1, 1) \ |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 119 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 120 | /* Conversions */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 121 | F(ToBool, 1, 1) \ |
| 122 | F(Typeof, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 123 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 124 | F(StringToNumber, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 125 | F(StringParseInt, 2, 1) \ |
| 126 | F(StringParseFloat, 1, 1) \ |
| 127 | F(StringToLowerCase, 1, 1) \ |
| 128 | F(StringToUpperCase, 1, 1) \ |
fschneider@chromium.org | 086aac6 | 2010-03-17 13:18:24 +0000 | [diff] [blame] | 129 | F(StringSplit, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 130 | F(CharFromCode, 1, 1) \ |
| 131 | F(URIEscape, 1, 1) \ |
| 132 | F(URIUnescape, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 133 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 134 | F(NumberToString, 1, 1) \ |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 135 | F(NumberToStringSkipCache, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 136 | F(NumberToInteger, 1, 1) \ |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 137 | F(NumberToPositiveInteger, 1, 1) \ |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 138 | F(NumberToIntegerMapMinusZero, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 139 | F(NumberToJSUint32, 1, 1) \ |
| 140 | F(NumberToJSInt32, 1, 1) \ |
| 141 | F(NumberToSmi, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 142 | F(AllocateHeapNumber, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 143 | \ |
| 144 | /* Arithmetic operations */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 145 | F(NumberAdd, 2, 1) \ |
| 146 | F(NumberSub, 2, 1) \ |
| 147 | F(NumberMul, 2, 1) \ |
| 148 | F(NumberDiv, 2, 1) \ |
| 149 | F(NumberMod, 2, 1) \ |
| 150 | F(NumberUnaryMinus, 1, 1) \ |
ager@chromium.org | 6a2b0aa | 2010-07-13 20:58:03 +0000 | [diff] [blame] | 151 | F(NumberAlloc, 0, 1) \ |
danno@chromium.org | ca29dd8 | 2013-04-26 11:59:48 +0000 | [diff] [blame] | 152 | F(NumberImul, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 153 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 154 | F(StringAdd, 2, 1) \ |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 155 | F(StringBuilderConcat, 3, 1) \ |
kmillikin@chromium.org | 49edbdf | 2011-02-16 12:32:18 +0000 | [diff] [blame] | 156 | F(StringBuilderJoin, 3, 1) \ |
ricow@chromium.org | 27bf288 | 2011-11-17 08:34:43 +0000 | [diff] [blame] | 157 | F(SparseJoinWithSeparator, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 158 | \ |
| 159 | /* Bit operations */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 160 | F(NumberOr, 2, 1) \ |
| 161 | F(NumberAnd, 2, 1) \ |
| 162 | F(NumberXor, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 163 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 164 | F(NumberShl, 2, 1) \ |
| 165 | F(NumberShr, 2, 1) \ |
| 166 | F(NumberSar, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 167 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 168 | /* Comparisons */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 169 | F(NumberEquals, 2, 1) \ |
| 170 | F(StringEquals, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 171 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 172 | F(NumberCompare, 3, 1) \ |
| 173 | F(SmiLexicographicCompare, 2, 1) \ |
| 174 | F(StringCompare, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 175 | \ |
| 176 | /* Math */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 177 | F(Math_acos, 1, 1) \ |
| 178 | F(Math_asin, 1, 1) \ |
| 179 | F(Math_atan, 1, 1) \ |
| 180 | F(Math_atan2, 2, 1) \ |
| 181 | F(Math_ceil, 1, 1) \ |
| 182 | F(Math_cos, 1, 1) \ |
| 183 | F(Math_exp, 1, 1) \ |
| 184 | F(Math_floor, 1, 1) \ |
| 185 | F(Math_log, 1, 1) \ |
| 186 | F(Math_pow, 2, 1) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 187 | F(Math_pow_cfunction, 2, 1) \ |
whesse@chromium.org | cec079d | 2010-03-22 14:44:04 +0000 | [diff] [blame] | 188 | F(RoundNumber, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 189 | F(Math_sin, 1, 1) \ |
| 190 | F(Math_sqrt, 1, 1) \ |
| 191 | F(Math_tan, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 192 | \ |
| 193 | /* Regular expressions */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 194 | F(RegExpCompile, 3, 1) \ |
| 195 | F(RegExpExec, 4, 1) \ |
lrn@chromium.org | 25156de | 2010-04-06 13:10:27 +0000 | [diff] [blame] | 196 | F(RegExpExecMultiple, 4, 1) \ |
| 197 | F(RegExpInitializeObject, 5, 1) \ |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 198 | F(RegExpConstructResult, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 199 | \ |
fschneider@chromium.org | e03fb64 | 2010-11-01 12:34:09 +0000 | [diff] [blame] | 200 | /* JSON */ \ |
| 201 | F(ParseJson, 1, 1) \ |
mstarzinger@chromium.org | 32280cf | 2012-12-06 17:32:37 +0000 | [diff] [blame] | 202 | F(BasicJSONStringify, 1, 1) \ |
| 203 | F(QuoteJSONString, 1, 1) \ |
fschneider@chromium.org | e03fb64 | 2010-11-01 12:34:09 +0000 | [diff] [blame] | 204 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 205 | /* Strings */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 206 | F(StringCharCodeAt, 2, 1) \ |
| 207 | F(StringIndexOf, 3, 1) \ |
| 208 | F(StringLastIndexOf, 3, 1) \ |
| 209 | F(StringLocaleCompare, 2, 1) \ |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 210 | F(SubString, 3, 1) \ |
hpayer@chromium.org | 8432c91 | 2013-02-28 15:55:26 +0000 | [diff] [blame] | 211 | F(StringReplaceGlobalRegExpWithString, 4, 1) \ |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 212 | F(StringReplaceOneCharWithString, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 213 | F(StringMatch, 3, 1) \ |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 214 | F(StringTrim, 3, 1) \ |
ager@chromium.org | beb2571 | 2010-11-29 08:02:25 +0000 | [diff] [blame] | 215 | F(StringToArray, 2, 1) \ |
ricow@chromium.org | d236f4d | 2010-09-01 06:52:08 +0000 | [diff] [blame] | 216 | F(NewStringWrapper, 1, 1) \ |
mstarzinger@chromium.org | 32280cf | 2012-12-06 17:32:37 +0000 | [diff] [blame] | 217 | F(NewString, 2, 1) \ |
| 218 | F(TruncateString, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 219 | \ |
| 220 | /* Numbers */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 221 | F(NumberToRadixString, 2, 1) \ |
| 222 | F(NumberToFixed, 2, 1) \ |
| 223 | F(NumberToExponential, 2, 1) \ |
verwaest@chromium.org | 662436e | 2013-08-28 08:41:27 +0000 | [diff] [blame] | 224 | F(NumberToPrecision, 2, 1) \ |
| 225 | F(IsValidSmi, 1, 1) |
ager@chromium.org | ce58e17 | 2009-05-13 07:11:48 +0000 | [diff] [blame] | 226 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 227 | |
ager@chromium.org | ce58e17 | 2009-05-13 07:11:48 +0000 | [diff] [blame] | 228 | #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 229 | /* Reflection */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 230 | F(FunctionSetInstanceClassName, 2, 1) \ |
| 231 | F(FunctionSetLength, 2, 1) \ |
| 232 | F(FunctionSetPrototype, 2, 1) \ |
ricow@chromium.org | 2c99e28 | 2011-07-28 09:15:17 +0000 | [diff] [blame] | 233 | F(FunctionSetReadOnlyPrototype, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 234 | F(FunctionGetName, 1, 1) \ |
| 235 | F(FunctionSetName, 2, 1) \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 236 | F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ |
| 237 | F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ |
ulan@chromium.org | 57ff881 | 2013-05-10 08:16:55 +0000 | [diff] [blame] | 238 | F(FunctionIsGenerator, 1, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 239 | F(FunctionBindArguments, 4, 1) \ |
| 240 | F(BoundFunctionGetBindings, 1, 1) \ |
kmillikin@chromium.org | 4111b80 | 2010-05-03 10:34:42 +0000 | [diff] [blame] | 241 | F(FunctionRemovePrototype, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 242 | F(FunctionGetSourceCode, 1, 1) \ |
| 243 | F(FunctionGetScript, 1, 1) \ |
| 244 | F(FunctionGetScriptSourcePosition, 1, 1) \ |
| 245 | F(FunctionGetPositionForOffset, 2, 1) \ |
| 246 | F(FunctionIsAPIFunction, 1, 1) \ |
christian.plesner.hansen@gmail.com | 2bc58ef | 2009-09-22 10:00:30 +0000 | [diff] [blame] | 247 | F(FunctionIsBuiltin, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 248 | F(GetScript, 1, 1) \ |
jkummerow@chromium.org | ab7dad4 | 2012-02-07 12:07:34 +0000 | [diff] [blame] | 249 | F(CollectStackTrace, 3, 1) \ |
jkummerow@chromium.org | fb732b1 | 2013-07-26 10:27:09 +0000 | [diff] [blame] | 250 | F(GetAndClearOverflowedStackTrace, 1, 1) \ |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 251 | F(GetV8Version, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 252 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 253 | F(ClassOf, 1, 1) \ |
| 254 | F(SetCode, 2, 1) \ |
ricow@chromium.org | d236f4d | 2010-09-01 06:52:08 +0000 | [diff] [blame] | 255 | F(SetExpectedNumberOfProperties, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 256 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 257 | F(CreateApiFunction, 1, 1) \ |
| 258 | F(IsTemplate, 1, 1) \ |
| 259 | F(GetTemplateField, 2, 1) \ |
| 260 | F(DisableAccessChecks, 1, 1) \ |
| 261 | F(EnableAccessChecks, 1, 1) \ |
jkummerow@chromium.org | 1e8da74 | 2013-08-26 17:13:35 +0000 | [diff] [blame] | 262 | F(SetAccessorProperty, 6, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 263 | \ |
| 264 | /* Dates */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 265 | F(DateCurrentTime, 0, 1) \ |
| 266 | F(DateParseString, 2, 1) \ |
| 267 | F(DateLocalTimezone, 1, 1) \ |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 268 | F(DateToUTC, 1, 1) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 269 | F(DateMakeDay, 2, 1) \ |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 270 | F(DateSetValue, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 271 | \ |
| 272 | /* Numbers */ \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 273 | \ |
| 274 | /* Globals */ \ |
svenpanne@chromium.org | 9faefa4 | 2013-03-08 13:13:16 +0000 | [diff] [blame] | 275 | F(CompileString, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 276 | F(GlobalPrint, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 277 | \ |
| 278 | /* Eval */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 279 | F(GlobalReceiver, 1, 1) \ |
jkummerow@chromium.org | 04e4f1e | 2011-11-14 13:36:17 +0000 | [diff] [blame] | 280 | F(ResolvePossiblyDirectEval, 5, 2) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 281 | \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 282 | F(SetProperty, -1 /* 4 or 5 */, 1) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 283 | F(DefineOrRedefineDataProperty, 4, 1) \ |
| 284 | F(DefineOrRedefineAccessorProperty, 5, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 285 | F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */, 1) \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 286 | F(GetDataProperty, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 287 | \ |
| 288 | /* Arrays */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 289 | F(RemoveArrayHoles, 2, 1) \ |
| 290 | F(GetArrayKeys, 2, 1) \ |
| 291 | F(MoveArrayContents, 2, 1) \ |
| 292 | F(EstimateNumberOfElements, 1, 1) \ |
ulan@chromium.org | dfe5307 | 2013-06-06 14:14:51 +0000 | [diff] [blame] | 293 | F(ArrayConstructor, -1, 1) \ |
| 294 | F(InternalArrayConstructor, -1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 295 | \ |
| 296 | /* Getters and Setters */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 297 | F(LookupAccessor, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 298 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 299 | /* Literals */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 300 | F(MaterializeRegExpLiteral, 4, 1)\ |
vegorov@chromium.org | f837290 | 2010-03-15 10:26:20 +0000 | [diff] [blame] | 301 | F(CreateObjectLiteral, 4, 1) \ |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 302 | F(CreateArrayLiteral, 3, 1) \ |
| 303 | F(CreateArrayLiteralShallow, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 304 | \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 305 | /* Harmony generators */ \ |
| 306 | F(CreateJSGeneratorObject, 0, 1) \ |
ulan@chromium.org | 77ca49a | 2013-04-22 09:43:56 +0000 | [diff] [blame] | 307 | F(SuspendJSGeneratorObject, 1, 1) \ |
danno@chromium.org | ca29dd8 | 2013-04-26 11:59:48 +0000 | [diff] [blame] | 308 | F(ResumeJSGeneratorObject, 3, 1) \ |
| 309 | F(ThrowGeneratorStateError, 1, 1) \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 310 | \ |
svenpanne@chromium.org | a53e8e0 | 2013-05-24 12:35:50 +0000 | [diff] [blame] | 311 | /* ES5 */ \ |
| 312 | F(ObjectFreeze, 1, 1) \ |
| 313 | \ |
danno@chromium.org | 81cac2b | 2012-07-10 11:28:27 +0000 | [diff] [blame] | 314 | /* Harmony modules */ \ |
| 315 | F(IsJSModule, 1, 1) \ |
| 316 | \ |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 317 | /* Harmony symbols */ \ |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 318 | F(CreateSymbol, 1, 1) \ |
| 319 | F(SymbolName, 1, 1) \ |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 320 | \ |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 321 | /* Harmony proxies */ \ |
| 322 | F(CreateJSProxy, 2, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 323 | F(CreateJSFunctionProxy, 4, 1) \ |
erik.corry@gmail.com | d6076d9 | 2011-06-06 09:39:18 +0000 | [diff] [blame] | 324 | F(IsJSProxy, 1, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 325 | F(IsJSFunctionProxy, 1, 1) \ |
erik.corry@gmail.com | d6076d9 | 2011-06-06 09:39:18 +0000 | [diff] [blame] | 326 | F(GetHandler, 1, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 327 | F(GetCallTrap, 1, 1) \ |
| 328 | F(GetConstructTrap, 1, 1) \ |
rossberg@chromium.org | 717967f | 2011-07-20 13:44:42 +0000 | [diff] [blame] | 329 | F(Fix, 1, 1) \ |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 330 | \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 331 | /* Harmony sets */ \ |
| 332 | F(SetInitialize, 1, 1) \ |
| 333 | F(SetAdd, 2, 1) \ |
| 334 | F(SetHas, 2, 1) \ |
| 335 | F(SetDelete, 2, 1) \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 336 | F(SetGetSize, 1, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 337 | \ |
| 338 | /* Harmony maps */ \ |
| 339 | F(MapInitialize, 1, 1) \ |
| 340 | F(MapGet, 2, 1) \ |
jkummerow@chromium.org | 7a6fc81 | 2012-06-27 11:12:38 +0000 | [diff] [blame] | 341 | F(MapHas, 2, 1) \ |
| 342 | F(MapDelete, 2, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 343 | F(MapSet, 3, 1) \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 344 | F(MapGetSize, 1, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 345 | \ |
jkummerow@chromium.org | ba72ec8 | 2013-07-22 09:21:20 +0000 | [diff] [blame] | 346 | /* Harmony weak maps and sets */ \ |
| 347 | F(WeakCollectionInitialize, 1, 1) \ |
| 348 | F(WeakCollectionGet, 2, 1) \ |
| 349 | F(WeakCollectionHas, 2, 1) \ |
| 350 | F(WeakCollectionDelete, 2, 1) \ |
| 351 | F(WeakCollectionSet, 3, 1) \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 352 | \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 353 | /* Harmony observe */ \ |
| 354 | F(IsObserved, 1, 1) \ |
danno@chromium.org | 169691d | 2013-07-15 08:01:13 +0000 | [diff] [blame] | 355 | F(SetIsObserved, 1, 1) \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 356 | F(SetObserverDeliveryPending, 0, 1) \ |
| 357 | F(GetObservationState, 0, 1) \ |
mmassi@chromium.org | 2f0efde | 2013-02-06 14:12:58 +0000 | [diff] [blame] | 358 | F(ObservationWeakMapCreate, 0, 1) \ |
| 359 | F(UnwrapGlobalProxy, 1, 1) \ |
dslomov@chromium.org | e97852d | 2013-09-12 09:02:59 +0000 | [diff] [blame] | 360 | F(IsAccessAllowedForObserver, 3, 1) \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 361 | \ |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 362 | /* Harmony typed arrays */ \ |
| 363 | F(ArrayBufferInitialize, 2, 1)\ |
| 364 | F(ArrayBufferGetByteLength, 1, 1)\ |
| 365 | F(ArrayBufferSliceImpl, 3, 1) \ |
mvstanton@chromium.org | 63ea3d2 | 2013-10-10 09:24:12 +0000 | [diff] [blame] | 366 | F(ArrayBufferIsView, 1, 1) \ |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 367 | \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 368 | F(TypedArrayInitialize, 5, 1) \ |
danno@chromium.org | d3c4210 | 2013-08-01 16:58:23 +0000 | [diff] [blame] | 369 | F(TypedArrayInitializeFromArrayLike, 4, 1) \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 370 | F(TypedArrayGetBuffer, 1, 1) \ |
| 371 | F(TypedArrayGetByteLength, 1, 1) \ |
| 372 | F(TypedArrayGetByteOffset, 1, 1) \ |
| 373 | F(TypedArrayGetLength, 1, 1) \ |
ulan@chromium.org | 57ff881 | 2013-05-10 08:16:55 +0000 | [diff] [blame] | 374 | F(TypedArraySetFastCases, 3, 1) \ |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 375 | \ |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 376 | F(DataViewInitialize, 4, 1) \ |
| 377 | F(DataViewGetBuffer, 1, 1) \ |
| 378 | F(DataViewGetByteLength, 1, 1) \ |
| 379 | F(DataViewGetByteOffset, 1, 1) \ |
| 380 | F(DataViewGetInt8, 3, 1) \ |
| 381 | F(DataViewGetUint8, 3, 1) \ |
| 382 | F(DataViewGetInt16, 3, 1) \ |
| 383 | F(DataViewGetUint16, 3, 1) \ |
| 384 | F(DataViewGetInt32, 3, 1) \ |
| 385 | F(DataViewGetUint32, 3, 1) \ |
| 386 | F(DataViewGetFloat32, 3, 1) \ |
| 387 | F(DataViewGetFloat64, 3, 1) \ |
| 388 | \ |
| 389 | F(DataViewSetInt8, 4, 1) \ |
| 390 | F(DataViewSetUint8, 4, 1) \ |
| 391 | F(DataViewSetInt16, 4, 1) \ |
| 392 | F(DataViewSetUint16, 4, 1) \ |
| 393 | F(DataViewSetInt32, 4, 1) \ |
| 394 | F(DataViewSetUint32, 4, 1) \ |
| 395 | F(DataViewSetFloat32, 4, 1) \ |
| 396 | F(DataViewSetFloat64, 4, 1) \ |
| 397 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 398 | /* Statements */ \ |
vegorov@chromium.org | 21b5e95 | 2010-11-23 10:24:40 +0000 | [diff] [blame] | 399 | F(NewClosure, 3, 1) \ |
verwaest@chromium.org | 662436e | 2013-08-28 08:41:27 +0000 | [diff] [blame] | 400 | F(NewClosureFromStubFailure, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 401 | F(NewObject, 1, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 402 | F(NewObjectFromBound, 1, 1) \ |
whesse@chromium.org | 4a1fe7d | 2010-09-27 12:32:04 +0000 | [diff] [blame] | 403 | F(FinalizeInstanceSize, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 404 | F(Throw, 1, 1) \ |
| 405 | F(ReThrow, 1, 1) \ |
| 406 | F(ThrowReferenceError, 1, 1) \ |
mstarzinger@chromium.org | de88679 | 2012-09-11 13:22:37 +0000 | [diff] [blame] | 407 | F(ThrowNotDateError, 0, 1) \ |
whesse@chromium.org | 4a5224e | 2010-10-20 12:37:07 +0000 | [diff] [blame] | 408 | F(StackGuard, 0, 1) \ |
yangguo@chromium.org | 5645471 | 2012-02-16 15:33:53 +0000 | [diff] [blame] | 409 | F(Interrupt, 0, 1) \ |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 410 | F(PromoteScheduledException, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 411 | \ |
| 412 | /* Contexts */ \ |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 413 | F(NewGlobalContext, 2, 1) \ |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 414 | F(NewFunctionContext, 1, 1) \ |
vegorov@chromium.org | 3cf4731 | 2011-06-29 13:20:01 +0000 | [diff] [blame] | 415 | F(PushWithContext, 2, 1) \ |
| 416 | F(PushCatchContext, 3, 1) \ |
whesse@chromium.org | 4acdc2c | 2011-08-15 13:01:23 +0000 | [diff] [blame] | 417 | F(PushBlockContext, 2, 1) \ |
ulan@chromium.org | 8e8d882 | 2012-11-23 14:36:46 +0000 | [diff] [blame] | 418 | F(PushModuleContext, 2, 1) \ |
ager@chromium.org | 0ee099b | 2011-01-25 14:06:47 +0000 | [diff] [blame] | 419 | F(DeleteContextSlot, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 420 | F(LoadContextSlot, 2, 2) \ |
| 421 | F(LoadContextSlotNoReferenceError, 2, 2) \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 422 | F(StoreContextSlot, 4, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 423 | \ |
| 424 | /* Declarations and initialization */ \ |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 425 | F(DeclareGlobals, 3, 1) \ |
ulan@chromium.org | 8e8d882 | 2012-11-23 14:36:46 +0000 | [diff] [blame] | 426 | F(DeclareModules, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 427 | F(DeclareContextSlot, 4, 1) \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 428 | F(InitializeVarGlobal, -1 /* 2 or 3 */, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 429 | F(InitializeConstGlobal, 2, 1) \ |
| 430 | F(InitializeConstContextSlot, 3, 1) \ |
| 431 | F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 432 | \ |
| 433 | /* Debugging */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 434 | F(DebugPrint, 1, 1) \ |
| 435 | F(DebugTrace, 0, 1) \ |
| 436 | F(TraceEnter, 0, 1) \ |
| 437 | F(TraceExit, 1, 1) \ |
| 438 | F(Abort, 2, 1) \ |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 439 | /* Logging */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 440 | F(Log, 2, 1) \ |
christian.plesner.hansen@gmail.com | 2bc58ef | 2009-09-22 10:00:30 +0000 | [diff] [blame] | 441 | /* ES5 */ \ |
| 442 | F(LocalKeys, 1, 1) \ |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 443 | /* Cache suport */ \ |
| 444 | F(GetFromCache, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 445 | \ |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 446 | /* Message objects */ \ |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 447 | F(MessageGetStartPosition, 1, 1) \ |
| 448 | F(MessageGetScript, 1, 1) \ |
| 449 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 450 | /* Pseudo functions - handled as macros by parser */ \ |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 451 | F(IS_VAR, 1, 1) \ |
| 452 | \ |
| 453 | /* expose boolean functions from objects-inl.h */ \ |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 454 | F(HasFastSmiElements, 1, 1) \ |
| 455 | F(HasFastSmiOrObjectElements, 1, 1) \ |
| 456 | F(HasFastObjectElements, 1, 1) \ |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 457 | F(HasFastDoubleElements, 1, 1) \ |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 458 | F(HasFastHoleyElements, 1, 1) \ |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 459 | F(HasDictionaryElements, 1, 1) \ |
svenpanne@chromium.org | a53e8e0 | 2013-05-24 12:35:50 +0000 | [diff] [blame] | 460 | F(HasNonStrictArgumentsElements, 1, 1) \ |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 461 | F(HasExternalPixelElements, 1, 1) \ |
| 462 | F(HasExternalArrayElements, 1, 1) \ |
| 463 | F(HasExternalByteElements, 1, 1) \ |
| 464 | F(HasExternalUnsignedByteElements, 1, 1) \ |
| 465 | F(HasExternalShortElements, 1, 1) \ |
| 466 | F(HasExternalUnsignedShortElements, 1, 1) \ |
| 467 | F(HasExternalIntElements, 1, 1) \ |
| 468 | F(HasExternalUnsignedIntElements, 1, 1) \ |
| 469 | F(HasExternalFloatElements, 1, 1) \ |
whesse@chromium.org | 030d38e | 2011-07-13 13:23:34 +0000 | [diff] [blame] | 470 | F(HasExternalDoubleElements, 1, 1) \ |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 471 | F(HasFastProperties, 1, 1) \ |
danno@chromium.org | 94b0d6f | 2013-02-04 13:33:20 +0000 | [diff] [blame] | 472 | F(TransitionElementsKind, 2, 1) \ |
dslomov@chromium.org | e97852d | 2013-09-12 09:02:59 +0000 | [diff] [blame] | 473 | F(HaveSameMap, 2, 1) \ |
| 474 | F(IsAccessCheckNeeded, 1, 1) |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 475 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 476 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 477 | #ifdef ENABLE_DEBUGGER_SUPPORT |
| 478 | #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
| 479 | /* Debugger support*/ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 480 | F(DebugBreak, 0, 1) \ |
| 481 | F(SetDebugEventListener, 2, 1) \ |
| 482 | F(Break, 0, 1) \ |
| 483 | F(DebugGetPropertyDetails, 2, 1) \ |
| 484 | F(DebugGetProperty, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 485 | F(DebugPropertyTypeFromDetails, 1, 1) \ |
| 486 | F(DebugPropertyAttributesFromDetails, 1, 1) \ |
| 487 | F(DebugPropertyIndexFromDetails, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 488 | F(DebugNamedInterceptorPropertyValue, 2, 1) \ |
| 489 | F(DebugIndexedInterceptorElementValue, 2, 1) \ |
| 490 | F(CheckExecutionState, 1, 1) \ |
| 491 | F(GetFrameCount, 1, 1) \ |
| 492 | F(GetFrameDetails, 2, 1) \ |
| 493 | F(GetScopeCount, 2, 1) \ |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 494 | F(GetStepInPositions, 2, 1) \ |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 495 | F(GetScopeDetails, 4, 1) \ |
danno@chromium.org | 1044a4d | 2012-04-30 12:34:39 +0000 | [diff] [blame] | 496 | F(GetFunctionScopeCount, 1, 1) \ |
| 497 | F(GetFunctionScopeDetails, 2, 1) \ |
mmassi@chromium.org | 49a4467 | 2012-12-04 13:52:03 +0000 | [diff] [blame] | 498 | F(SetScopeVariableValue, 6, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 499 | F(DebugPrintScopes, 0, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 500 | F(GetThreadCount, 1, 1) \ |
| 501 | F(GetThreadDetails, 2, 1) \ |
whesse@chromium.org | e90029b | 2010-08-02 11:52:17 +0000 | [diff] [blame] | 502 | F(SetDisableBreak, 1, 1) \ |
jkummerow@chromium.org | 93a47f4 | 2013-07-02 14:43:41 +0000 | [diff] [blame] | 503 | F(GetBreakLocations, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 504 | F(SetFunctionBreakPoint, 3, 1) \ |
jkummerow@chromium.org | 93a47f4 | 2013-07-02 14:43:41 +0000 | [diff] [blame] | 505 | F(SetScriptBreakPoint, 4, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 506 | F(ClearBreakPoint, 1, 1) \ |
| 507 | F(ChangeBreakOnException, 2, 1) \ |
fschneider@chromium.org | c20610a | 2010-09-22 09:44:58 +0000 | [diff] [blame] | 508 | F(IsBreakOnException, 1, 1) \ |
dslomov@chromium.org | 639bac0 | 2013-09-09 11:58:54 +0000 | [diff] [blame] | 509 | F(PrepareStep, 4, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 510 | F(ClearStepping, 0, 1) \ |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 511 | F(DebugEvaluate, 6, 1) \ |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 512 | F(DebugEvaluateGlobal, 4, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 513 | F(DebugGetLoadedScripts, 0, 1) \ |
| 514 | F(DebugReferencedBy, 3, 1) \ |
| 515 | F(DebugConstructedBy, 2, 1) \ |
| 516 | F(DebugGetPrototype, 1, 1) \ |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 517 | F(DebugSetScriptSource, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 518 | F(SystemBreak, 0, 1) \ |
| 519 | F(DebugDisassembleFunction, 1, 1) \ |
| 520 | F(DebugDisassembleConstructor, 1, 1) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 521 | F(FunctionGetInferredName, 1, 1) \ |
| 522 | F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \ |
| 523 | F(LiveEditGatherCompileInfo, 2, 1) \ |
| 524 | F(LiveEditReplaceScript, 3, 1) \ |
| 525 | F(LiveEditReplaceFunctionCode, 2, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 526 | F(LiveEditFunctionSourceUpdated, 1, 1) \ |
kmillikin@chromium.org | 4111b80 | 2010-05-03 10:34:42 +0000 | [diff] [blame] | 527 | F(LiveEditFunctionSetScript, 2, 1) \ |
| 528 | F(LiveEditReplaceRefToNestedFunction, 3, 1) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 529 | F(LiveEditPatchFunctionPositions, 2, 1) \ |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 530 | F(LiveEditCheckAndDropActivations, 2, 1) \ |
sgjesse@chromium.org | c6c5718 | 2011-01-17 12:24:25 +0000 | [diff] [blame] | 531 | F(LiveEditCompareStrings, 2, 1) \ |
yangguo@chromium.org | 5a11aaf | 2012-06-20 11:29:00 +0000 | [diff] [blame] | 532 | F(LiveEditRestartFrame, 2, 1) \ |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 533 | F(GetFunctionCodePositionFromSource, 2, 1) \ |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 534 | F(ExecuteInDebugContext, 2, 1) \ |
| 535 | \ |
| 536 | F(SetFlags, 1, 1) \ |
| 537 | F(CollectGarbage, 1, 1) \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 538 | F(GetHeapUsage, 0, 1) \ |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 539 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 540 | #else |
| 541 | #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) |
| 542 | #endif |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 543 | |
danno@chromium.org | 5940060 | 2013-08-13 17:09:37 +0000 | [diff] [blame] | 544 | |
| 545 | #ifdef V8_I18N_SUPPORT |
| 546 | #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) \ |
| 547 | /* i18n support */ \ |
| 548 | /* Standalone, helper methods. */ \ |
| 549 | F(CanonicalizeLanguageTag, 1, 1) \ |
| 550 | F(AvailableLocalesOf, 1, 1) \ |
| 551 | F(GetDefaultICULocale, 0, 1) \ |
| 552 | F(GetLanguageTagVariants, 1, 1) \ |
| 553 | \ |
| 554 | /* Date format and parse. */ \ |
| 555 | F(CreateDateTimeFormat, 3, 1) \ |
| 556 | F(InternalDateFormat, 2, 1) \ |
| 557 | F(InternalDateParse, 2, 1) \ |
| 558 | \ |
| 559 | /* Number format and parse. */ \ |
| 560 | F(CreateNumberFormat, 3, 1) \ |
| 561 | F(InternalNumberFormat, 2, 1) \ |
| 562 | F(InternalNumberParse, 2, 1) \ |
| 563 | \ |
| 564 | /* Collator. */ \ |
| 565 | F(CreateCollator, 3, 1) \ |
| 566 | F(InternalCompare, 3, 1) \ |
verwaest@chromium.org | 32cb9b2 | 2013-08-21 11:18:12 +0000 | [diff] [blame] | 567 | \ |
| 568 | /* Break iterator. */ \ |
| 569 | F(CreateBreakIterator, 3, 1) \ |
| 570 | F(BreakIteratorAdoptText, 2, 1) \ |
| 571 | F(BreakIteratorFirst, 1, 1) \ |
| 572 | F(BreakIteratorNext, 1, 1) \ |
| 573 | F(BreakIteratorCurrent, 1, 1) \ |
| 574 | F(BreakIteratorBreakType, 1, 1) \ |
danno@chromium.org | 5940060 | 2013-08-13 17:09:37 +0000 | [diff] [blame] | 575 | |
| 576 | #else |
| 577 | #define RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) |
| 578 | #endif |
| 579 | |
| 580 | |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 581 | #ifdef DEBUG |
| 582 | #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
| 583 | /* Testing */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 584 | F(ListNatives, 0, 1) |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 585 | #else |
| 586 | #define RUNTIME_FUNCTION_LIST_DEBUG(F) |
| 587 | #endif |
| 588 | |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 589 | // ---------------------------------------------------------------------------- |
| 590 | // RUNTIME_FUNCTION_LIST defines all runtime functions accessed |
| 591 | // either directly by id (via the code generator), or indirectly |
| 592 | // via a native call by name (from within JS code). |
| 593 | |
| 594 | #define RUNTIME_FUNCTION_LIST(F) \ |
ager@chromium.org | ce58e17 | 2009-05-13 07:11:48 +0000 | [diff] [blame] | 595 | RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ |
| 596 | RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 597 | RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
danno@chromium.org | 5940060 | 2013-08-13 17:09:37 +0000 | [diff] [blame] | 598 | RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
| 599 | RUNTIME_FUNCTION_LIST_I18N_SUPPORT(F) |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 600 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 601 | // ---------------------------------------------------------------------------- |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 602 | // INLINE_FUNCTION_LIST defines all inlined functions accessed |
| 603 | // with a native call of the form %_name from within JS code. |
| 604 | // Entries have the form F(name, number of arguments, number of return values). |
| 605 | #define INLINE_FUNCTION_LIST(F) \ |
| 606 | F(IsSmi, 1, 1) \ |
| 607 | F(IsNonNegativeSmi, 1, 1) \ |
| 608 | F(IsArray, 1, 1) \ |
| 609 | F(IsRegExp, 1, 1) \ |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 610 | F(IsConstructCall, 0, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 611 | F(CallFunction, -1 /* receiver + n args + function */, 1) \ |
| 612 | F(ArgumentsLength, 0, 1) \ |
| 613 | F(Arguments, 1, 1) \ |
| 614 | F(ValueOf, 1, 1) \ |
| 615 | F(SetValueOf, 2, 1) \ |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 616 | F(DateField, 2 /* date object, field index */, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 617 | F(StringCharFromCode, 1, 1) \ |
| 618 | F(StringCharAt, 2, 1) \ |
mstarzinger@chromium.org | 32280cf | 2012-12-06 17:32:37 +0000 | [diff] [blame] | 619 | F(OneByteSeqStringSetChar, 3, 1) \ |
| 620 | F(TwoByteSeqStringSetChar, 3, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 621 | F(ObjectEquals, 2, 1) \ |
| 622 | F(RandomHeapNumber, 0, 1) \ |
| 623 | F(IsObject, 1, 1) \ |
| 624 | F(IsFunction, 1, 1) \ |
| 625 | F(IsUndetectableObject, 1, 1) \ |
| 626 | F(IsSpecObject, 1, 1) \ |
| 627 | F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \ |
| 628 | F(MathPow, 2, 1) \ |
| 629 | F(MathSin, 1, 1) \ |
| 630 | F(MathCos, 1, 1) \ |
mstarzinger@chromium.org | 1b3afd1 | 2011-11-29 14:28:56 +0000 | [diff] [blame] | 631 | F(MathTan, 1, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 632 | F(MathSqrt, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 633 | F(MathLog, 1, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 634 | F(IsRegExpEquivalent, 2, 1) \ |
| 635 | F(HasCachedArrayIndex, 1, 1) \ |
vegorov@chromium.org | 21b5e95 | 2010-11-23 10:24:40 +0000 | [diff] [blame] | 636 | F(GetCachedArrayIndex, 1, 1) \ |
danno@chromium.org | ca29dd8 | 2013-04-26 11:59:48 +0000 | [diff] [blame] | 637 | F(FastAsciiArrayJoin, 2, 1) \ |
verwaest@chromium.org | 8a00e82 | 2013-06-10 15:11:22 +0000 | [diff] [blame] | 638 | F(GeneratorNext, 2, 1) \ |
jkummerow@chromium.org | 93a47f4 | 2013-07-02 14:43:41 +0000 | [diff] [blame] | 639 | F(GeneratorThrow, 2, 1) \ |
| 640 | F(DebugBreakInOptimizedCode, 0, 1) |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 641 | |
| 642 | |
| 643 | // ---------------------------------------------------------------------------- |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 644 | // INLINE_RUNTIME_FUNCTION_LIST defines all inlined functions accessed |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 645 | // with a native call of the form %_name from within JS code that also have |
lrn@chromium.org | fa943b7 | 2010-11-03 08:14:36 +0000 | [diff] [blame] | 646 | // a corresponding runtime function, that is called for slow cases. |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 647 | // Entries have the form F(name, number of arguments, number of return values). |
| 648 | #define INLINE_RUNTIME_FUNCTION_LIST(F) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 649 | F(ClassOf, 1, 1) \ |
| 650 | F(StringCharCodeAt, 2, 1) \ |
| 651 | F(Log, 3, 1) \ |
| 652 | F(StringAdd, 2, 1) \ |
| 653 | F(SubString, 3, 1) \ |
| 654 | F(StringCompare, 2, 1) \ |
| 655 | F(RegExpExec, 4, 1) \ |
| 656 | F(RegExpConstructResult, 3, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 657 | F(GetFromCache, 2, 1) \ |
ulan@chromium.org | d6899c3 | 2012-05-18 14:12:25 +0000 | [diff] [blame] | 658 | F(NumberToString, 1, 1) |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 659 | |
| 660 | |
| 661 | //--------------------------------------------------------------------------- |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 662 | // Runtime provides access to all C++ runtime functions. |
| 663 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 664 | class RuntimeState { |
| 665 | public: |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 666 | StaticResource<ConsStringIteratorOp>* string_iterator() { |
| 667 | return &string_iterator_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 668 | } |
| 669 | unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() { |
| 670 | return &to_upper_mapping_; |
| 671 | } |
| 672 | unibrow::Mapping<unibrow::ToLowercase, 128>* to_lower_mapping() { |
| 673 | return &to_lower_mapping_; |
| 674 | } |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 675 | ConsStringIteratorOp* string_iterator_compare_x() { |
| 676 | return &string_iterator_compare_x_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 677 | } |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 678 | ConsStringIteratorOp* string_iterator_compare_y() { |
| 679 | return &string_iterator_compare_y_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 680 | } |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 681 | ConsStringIteratorOp* string_locale_compare_it1() { |
| 682 | return &string_locale_compare_it1_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 683 | } |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 684 | ConsStringIteratorOp* string_locale_compare_it2() { |
| 685 | return &string_locale_compare_it2_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 686 | } |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 687 | |
| 688 | private: |
| 689 | RuntimeState() {} |
| 690 | // Non-reentrant string buffer for efficient general use in the runtime. |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 691 | StaticResource<ConsStringIteratorOp> string_iterator_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 692 | unibrow::Mapping<unibrow::ToUppercase, 128> to_upper_mapping_; |
| 693 | unibrow::Mapping<unibrow::ToLowercase, 128> to_lower_mapping_; |
yangguo@chromium.org | 4cd70b4 | 2013-01-04 08:57:54 +0000 | [diff] [blame] | 694 | ConsStringIteratorOp string_iterator_compare_x_; |
| 695 | ConsStringIteratorOp string_iterator_compare_y_; |
| 696 | ConsStringIteratorOp string_locale_compare_it1_; |
| 697 | ConsStringIteratorOp string_locale_compare_it2_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 698 | |
| 699 | friend class Isolate; |
| 700 | friend class Runtime; |
| 701 | |
| 702 | DISALLOW_COPY_AND_ASSIGN(RuntimeState); |
| 703 | }; |
| 704 | |
| 705 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 706 | class Runtime : public AllStatic { |
| 707 | public: |
| 708 | enum FunctionId { |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 709 | #define F(name, nargs, ressize) k##name, |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 710 | RUNTIME_FUNCTION_LIST(F) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 711 | #undef F |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 712 | #define F(name, nargs, ressize) kInline##name, |
| 713 | INLINE_FUNCTION_LIST(F) |
| 714 | INLINE_RUNTIME_FUNCTION_LIST(F) |
| 715 | #undef F |
| 716 | kNumFunctions, |
| 717 | kFirstInlineFunction = kInlineIsSmi |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 718 | }; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 719 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 720 | enum IntrinsicType { |
| 721 | RUNTIME, |
| 722 | INLINE |
| 723 | }; |
| 724 | |
| 725 | // Intrinsic function descriptor. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 726 | struct Function { |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 727 | FunctionId function_id; |
| 728 | IntrinsicType intrinsic_type; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 729 | // The JS name of the function. |
| 730 | const char* name; |
| 731 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 732 | // The C++ (native) entry point. NULL if the function is inlined. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 733 | byte* entry; |
| 734 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 735 | // The number of arguments expected. nargs is -1 if the function takes |
| 736 | // a variable number of arguments. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 737 | int nargs; |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 738 | // Size of result. Most functions return a single pointer, size 1. |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 739 | int result_size; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 740 | }; |
| 741 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 742 | static const int kNotFound = -1; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 743 | |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 744 | // Add internalized strings for all the intrinsic function names to a |
| 745 | // StringDictionary. |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 746 | // Returns failure if an allocation fails. In this case, it must be |
| 747 | // retried with a new, empty StringDictionary, not with the same one. |
| 748 | // Alternatively, heap initialization can be completely restarted. |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 749 | MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 750 | Heap* heap, Object* dictionary); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 751 | |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 752 | // Get the intrinsic function with the given name, which must be internalized. |
| 753 | static const Function* FunctionForName(Handle<String> name); |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 754 | |
| 755 | // Get the intrinsic function with the given FunctionId. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 756 | static const Function* FunctionForId(FunctionId id); |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 757 | |
| 758 | // General-purpose helper functions for runtime system. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 759 | static int StringMatch(Isolate* isolate, |
| 760 | Handle<String> sub, |
| 761 | Handle<String> pat, |
| 762 | int index); |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 763 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 764 | static bool IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch); |
kasperl@chromium.org | d1e3e72 | 2009-04-14 13:38:25 +0000 | [diff] [blame] | 765 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 766 | // TODO(1240886): Some of the following methods are *not* handle safe, but |
| 767 | // accept handle arguments. This seems fragile. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 768 | |
| 769 | // Support getting the characters in a string using [] notation as |
| 770 | // in Firefox/SpiderMonkey, Safari and Opera. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 771 | MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Isolate* isolate, |
| 772 | Handle<Object> object, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 773 | uint32_t index); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 774 | |
ulan@chromium.org | 77ca49a | 2013-04-22 09:43:56 +0000 | [diff] [blame] | 775 | MUST_USE_RESULT static MaybeObject* GetElementOrCharAtOrFail( |
| 776 | Isolate* isolate, |
| 777 | Handle<Object> object, |
| 778 | uint32_t index); |
| 779 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 780 | MUST_USE_RESULT static MaybeObject* SetObjectProperty( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 781 | Isolate* isolate, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 782 | Handle<Object> object, |
| 783 | Handle<Object> key, |
| 784 | Handle<Object> value, |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 785 | PropertyAttributes attr, |
karlklose@chromium.org | 8f806e8 | 2011-03-07 14:06:08 +0000 | [diff] [blame] | 786 | StrictModeFlag strict_mode); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 787 | |
mstarzinger@chromium.org | b228be0 | 2013-04-18 14:56:59 +0000 | [diff] [blame] | 788 | MUST_USE_RESULT static MaybeObject* SetObjectPropertyOrFail( |
| 789 | Isolate* isolate, |
| 790 | Handle<Object> object, |
| 791 | Handle<Object> key, |
| 792 | Handle<Object> value, |
| 793 | PropertyAttributes attr, |
| 794 | StrictModeFlag strict_mode); |
| 795 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 796 | MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 797 | Isolate* isolate, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 798 | Handle<JSObject> object, |
| 799 | Handle<Object> key, |
| 800 | Handle<Object> value, |
| 801 | PropertyAttributes attr); |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 802 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 803 | MUST_USE_RESULT static MaybeObject* DeleteObjectProperty( |
| 804 | Isolate* isolate, |
| 805 | Handle<JSReceiver> object, |
| 806 | Handle<Object> key, |
| 807 | JSReceiver::DeleteMode mode); |
| 808 | |
| 809 | MUST_USE_RESULT static MaybeObject* HasObjectProperty( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 810 | Isolate* isolate, |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 811 | Handle<JSReceiver> object, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 812 | Handle<Object> key); |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 813 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 814 | MUST_USE_RESULT static MaybeObject* GetObjectProperty( |
| 815 | Isolate* isolate, |
| 816 | Handle<Object> object, |
| 817 | Handle<Object> key); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 818 | |
mstarzinger@chromium.org | b228be0 | 2013-04-18 14:56:59 +0000 | [diff] [blame] | 819 | MUST_USE_RESULT static MaybeObject* GetObjectPropertyOrFail( |
| 820 | Isolate* isolate, |
| 821 | Handle<Object> object, |
| 822 | Handle<Object> key); |
| 823 | |
svenpanne@chromium.org | a53e8e0 | 2013-05-24 12:35:50 +0000 | [diff] [blame] | 824 | static void SetupArrayBuffer(Isolate* isolate, |
danno@chromium.org | ca29dd8 | 2013-04-26 11:59:48 +0000 | [diff] [blame] | 825 | Handle<JSArrayBuffer> array_buffer, |
svenpanne@chromium.org | a53e8e0 | 2013-05-24 12:35:50 +0000 | [diff] [blame] | 826 | bool is_external, |
danno@chromium.org | ca29dd8 | 2013-04-26 11:59:48 +0000 | [diff] [blame] | 827 | void* data, |
| 828 | size_t allocated_length); |
| 829 | |
| 830 | static bool SetupArrayBufferAllocatingData( |
| 831 | Isolate* isolate, |
| 832 | Handle<JSArrayBuffer> array_buffer, |
danno@chromium.org | d3c4210 | 2013-08-01 16:58:23 +0000 | [diff] [blame] | 833 | size_t allocated_length, |
| 834 | bool initialize = true); |
danno@chromium.org | ca29dd8 | 2013-04-26 11:59:48 +0000 | [diff] [blame] | 835 | |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 836 | static void FreeArrayBuffer( |
| 837 | Isolate* isolate, |
| 838 | JSArrayBuffer* phantom_array_buffer); |
| 839 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 840 | // Helper functions used stubs. |
machenbach@chromium.org | 528ce02 | 2013-09-23 14:09:36 +0000 | [diff] [blame] | 841 | static void PerformGC(Object* result, Isolate* isolate); |
ricow@chromium.org | 7ad6522 | 2011-12-19 12:13:11 +0000 | [diff] [blame] | 842 | |
| 843 | // Used in runtime.cc and hydrogen's VisitArrayLiteral. |
| 844 | static Handle<Object> CreateArrayLiteralBoilerplate( |
| 845 | Isolate* isolate, |
| 846 | Handle<FixedArray> literals, |
| 847 | Handle<FixedArray> elements); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 848 | }; |
| 849 | |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 850 | |
| 851 | //--------------------------------------------------------------------------- |
| 852 | // Constants used by interface to runtime functions. |
| 853 | |
mstarzinger@chromium.org | 1b3afd1 | 2011-11-29 14:28:56 +0000 | [diff] [blame] | 854 | class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; |
| 855 | class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; |
| 856 | class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {}; |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 857 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 858 | } } // namespace v8::internal |
| 859 | |
| 860 | #endif // V8_RUNTIME_H_ |