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) \ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 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) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 63 | F(GetArgumentsProperty, 1, 1) \ |
| 64 | F(ToFastProperties, 1, 1) \ |
| 65 | F(ToSlowProperties, 1, 1) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 66 | F(FinishArrayPrototypeSetup, 1, 1) \ |
vegorov@chromium.org | f837290 | 2010-03-15 10:26:20 +0000 | [diff] [blame] | 67 | F(SpecialArrayFunctions, 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) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 71 | F(IsInPrototypeChain, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 72 | \ |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 73 | F(GetOwnProperty, 2, 1) \ |
| 74 | \ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 75 | F(IsExtensible, 1, 1) \ |
kmillikin@chromium.org | 69ea396 | 2010-07-05 11:01:40 +0000 | [diff] [blame] | 76 | F(PreventExtensions, 1, 1)\ |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 77 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 78 | /* Utilities */ \ |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 79 | F(CheckIsBootstrapping, 0, 1) \ |
mstarzinger@chromium.org | 88d326b | 2012-04-23 12:57:22 +0000 | [diff] [blame] | 80 | F(GetRootNaN, 0, 1) \ |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 81 | F(Call, -1 /* >= 2 */, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 82 | F(Apply, 5, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 83 | F(GetFunctionDelegate, 1, 1) \ |
| 84 | F(GetConstructorDelegate, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 85 | F(NewArgumentsFast, 3, 1) \ |
whesse@chromium.org | 7b26015 | 2011-06-20 15:33:18 +0000 | [diff] [blame] | 86 | F(NewStrictArgumentsFast, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 87 | F(LazyCompile, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 88 | F(LazyRecompile, 1, 1) \ |
| 89 | F(NotifyDeoptimized, 1, 1) \ |
| 90 | F(NotifyOSR, 0, 1) \ |
ager@chromium.org | a9aa5fa | 2011-04-13 08:46:07 +0000 | [diff] [blame] | 91 | F(DeoptimizeFunction, 1, 1) \ |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 92 | F(ClearFunctionTypeFeedback, 1, 1) \ |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 93 | F(RunningInSimulator, 0, 1) \ |
kmillikin@chromium.org | be6bd10 | 2012-02-23 08:45:21 +0000 | [diff] [blame] | 94 | F(OptimizeFunctionOnNextCall, -1, 1) \ |
lrn@chromium.org | 1c09276 | 2011-05-09 09:42:16 +0000 | [diff] [blame] | 95 | F(GetOptimizationStatus, 1, 1) \ |
| 96 | F(GetOptimizationCount, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 97 | F(CompileForOnStackReplacement, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 98 | F(SetNewFunctionAttributes, 1, 1) \ |
lrn@chromium.org | c4e51ac | 2010-08-09 09:47:21 +0000 | [diff] [blame] | 99 | F(AllocateInNewSpace, 1, 1) \ |
ricow@chromium.org | d2be901 | 2011-06-01 06:00:58 +0000 | [diff] [blame] | 100 | F(SetNativeFlag, 1, 1) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 101 | F(StoreArrayLiteralElement, 5, 1) \ |
mstarzinger@chromium.org | 88d326b | 2012-04-23 12:57:22 +0000 | [diff] [blame] | 102 | F(DebugCallbackSupportsStepping, 1, 1) \ |
| 103 | F(DebugPrepareStepInIfStepping, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 104 | \ |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 105 | /* Array join support */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 106 | F(PushIfAbsent, 2, 1) \ |
| 107 | F(ArrayConcat, 1, 1) \ |
ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 108 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 109 | /* Conversions */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 110 | F(ToBool, 1, 1) \ |
| 111 | F(Typeof, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 112 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 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) \ |
fschneider@chromium.org | 086aac6 | 2010-03-17 13:18:24 +0000 | [diff] [blame] | 119 | F(StringSplit, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 120 | F(CharFromCode, 1, 1) \ |
| 121 | F(URIEscape, 1, 1) \ |
| 122 | F(URIUnescape, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 123 | F(QuoteJSONString, 1, 1) \ |
sgjesse@chromium.org | c6c5718 | 2011-01-17 12:24:25 +0000 | [diff] [blame] | 124 | F(QuoteJSONStringComma, 1, 1) \ |
ricow@chromium.org | c54d365 | 2011-05-30 09:20:16 +0000 | [diff] [blame] | 125 | F(QuoteJSONStringArray, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 126 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 127 | F(NumberToString, 1, 1) \ |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 128 | F(NumberToStringSkipCache, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 129 | F(NumberToInteger, 1, 1) \ |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 130 | F(NumberToIntegerMapMinusZero, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 131 | F(NumberToJSUint32, 1, 1) \ |
| 132 | F(NumberToJSInt32, 1, 1) \ |
| 133 | F(NumberToSmi, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 134 | F(AllocateHeapNumber, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 135 | \ |
| 136 | /* Arithmetic operations */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 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) \ |
ager@chromium.org | 6a2b0aa | 2010-07-13 20:58:03 +0000 | [diff] [blame] | 143 | F(NumberAlloc, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 144 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 145 | F(StringAdd, 2, 1) \ |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 146 | F(StringBuilderConcat, 3, 1) \ |
kmillikin@chromium.org | 49edbdf | 2011-02-16 12:32:18 +0000 | [diff] [blame] | 147 | F(StringBuilderJoin, 3, 1) \ |
ricow@chromium.org | 27bf288 | 2011-11-17 08:34:43 +0000 | [diff] [blame] | 148 | F(SparseJoinWithSeparator, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 149 | \ |
| 150 | /* Bit operations */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 151 | F(NumberOr, 2, 1) \ |
| 152 | F(NumberAnd, 2, 1) \ |
| 153 | F(NumberXor, 2, 1) \ |
| 154 | F(NumberNot, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 155 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 156 | F(NumberShl, 2, 1) \ |
| 157 | F(NumberShr, 2, 1) \ |
| 158 | F(NumberSar, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 159 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 160 | /* Comparisons */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 161 | F(NumberEquals, 2, 1) \ |
| 162 | F(StringEquals, 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(NumberCompare, 3, 1) \ |
| 165 | F(SmiLexicographicCompare, 2, 1) \ |
| 166 | F(StringCompare, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 167 | \ |
| 168 | /* Math */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 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) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 179 | F(Math_pow_cfunction, 2, 1) \ |
whesse@chromium.org | cec079d | 2010-03-22 14:44:04 +0000 | [diff] [blame] | 180 | F(RoundNumber, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 181 | F(Math_sin, 1, 1) \ |
| 182 | F(Math_sqrt, 1, 1) \ |
| 183 | F(Math_tan, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 184 | \ |
| 185 | /* Regular expressions */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 186 | F(RegExpCompile, 3, 1) \ |
| 187 | F(RegExpExec, 4, 1) \ |
lrn@chromium.org | 25156de | 2010-04-06 13:10:27 +0000 | [diff] [blame] | 188 | F(RegExpExecMultiple, 4, 1) \ |
| 189 | F(RegExpInitializeObject, 5, 1) \ |
whesse@chromium.org | b6e43bb | 2010-04-14 09:36:28 +0000 | [diff] [blame] | 190 | F(RegExpConstructResult, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 191 | \ |
fschneider@chromium.org | e03fb64 | 2010-11-01 12:34:09 +0000 | [diff] [blame] | 192 | /* JSON */ \ |
| 193 | F(ParseJson, 1, 1) \ |
| 194 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 195 | /* Strings */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 196 | F(StringCharCodeAt, 2, 1) \ |
| 197 | F(StringIndexOf, 3, 1) \ |
| 198 | F(StringLastIndexOf, 3, 1) \ |
| 199 | F(StringLocaleCompare, 2, 1) \ |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 200 | F(SubString, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 201 | F(StringReplaceRegExpWithString, 4, 1) \ |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 202 | F(StringReplaceOneCharWithString, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 203 | F(StringMatch, 3, 1) \ |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 204 | F(StringTrim, 3, 1) \ |
ager@chromium.org | beb2571 | 2010-11-29 08:02:25 +0000 | [diff] [blame] | 205 | F(StringToArray, 2, 1) \ |
ricow@chromium.org | d236f4d | 2010-09-01 06:52:08 +0000 | [diff] [blame] | 206 | F(NewStringWrapper, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 207 | \ |
| 208 | /* Numbers */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 209 | F(NumberToRadixString, 2, 1) \ |
| 210 | F(NumberToFixed, 2, 1) \ |
| 211 | F(NumberToExponential, 2, 1) \ |
| 212 | F(NumberToPrecision, 2, 1) |
ager@chromium.org | ce58e17 | 2009-05-13 07:11:48 +0000 | [diff] [blame] | 213 | |
| 214 | #define RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 215 | /* Reflection */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 216 | F(FunctionSetInstanceClassName, 2, 1) \ |
| 217 | F(FunctionSetLength, 2, 1) \ |
| 218 | F(FunctionSetPrototype, 2, 1) \ |
ricow@chromium.org | 2c99e28 | 2011-07-28 09:15:17 +0000 | [diff] [blame] | 219 | F(FunctionSetReadOnlyPrototype, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 220 | F(FunctionGetName, 1, 1) \ |
| 221 | F(FunctionSetName, 2, 1) \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 222 | F(FunctionNameShouldPrintAsAnonymous, 1, 1) \ |
| 223 | F(FunctionMarkNameShouldPrintAsAnonymous, 1, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 224 | F(FunctionBindArguments, 4, 1) \ |
| 225 | F(BoundFunctionGetBindings, 1, 1) \ |
kmillikin@chromium.org | 4111b80 | 2010-05-03 10:34:42 +0000 | [diff] [blame] | 226 | F(FunctionRemovePrototype, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 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) \ |
christian.plesner.hansen@gmail.com | 2bc58ef | 2009-09-22 10:00:30 +0000 | [diff] [blame] | 232 | F(FunctionIsBuiltin, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 233 | F(GetScript, 1, 1) \ |
jkummerow@chromium.org | ab7dad4 | 2012-02-07 12:07:34 +0000 | [diff] [blame] | 234 | F(CollectStackTrace, 3, 1) \ |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 235 | F(GetV8Version, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 236 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 237 | F(ClassOf, 1, 1) \ |
| 238 | F(SetCode, 2, 1) \ |
ricow@chromium.org | d236f4d | 2010-09-01 06:52:08 +0000 | [diff] [blame] | 239 | F(SetExpectedNumberOfProperties, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 240 | \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 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) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 246 | \ |
| 247 | /* Dates */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 248 | F(DateCurrentTime, 0, 1) \ |
| 249 | F(DateParseString, 2, 1) \ |
| 250 | F(DateLocalTimezone, 1, 1) \ |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 251 | F(DateToUTC, 1, 1) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 252 | F(DateMakeDay, 2, 1) \ |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 253 | F(DateSetValue, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 254 | \ |
| 255 | /* Numbers */ \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 256 | \ |
| 257 | /* Globals */ \ |
fschneider@chromium.org | e03fb64 | 2010-11-01 12:34:09 +0000 | [diff] [blame] | 258 | F(CompileString, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 259 | F(GlobalPrint, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 260 | \ |
| 261 | /* Eval */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 262 | F(GlobalReceiver, 1, 1) \ |
jkummerow@chromium.org | 04e4f1e | 2011-11-14 13:36:17 +0000 | [diff] [blame] | 263 | F(ResolvePossiblyDirectEval, 5, 2) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 264 | \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 265 | F(SetProperty, -1 /* 4 or 5 */, 1) \ |
ager@chromium.org | 5c83825 | 2010-02-19 08:53:10 +0000 | [diff] [blame] | 266 | F(DefineOrRedefineDataProperty, 4, 1) \ |
| 267 | F(DefineOrRedefineAccessorProperty, 5, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 268 | F(IgnoreAttributesAndSetProperty, -1 /* 3 or 4 */, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 269 | \ |
| 270 | /* Arrays */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 271 | F(RemoveArrayHoles, 2, 1) \ |
| 272 | F(GetArrayKeys, 2, 1) \ |
| 273 | F(MoveArrayContents, 2, 1) \ |
| 274 | F(EstimateNumberOfElements, 1, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 275 | \ |
| 276 | /* Getters and Setters */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 277 | F(LookupAccessor, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 278 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 279 | /* Literals */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 280 | F(MaterializeRegExpLiteral, 4, 1)\ |
vegorov@chromium.org | f837290 | 2010-03-15 10:26:20 +0000 | [diff] [blame] | 281 | F(CreateObjectLiteral, 4, 1) \ |
| 282 | F(CreateObjectLiteralShallow, 4, 1) \ |
kmillikin@chromium.org | 13bd294 | 2009-12-16 15:36:05 +0000 | [diff] [blame] | 283 | F(CreateArrayLiteral, 3, 1) \ |
| 284 | F(CreateArrayLiteralShallow, 3, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 285 | \ |
danno@chromium.org | 81cac2b | 2012-07-10 11:28:27 +0000 | [diff] [blame] | 286 | /* Harmony modules */ \ |
| 287 | F(IsJSModule, 1, 1) \ |
| 288 | \ |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 289 | /* Harmony proxies */ \ |
| 290 | F(CreateJSProxy, 2, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 291 | F(CreateJSFunctionProxy, 4, 1) \ |
erik.corry@gmail.com | d6076d9 | 2011-06-06 09:39:18 +0000 | [diff] [blame] | 292 | F(IsJSProxy, 1, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 293 | F(IsJSFunctionProxy, 1, 1) \ |
erik.corry@gmail.com | d6076d9 | 2011-06-06 09:39:18 +0000 | [diff] [blame] | 294 | F(GetHandler, 1, 1) \ |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 295 | F(GetCallTrap, 1, 1) \ |
| 296 | F(GetConstructTrap, 1, 1) \ |
rossberg@chromium.org | 717967f | 2011-07-20 13:44:42 +0000 | [diff] [blame] | 297 | F(Fix, 1, 1) \ |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 298 | \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 299 | /* Harmony sets */ \ |
| 300 | F(SetInitialize, 1, 1) \ |
| 301 | F(SetAdd, 2, 1) \ |
| 302 | F(SetHas, 2, 1) \ |
| 303 | F(SetDelete, 2, 1) \ |
| 304 | \ |
| 305 | /* Harmony maps */ \ |
| 306 | F(MapInitialize, 1, 1) \ |
| 307 | F(MapGet, 2, 1) \ |
jkummerow@chromium.org | 7a6fc81 | 2012-06-27 11:12:38 +0000 | [diff] [blame] | 308 | F(MapHas, 2, 1) \ |
| 309 | F(MapDelete, 2, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 310 | F(MapSet, 3, 1) \ |
| 311 | \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 312 | /* Harmony weakmaps */ \ |
| 313 | F(WeakMapInitialize, 1, 1) \ |
| 314 | F(WeakMapGet, 2, 1) \ |
jkummerow@chromium.org | 7a6fc81 | 2012-06-27 11:12:38 +0000 | [diff] [blame] | 315 | F(WeakMapHas, 2, 1) \ |
| 316 | F(WeakMapDelete, 2, 1) \ |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 317 | F(WeakMapSet, 3, 1) \ |
| 318 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 319 | /* Statements */ \ |
vegorov@chromium.org | 21b5e95 | 2010-11-23 10:24:40 +0000 | [diff] [blame] | 320 | F(NewClosure, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 321 | F(NewObject, 1, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 322 | F(NewObjectFromBound, 1, 1) \ |
whesse@chromium.org | 4a1fe7d | 2010-09-27 12:32:04 +0000 | [diff] [blame] | 323 | F(FinalizeInstanceSize, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 324 | F(Throw, 1, 1) \ |
| 325 | F(ReThrow, 1, 1) \ |
| 326 | F(ThrowReferenceError, 1, 1) \ |
whesse@chromium.org | 4a5224e | 2010-10-20 12:37:07 +0000 | [diff] [blame] | 327 | F(StackGuard, 0, 1) \ |
yangguo@chromium.org | 5645471 | 2012-02-16 15:33:53 +0000 | [diff] [blame] | 328 | F(Interrupt, 0, 1) \ |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 329 | F(PromoteScheduledException, 0, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 330 | \ |
| 331 | /* Contexts */ \ |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 332 | F(NewFunctionContext, 1, 1) \ |
vegorov@chromium.org | 3cf4731 | 2011-06-29 13:20:01 +0000 | [diff] [blame] | 333 | F(PushWithContext, 2, 1) \ |
| 334 | F(PushCatchContext, 3, 1) \ |
whesse@chromium.org | 4acdc2c | 2011-08-15 13:01:23 +0000 | [diff] [blame] | 335 | F(PushBlockContext, 2, 1) \ |
danno@chromium.org | 81cac2b | 2012-07-10 11:28:27 +0000 | [diff] [blame] | 336 | F(PushModuleContext, 1, 1) \ |
ager@chromium.org | 0ee099b | 2011-01-25 14:06:47 +0000 | [diff] [blame] | 337 | F(DeleteContextSlot, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 338 | F(LoadContextSlot, 2, 2) \ |
| 339 | F(LoadContextSlotNoReferenceError, 2, 2) \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 340 | F(StoreContextSlot, 4, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 341 | \ |
| 342 | /* Declarations and initialization */ \ |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 343 | F(DeclareGlobals, 3, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 344 | F(DeclareContextSlot, 4, 1) \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 345 | F(InitializeVarGlobal, -1 /* 2 or 3 */, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 346 | F(InitializeConstGlobal, 2, 1) \ |
| 347 | F(InitializeConstContextSlot, 3, 1) \ |
| 348 | F(OptimizeObjectForAddingMultipleProperties, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 349 | \ |
| 350 | /* Debugging */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 351 | F(DebugPrint, 1, 1) \ |
| 352 | F(DebugTrace, 0, 1) \ |
| 353 | F(TraceEnter, 0, 1) \ |
| 354 | F(TraceExit, 1, 1) \ |
| 355 | F(Abort, 2, 1) \ |
christian.plesner.hansen@gmail.com | 37abdec | 2009-01-06 14:43:28 +0000 | [diff] [blame] | 356 | /* Logging */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 357 | F(Log, 2, 1) \ |
christian.plesner.hansen@gmail.com | 2bc58ef | 2009-09-22 10:00:30 +0000 | [diff] [blame] | 358 | /* ES5 */ \ |
| 359 | F(LocalKeys, 1, 1) \ |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 360 | /* Cache suport */ \ |
| 361 | F(GetFromCache, 2, 1) \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 362 | \ |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 363 | /* Message objects */ \ |
| 364 | F(NewMessageObject, 2, 1) \ |
| 365 | F(MessageGetType, 1, 1) \ |
| 366 | F(MessageGetArguments, 1, 1) \ |
| 367 | F(MessageGetStartPosition, 1, 1) \ |
| 368 | F(MessageGetScript, 1, 1) \ |
| 369 | \ |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 370 | /* Pseudo functions - handled as macros by parser */ \ |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 371 | F(IS_VAR, 1, 1) \ |
| 372 | \ |
| 373 | /* expose boolean functions from objects-inl.h */ \ |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 374 | F(HasFastSmiElements, 1, 1) \ |
| 375 | F(HasFastSmiOrObjectElements, 1, 1) \ |
| 376 | F(HasFastObjectElements, 1, 1) \ |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 377 | F(HasFastDoubleElements, 1, 1) \ |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 378 | F(HasFastHoleyElements, 1, 1) \ |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 379 | F(HasDictionaryElements, 1, 1) \ |
| 380 | F(HasExternalPixelElements, 1, 1) \ |
| 381 | F(HasExternalArrayElements, 1, 1) \ |
| 382 | F(HasExternalByteElements, 1, 1) \ |
| 383 | F(HasExternalUnsignedByteElements, 1, 1) \ |
| 384 | F(HasExternalShortElements, 1, 1) \ |
| 385 | F(HasExternalUnsignedShortElements, 1, 1) \ |
| 386 | F(HasExternalIntElements, 1, 1) \ |
| 387 | F(HasExternalUnsignedIntElements, 1, 1) \ |
| 388 | F(HasExternalFloatElements, 1, 1) \ |
whesse@chromium.org | 030d38e | 2011-07-13 13:23:34 +0000 | [diff] [blame] | 389 | F(HasExternalDoubleElements, 1, 1) \ |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 390 | F(HasFastProperties, 1, 1) \ |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 391 | F(TransitionElementsSmiToDouble, 1, 1) \ |
| 392 | F(TransitionElementsDoubleToObject, 1, 1) \ |
rossberg@chromium.org | b4b2aa6 | 2011-10-13 09:49:59 +0000 | [diff] [blame] | 393 | F(HaveSameMap, 2, 1) \ |
whesse@chromium.org | 030d38e | 2011-07-13 13:23:34 +0000 | [diff] [blame] | 394 | /* profiler */ \ |
| 395 | F(ProfilerResume, 0, 1) \ |
| 396 | F(ProfilerPause, 0, 1) |
ricow@chromium.org | 4f693d6 | 2011-07-04 14:01:31 +0000 | [diff] [blame] | 397 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 398 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 399 | #ifdef ENABLE_DEBUGGER_SUPPORT |
| 400 | #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) \ |
| 401 | /* Debugger support*/ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 402 | F(DebugBreak, 0, 1) \ |
| 403 | F(SetDebugEventListener, 2, 1) \ |
| 404 | F(Break, 0, 1) \ |
| 405 | F(DebugGetPropertyDetails, 2, 1) \ |
| 406 | F(DebugGetProperty, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 407 | F(DebugPropertyTypeFromDetails, 1, 1) \ |
| 408 | F(DebugPropertyAttributesFromDetails, 1, 1) \ |
| 409 | F(DebugPropertyIndexFromDetails, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 410 | F(DebugNamedInterceptorPropertyValue, 2, 1) \ |
| 411 | F(DebugIndexedInterceptorElementValue, 2, 1) \ |
| 412 | F(CheckExecutionState, 1, 1) \ |
| 413 | F(GetFrameCount, 1, 1) \ |
| 414 | F(GetFrameDetails, 2, 1) \ |
| 415 | F(GetScopeCount, 2, 1) \ |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 416 | F(GetScopeDetails, 4, 1) \ |
danno@chromium.org | 1044a4d | 2012-04-30 12:34:39 +0000 | [diff] [blame] | 417 | F(GetFunctionScopeCount, 1, 1) \ |
| 418 | F(GetFunctionScopeDetails, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 419 | F(DebugPrintScopes, 0, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 420 | F(GetThreadCount, 1, 1) \ |
| 421 | F(GetThreadDetails, 2, 1) \ |
whesse@chromium.org | e90029b | 2010-08-02 11:52:17 +0000 | [diff] [blame] | 422 | F(SetDisableBreak, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 423 | F(GetBreakLocations, 1, 1) \ |
| 424 | F(SetFunctionBreakPoint, 3, 1) \ |
| 425 | F(SetScriptBreakPoint, 3, 1) \ |
| 426 | F(ClearBreakPoint, 1, 1) \ |
| 427 | F(ChangeBreakOnException, 2, 1) \ |
fschneider@chromium.org | c20610a | 2010-09-22 09:44:58 +0000 | [diff] [blame] | 428 | F(IsBreakOnException, 1, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 429 | F(PrepareStep, 3, 1) \ |
| 430 | F(ClearStepping, 0, 1) \ |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 431 | F(DebugEvaluate, 6, 1) \ |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 432 | F(DebugEvaluateGlobal, 4, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 433 | F(DebugGetLoadedScripts, 0, 1) \ |
| 434 | F(DebugReferencedBy, 3, 1) \ |
| 435 | F(DebugConstructedBy, 2, 1) \ |
| 436 | F(DebugGetPrototype, 1, 1) \ |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 437 | F(DebugSetScriptSource, 2, 1) \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 438 | F(SystemBreak, 0, 1) \ |
| 439 | F(DebugDisassembleFunction, 1, 1) \ |
| 440 | F(DebugDisassembleConstructor, 1, 1) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 441 | F(FunctionGetInferredName, 1, 1) \ |
| 442 | F(LiveEditFindSharedFunctionInfosForScript, 1, 1) \ |
| 443 | F(LiveEditGatherCompileInfo, 2, 1) \ |
| 444 | F(LiveEditReplaceScript, 3, 1) \ |
| 445 | F(LiveEditReplaceFunctionCode, 2, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 446 | F(LiveEditFunctionSourceUpdated, 1, 1) \ |
kmillikin@chromium.org | 4111b80 | 2010-05-03 10:34:42 +0000 | [diff] [blame] | 447 | F(LiveEditFunctionSetScript, 2, 1) \ |
| 448 | F(LiveEditReplaceRefToNestedFunction, 3, 1) \ |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 449 | F(LiveEditPatchFunctionPositions, 2, 1) \ |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 450 | F(LiveEditCheckAndDropActivations, 2, 1) \ |
sgjesse@chromium.org | c6c5718 | 2011-01-17 12:24:25 +0000 | [diff] [blame] | 451 | F(LiveEditCompareStrings, 2, 1) \ |
yangguo@chromium.org | 5a11aaf | 2012-06-20 11:29:00 +0000 | [diff] [blame] | 452 | F(LiveEditRestartFrame, 2, 1) \ |
ager@chromium.org | 357bf65 | 2010-04-12 11:30:10 +0000 | [diff] [blame] | 453 | F(GetFunctionCodePositionFromSource, 2, 1) \ |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 454 | F(ExecuteInDebugContext, 2, 1) \ |
| 455 | \ |
| 456 | F(SetFlags, 1, 1) \ |
| 457 | F(CollectGarbage, 1, 1) \ |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 458 | F(GetHeapUsage, 0, 1) \ |
| 459 | \ |
| 460 | /* LiveObjectList support*/ \ |
| 461 | F(HasLOLEnabled, 0, 1) \ |
| 462 | F(CaptureLOL, 0, 1) \ |
| 463 | F(DeleteLOL, 1, 1) \ |
| 464 | F(DumpLOL, 5, 1) \ |
| 465 | F(GetLOLObj, 1, 1) \ |
| 466 | F(GetLOLObjId, 1, 1) \ |
| 467 | F(GetLOLObjRetainers, 6, 1) \ |
| 468 | F(GetLOLPath, 3, 1) \ |
| 469 | F(InfoLOL, 2, 1) \ |
| 470 | F(PrintLOLObj, 1, 1) \ |
| 471 | F(ResetLOL, 0, 1) \ |
| 472 | F(SummarizeLOL, 3, 1) |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 473 | |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 474 | #else |
| 475 | #define RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) |
| 476 | #endif |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 477 | |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 478 | #ifdef DEBUG |
| 479 | #define RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
| 480 | /* Testing */ \ |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 481 | F(ListNatives, 0, 1) |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 482 | #else |
| 483 | #define RUNTIME_FUNCTION_LIST_DEBUG(F) |
| 484 | #endif |
| 485 | |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 486 | // ---------------------------------------------------------------------------- |
| 487 | // RUNTIME_FUNCTION_LIST defines all runtime functions accessed |
| 488 | // either directly by id (via the code generator), or indirectly |
| 489 | // via a native call by name (from within JS code). |
| 490 | |
| 491 | #define RUNTIME_FUNCTION_LIST(F) \ |
ager@chromium.org | ce58e17 | 2009-05-13 07:11:48 +0000 | [diff] [blame] | 492 | RUNTIME_FUNCTION_LIST_ALWAYS_1(F) \ |
| 493 | RUNTIME_FUNCTION_LIST_ALWAYS_2(F) \ |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 494 | RUNTIME_FUNCTION_LIST_DEBUG(F) \ |
whesse@chromium.org | 030d38e | 2011-07-13 13:23:34 +0000 | [diff] [blame] | 495 | RUNTIME_FUNCTION_LIST_DEBUGGER_SUPPORT(F) |
kasper.lund | 4451067 | 2008-07-25 07:37:58 +0000 | [diff] [blame] | 496 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 497 | // ---------------------------------------------------------------------------- |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 498 | // INLINE_FUNCTION_LIST defines all inlined functions accessed |
| 499 | // with a native call of the form %_name from within JS code. |
| 500 | // Entries have the form F(name, number of arguments, number of return values). |
| 501 | #define INLINE_FUNCTION_LIST(F) \ |
| 502 | F(IsSmi, 1, 1) \ |
| 503 | F(IsNonNegativeSmi, 1, 1) \ |
| 504 | F(IsArray, 1, 1) \ |
| 505 | F(IsRegExp, 1, 1) \ |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 506 | F(IsConstructCall, 0, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 507 | F(CallFunction, -1 /* receiver + n args + function */, 1) \ |
| 508 | F(ArgumentsLength, 0, 1) \ |
| 509 | F(Arguments, 1, 1) \ |
| 510 | F(ValueOf, 1, 1) \ |
| 511 | F(SetValueOf, 2, 1) \ |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 512 | F(DateField, 2 /* date object, field index */, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 513 | F(StringCharFromCode, 1, 1) \ |
| 514 | F(StringCharAt, 2, 1) \ |
| 515 | F(ObjectEquals, 2, 1) \ |
| 516 | F(RandomHeapNumber, 0, 1) \ |
| 517 | F(IsObject, 1, 1) \ |
| 518 | F(IsFunction, 1, 1) \ |
| 519 | F(IsUndetectableObject, 1, 1) \ |
| 520 | F(IsSpecObject, 1, 1) \ |
| 521 | F(IsStringWrapperSafeForDefaultValueOf, 1, 1) \ |
| 522 | F(MathPow, 2, 1) \ |
| 523 | F(MathSin, 1, 1) \ |
| 524 | F(MathCos, 1, 1) \ |
mstarzinger@chromium.org | 1b3afd1 | 2011-11-29 14:28:56 +0000 | [diff] [blame] | 525 | F(MathTan, 1, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 526 | F(MathSqrt, 1, 1) \ |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 527 | F(MathLog, 1, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 528 | F(IsRegExpEquivalent, 2, 1) \ |
| 529 | F(HasCachedArrayIndex, 1, 1) \ |
vegorov@chromium.org | 21b5e95 | 2010-11-23 10:24:40 +0000 | [diff] [blame] | 530 | F(GetCachedArrayIndex, 1, 1) \ |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 531 | F(FastAsciiArrayJoin, 2, 1) |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 532 | |
| 533 | |
| 534 | // ---------------------------------------------------------------------------- |
| 535 | // INLINE_AND_RUNTIME_FUNCTION_LIST defines all inlined functions accessed |
| 536 | // 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] | 537 | // a corresponding runtime function, that is called for slow cases. |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 538 | // Entries have the form F(name, number of arguments, number of return values). |
| 539 | #define INLINE_RUNTIME_FUNCTION_LIST(F) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 540 | F(ClassOf, 1, 1) \ |
| 541 | F(StringCharCodeAt, 2, 1) \ |
| 542 | F(Log, 3, 1) \ |
| 543 | F(StringAdd, 2, 1) \ |
| 544 | F(SubString, 3, 1) \ |
| 545 | F(StringCompare, 2, 1) \ |
| 546 | F(RegExpExec, 4, 1) \ |
| 547 | F(RegExpConstructResult, 3, 1) \ |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 548 | F(GetFromCache, 2, 1) \ |
ulan@chromium.org | d6899c3 | 2012-05-18 14:12:25 +0000 | [diff] [blame] | 549 | F(NumberToString, 1, 1) |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 550 | |
| 551 | |
| 552 | //--------------------------------------------------------------------------- |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 553 | // Runtime provides access to all C++ runtime functions. |
| 554 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 555 | class RuntimeState { |
| 556 | public: |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 557 | StaticResource<StringInputBuffer>* string_input_buffer() { |
| 558 | return &string_input_buffer_; |
| 559 | } |
| 560 | unibrow::Mapping<unibrow::ToUppercase, 128>* to_upper_mapping() { |
| 561 | return &to_upper_mapping_; |
| 562 | } |
| 563 | unibrow::Mapping<unibrow::ToLowercase, 128>* to_lower_mapping() { |
| 564 | return &to_lower_mapping_; |
| 565 | } |
| 566 | StringInputBuffer* string_input_buffer_compare_bufx() { |
| 567 | return &string_input_buffer_compare_bufx_; |
| 568 | } |
| 569 | StringInputBuffer* string_input_buffer_compare_bufy() { |
| 570 | return &string_input_buffer_compare_bufy_; |
| 571 | } |
| 572 | StringInputBuffer* string_locale_compare_buf1() { |
| 573 | return &string_locale_compare_buf1_; |
| 574 | } |
| 575 | StringInputBuffer* string_locale_compare_buf2() { |
| 576 | return &string_locale_compare_buf2_; |
| 577 | } |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 578 | |
| 579 | private: |
| 580 | RuntimeState() {} |
| 581 | // Non-reentrant string buffer for efficient general use in the runtime. |
| 582 | StaticResource<StringInputBuffer> string_input_buffer_; |
| 583 | unibrow::Mapping<unibrow::ToUppercase, 128> to_upper_mapping_; |
| 584 | unibrow::Mapping<unibrow::ToLowercase, 128> to_lower_mapping_; |
| 585 | StringInputBuffer string_input_buffer_compare_bufx_; |
| 586 | StringInputBuffer string_input_buffer_compare_bufy_; |
| 587 | StringInputBuffer string_locale_compare_buf1_; |
| 588 | StringInputBuffer string_locale_compare_buf2_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 589 | |
| 590 | friend class Isolate; |
| 591 | friend class Runtime; |
| 592 | |
| 593 | DISALLOW_COPY_AND_ASSIGN(RuntimeState); |
| 594 | }; |
| 595 | |
| 596 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 597 | class Runtime : public AllStatic { |
| 598 | public: |
| 599 | enum FunctionId { |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 600 | #define F(name, nargs, ressize) k##name, |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 601 | RUNTIME_FUNCTION_LIST(F) |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 602 | #undef F |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 603 | #define F(name, nargs, ressize) kInline##name, |
| 604 | INLINE_FUNCTION_LIST(F) |
| 605 | INLINE_RUNTIME_FUNCTION_LIST(F) |
| 606 | #undef F |
| 607 | kNumFunctions, |
| 608 | kFirstInlineFunction = kInlineIsSmi |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 609 | }; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 610 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 611 | enum IntrinsicType { |
| 612 | RUNTIME, |
| 613 | INLINE |
| 614 | }; |
| 615 | |
| 616 | // Intrinsic function descriptor. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 617 | struct Function { |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 618 | FunctionId function_id; |
| 619 | IntrinsicType intrinsic_type; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 620 | // The JS name of the function. |
| 621 | const char* name; |
| 622 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 623 | // The C++ (native) entry point. NULL if the function is inlined. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 624 | byte* entry; |
| 625 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 626 | // The number of arguments expected. nargs is -1 if the function takes |
| 627 | // a variable number of arguments. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 628 | int nargs; |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 629 | // Size of result. Most functions return a single pointer, size 1. |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 630 | int result_size; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 631 | }; |
| 632 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 633 | static const int kNotFound = -1; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 634 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 635 | // Add symbols for all the intrinsic function names to a StringDictionary. |
| 636 | // Returns failure if an allocation fails. In this case, it must be |
| 637 | // retried with a new, empty StringDictionary, not with the same one. |
| 638 | // Alternatively, heap initialization can be completely restarted. |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 639 | MUST_USE_RESULT static MaybeObject* InitializeIntrinsicFunctionNames( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 640 | Heap* heap, Object* dictionary); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 641 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 642 | // Get the intrinsic function with the given name, which must be a symbol. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 643 | static const Function* FunctionForSymbol(Handle<String> name); |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 644 | |
| 645 | // Get the intrinsic function with the given FunctionId. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 646 | static const Function* FunctionForId(FunctionId id); |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 647 | |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 648 | static Handle<String> StringReplaceOneCharWithString(Isolate* isolate, |
| 649 | Handle<String> subject, |
| 650 | Handle<String> search, |
| 651 | Handle<String> replace, |
| 652 | bool* found, |
| 653 | int recursion_limit); |
| 654 | |
erik.corry@gmail.com | d88afa2 | 2010-09-15 12:33:05 +0000 | [diff] [blame] | 655 | // General-purpose helper functions for runtime system. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 656 | static int StringMatch(Isolate* isolate, |
| 657 | Handle<String> sub, |
| 658 | Handle<String> pat, |
| 659 | int index); |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 660 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 661 | static bool IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch); |
kasperl@chromium.org | d1e3e72 | 2009-04-14 13:38:25 +0000 | [diff] [blame] | 662 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 663 | // TODO(1240886): Some of the following methods are *not* handle safe, but |
| 664 | // accept handle arguments. This seems fragile. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 665 | |
| 666 | // Support getting the characters in a string using [] notation as |
| 667 | // in Firefox/SpiderMonkey, Safari and Opera. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 668 | MUST_USE_RESULT static MaybeObject* GetElementOrCharAt(Isolate* isolate, |
| 669 | Handle<Object> object, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 670 | uint32_t index); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 671 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 672 | MUST_USE_RESULT static MaybeObject* SetObjectProperty( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 673 | Isolate* isolate, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 674 | Handle<Object> object, |
| 675 | Handle<Object> key, |
| 676 | Handle<Object> value, |
ager@chromium.org | 9ee27ae | 2011-03-02 13:43:26 +0000 | [diff] [blame] | 677 | PropertyAttributes attr, |
karlklose@chromium.org | 8f806e8 | 2011-03-07 14:06:08 +0000 | [diff] [blame] | 678 | StrictModeFlag strict_mode); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 679 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 680 | MUST_USE_RESULT static MaybeObject* ForceSetObjectProperty( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 681 | Isolate* isolate, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 682 | Handle<JSObject> object, |
| 683 | Handle<Object> key, |
| 684 | Handle<Object> value, |
| 685 | PropertyAttributes attr); |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 686 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 687 | MUST_USE_RESULT static MaybeObject* ForceDeleteObjectProperty( |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 688 | Isolate* isolate, |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 689 | Handle<JSReceiver> object, |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 690 | Handle<Object> key); |
ager@chromium.org | e2902be | 2009-06-08 12:21:35 +0000 | [diff] [blame] | 691 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 692 | MUST_USE_RESULT static MaybeObject* GetObjectProperty( |
| 693 | Isolate* isolate, |
| 694 | Handle<Object> object, |
| 695 | Handle<Object> key); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 696 | |
kasperl@chromium.org | d1e3e72 | 2009-04-14 13:38:25 +0000 | [diff] [blame] | 697 | // This function is used in FunctionNameUsing* tests. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 698 | static Object* FindSharedFunctionInfoInScript(Isolate* isolate, |
| 699 | Handle<Script> script, |
kasperl@chromium.org | d1e3e72 | 2009-04-14 13:38:25 +0000 | [diff] [blame] | 700 | int position); |
| 701 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 702 | // Helper functions used stubs. |
| 703 | static void PerformGC(Object* result); |
ricow@chromium.org | 7ad6522 | 2011-12-19 12:13:11 +0000 | [diff] [blame] | 704 | |
| 705 | // Used in runtime.cc and hydrogen's VisitArrayLiteral. |
| 706 | static Handle<Object> CreateArrayLiteralBoilerplate( |
| 707 | Isolate* isolate, |
| 708 | Handle<FixedArray> literals, |
| 709 | Handle<FixedArray> elements); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 710 | }; |
| 711 | |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 712 | |
| 713 | //--------------------------------------------------------------------------- |
| 714 | // Constants used by interface to runtime functions. |
| 715 | |
mstarzinger@chromium.org | 1b3afd1 | 2011-11-29 14:28:56 +0000 | [diff] [blame] | 716 | class DeclareGlobalsEvalFlag: public BitField<bool, 0, 1> {}; |
| 717 | class DeclareGlobalsNativeFlag: public BitField<bool, 1, 1> {}; |
| 718 | class DeclareGlobalsLanguageMode: public BitField<LanguageMode, 2, 2> {}; |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 719 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 720 | } } // namespace v8::internal |
| 721 | |
| 722 | #endif // V8_RUNTIME_H_ |