kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 1 | # Copyright 2006-2009 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 | # Dictionary that is passed as defines for js2c.py. |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 29 | # Used for defines that must be defined for all native JS files. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 30 | |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 31 | const NONE = 0; |
| 32 | const READ_ONLY = 1; |
| 33 | const DONT_ENUM = 2; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 34 | const DONT_DELETE = 4; |
mstarzinger@chromium.org | 32280cf | 2012-12-06 17:32:37 +0000 | [diff] [blame] | 35 | const NEW_ONE_BYTE_STRING = true; |
| 36 | const NEW_TWO_BYTE_STRING = false; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 37 | |
| 38 | # Constants used for getter and setter operations. |
| 39 | const GETTER = 0; |
| 40 | const SETTER = 1; |
| 41 | |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 42 | # These definitions must match the index of the properties in objects.h. |
ager@chromium.org | 04921a8 | 2011-06-27 13:21:41 +0000 | [diff] [blame] | 43 | const kApiTagOffset = 0; |
| 44 | const kApiPropertyListOffset = 1; |
jkummerow@chromium.org | 3d00d0a | 2013-09-04 13:57:32 +0000 | [diff] [blame] | 45 | const kApiSerialNumberOffset = 3; |
| 46 | const kApiConstructorOffset = 3; |
ager@chromium.org | 04921a8 | 2011-06-27 13:21:41 +0000 | [diff] [blame] | 47 | const kApiPrototypeTemplateOffset = 5; |
| 48 | const kApiParentTemplateOffset = 6; |
ricow@chromium.org | 2c99e28 | 2011-07-28 09:15:17 +0000 | [diff] [blame] | 49 | const kApiFlagOffset = 14; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 50 | |
| 51 | const NO_HINT = 0; |
| 52 | const NUMBER_HINT = 1; |
| 53 | const STRING_HINT = 2; |
| 54 | |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 55 | const kFunctionTag = 0; |
| 56 | const kNewObjectTag = 1; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 57 | |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 58 | # For date.js. |
| 59 | const HoursPerDay = 24; |
| 60 | const MinutesPerHour = 60; |
| 61 | const SecondsPerMinute = 60; |
| 62 | const msPerSecond = 1000; |
| 63 | const msPerMinute = 60000; |
| 64 | const msPerHour = 3600000; |
| 65 | const msPerDay = 86400000; |
ager@chromium.org | eadaf22 | 2009-06-16 09:43:10 +0000 | [diff] [blame] | 66 | const msPerMonth = 2592000000; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 67 | |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 68 | # For apinatives.js |
| 69 | const kUninitialized = -1; |
verwaest@chromium.org | 662436e | 2013-08-28 08:41:27 +0000 | [diff] [blame] | 70 | const kReadOnlyPrototypeBit = 3; |
| 71 | const kRemovePrototypeBit = 4; # For FunctionTemplateInfo, matches objects.h |
dslomov@chromium.org | 639bac0 | 2013-09-09 11:58:54 +0000 | [diff] [blame] | 72 | const kDoNotCacheBit = 5; # For FunctionTemplateInfo, matches objects.h |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 73 | |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 74 | # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1). |
| 75 | const kInvalidDate = 'Invalid Date'; |
| 76 | const kDayZeroInJulianDay = 2440588; |
| 77 | const kMonthMask = 0x1e0; |
| 78 | const kDayMask = 0x01f; |
| 79 | const kYearShift = 9; |
| 80 | const kMonthShift = 5; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 81 | |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 82 | # Limits for parts of the date, so that we support all the dates that |
| 83 | # ECMA 262 - 15.9.1.1 requires us to, but at the same time be sure that |
| 84 | # the date (days since 1970) is in SMI range. |
| 85 | const kMinYear = -1000000; |
| 86 | const kMaxYear = 1000000; |
| 87 | const kMinMonth = -10000000; |
| 88 | const kMaxMonth = 10000000; |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 89 | |
ricow@chromium.org | c9c8082 | 2010-04-21 08:22:37 +0000 | [diff] [blame] | 90 | # Native cache ids. |
| 91 | const STRING_TO_REGEXP_CACHE_ID = 0; |
| 92 | |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 93 | # Type query macros. |
fschneider@chromium.org | b95b98b | 2010-02-23 10:34:29 +0000 | [diff] [blame] | 94 | # |
| 95 | # Note: We have special support for typeof(foo) === 'bar' in the compiler. |
| 96 | # It will *not* generate a runtime typeof call for the most important |
| 97 | # values of 'bar'. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 98 | macro IS_NULL(arg) = (arg === null); |
| 99 | macro IS_NULL_OR_UNDEFINED(arg) = (arg == null); |
| 100 | macro IS_UNDEFINED(arg) = (typeof(arg) === 'undefined'); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 101 | macro IS_NUMBER(arg) = (typeof(arg) === 'number'); |
| 102 | macro IS_STRING(arg) = (typeof(arg) === 'string'); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 103 | macro IS_BOOLEAN(arg) = (typeof(arg) === 'boolean'); |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 104 | macro IS_SYMBOL(arg) = (typeof(arg) === 'symbol'); |
ager@chromium.org | 6141cbe | 2009-11-20 12:14:52 +0000 | [diff] [blame] | 105 | macro IS_OBJECT(arg) = (%_IsObject(arg)); |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 106 | macro IS_ARRAY(arg) = (%_IsArray(arg)); |
ager@chromium.org | 6141cbe | 2009-11-20 12:14:52 +0000 | [diff] [blame] | 107 | macro IS_FUNCTION(arg) = (%_IsFunction(arg)); |
fschneider@chromium.org | b95b98b | 2010-02-23 10:34:29 +0000 | [diff] [blame] | 108 | macro IS_REGEXP(arg) = (%_IsRegExp(arg)); |
rossberg@chromium.org | fab1498 | 2012-01-05 15:02:15 +0000 | [diff] [blame] | 109 | macro IS_SET(arg) = (%_ClassOf(arg) === 'Set'); |
| 110 | macro IS_MAP(arg) = (%_ClassOf(arg) === 'Map'); |
| 111 | macro IS_WEAKMAP(arg) = (%_ClassOf(arg) === 'WeakMap'); |
jkummerow@chromium.org | ba72ec8 | 2013-07-22 09:21:20 +0000 | [diff] [blame] | 112 | macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet'); |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 113 | macro IS_DATE(arg) = (%_ClassOf(arg) === 'Date'); |
| 114 | macro IS_NUMBER_WRAPPER(arg) = (%_ClassOf(arg) === 'Number'); |
| 115 | macro IS_STRING_WRAPPER(arg) = (%_ClassOf(arg) === 'String'); |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 116 | macro IS_SYMBOL_WRAPPER(arg) = (%_ClassOf(arg) === 'Symbol'); |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 117 | macro IS_BOOLEAN_WRAPPER(arg) = (%_ClassOf(arg) === 'Boolean'); |
| 118 | macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); |
| 119 | macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); |
| 120 | macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments'); |
| 121 | macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); |
danno@chromium.org | f005df6 | 2013-04-30 16:36:45 +0000 | [diff] [blame] | 122 | macro IS_ARRAYBUFFER(arg) = (%_ClassOf(arg) === 'ArrayBuffer'); |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 123 | macro IS_DATAVIEW(arg) = (%_ClassOf(arg) === 'DataView'); |
mstarzinger@chromium.org | b228be0 | 2013-04-18 14:56:59 +0000 | [diff] [blame] | 124 | macro IS_GENERATOR(arg) = (%_ClassOf(arg) === 'Generator'); |
sgjesse@chromium.org | b302e56 | 2010-02-03 11:26:59 +0000 | [diff] [blame] | 125 | macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg)); |
fschneider@chromium.org | 0c20e67 | 2010-01-14 15:28:53 +0000 | [diff] [blame] | 126 | macro FLOOR(arg) = $floor(arg); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 127 | |
vegorov@chromium.org | dff694e | 2010-05-17 09:10:26 +0000 | [diff] [blame] | 128 | # Macro for ECMAScript 5 queries of the type: |
| 129 | # "Type(O) is object." |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 130 | # This is the same as being either a function or an object in V8 terminology |
| 131 | # (including proxies). |
ricow@chromium.org | 4980dff | 2010-07-19 08:33:45 +0000 | [diff] [blame] | 132 | # In addition, an undetectable object is also included by this. |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 133 | macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); |
| 134 | |
| 135 | # Macro for ECMAScript 5 queries of the type: |
| 136 | # "IsCallable(O)" |
| 137 | # We assume here that this is the same as being either a function or a function |
| 138 | # proxy. That ignores host objects with [[Call]] methods, but in most situations |
| 139 | # we cannot handle those anyway. |
| 140 | macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); |
vegorov@chromium.org | dff694e | 2010-05-17 09:10:26 +0000 | [diff] [blame] | 141 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 142 | # Indices in bound function info retrieved by %BoundFunctionGetBindings(...). |
| 143 | const kBoundFunctionIndex = 0; |
| 144 | const kBoundThisIndex = 1; |
| 145 | const kBoundArgumentsStartIndex = 2; |
| 146 | |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 147 | # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. |
| 148 | macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
jkummerow@chromium.org | 486075a | 2011-09-07 12:44:28 +0000 | [diff] [blame] | 149 | macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0))); |
ricow@chromium.org | 65fae84 | 2010-08-25 15:26:24 +0000 | [diff] [blame] | 150 | macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber(arg))); |
mstarzinger@chromium.org | e0e1b0d | 2013-07-08 08:38:06 +0000 | [diff] [blame] | 151 | macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber(arg)); |
kmillikin@chromium.org | 69ea396 | 2010-07-05 11:01:40 +0000 | [diff] [blame] | 152 | macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToIntegerMapMinusZero(ToNumber(arg))); |
fschneider@chromium.org | b95b98b | 2010-02-23 10:34:29 +0000 | [diff] [blame] | 153 | macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); |
| 154 | macro TO_UINT32(arg) = (arg >>> 0); |
| 155 | macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString(arg)); |
kmillikin@chromium.org | d2c22f0 | 2011-01-10 08:15:37 +0000 | [diff] [blame] | 156 | macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber(arg)); |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 157 | macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg)); |
ricow@chromium.org | d2be901 | 2011-06-01 06:00:58 +0000 | [diff] [blame] | 158 | macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 159 | |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 160 | # Macros implemented in Python. |
| 161 | python macro CHAR_CODE(str) = ord(str[1]); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 162 | |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 163 | # Constants used on an array to implement the properties of the RegExp object. |
| 164 | const REGEXP_NUMBER_OF_CAPTURES = 0; |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 165 | const REGEXP_FIRST_CAPTURE = 3; |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 166 | |
| 167 | # We can't put macros in macros so we use constants here. |
| 168 | # REGEXP_NUMBER_OF_CAPTURES |
| 169 | macro NUMBER_OF_CAPTURES(array) = ((array)[0]); |
| 170 | |
kmillikin@chromium.org | 5d8f0e6 | 2010-03-24 08:21:20 +0000 | [diff] [blame] | 171 | # Limit according to ECMA 262 15.9.1.1 |
| 172 | const MAX_TIME_MS = 8640000000000000; |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 173 | # Limit which is MAX_TIME_MS + msPerMonth. |
| 174 | const MAX_TIME_BEFORE_UTC = 8640002592000000; |
kmillikin@chromium.org | 5d8f0e6 | 2010-03-24 08:21:20 +0000 | [diff] [blame] | 175 | |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 176 | # Gets the value of a Date object. If arg is not a Date object |
| 177 | # a type error is thrown. |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 178 | macro CHECK_DATE(arg) = if (%_ClassOf(arg) !== 'Date') ThrowDateTypeError(); |
| 179 | macro LOCAL_DATE_VALUE(arg) = (%_DateField(arg, 0) + %_DateField(arg, 21)); |
| 180 | macro UTC_DATE_VALUE(arg) = (%_DateField(arg, 0)); |
| 181 | |
| 182 | macro LOCAL_YEAR(arg) = (%_DateField(arg, 1)); |
| 183 | macro LOCAL_MONTH(arg) = (%_DateField(arg, 2)); |
| 184 | macro LOCAL_DAY(arg) = (%_DateField(arg, 3)); |
| 185 | macro LOCAL_WEEKDAY(arg) = (%_DateField(arg, 4)); |
| 186 | macro LOCAL_HOUR(arg) = (%_DateField(arg, 5)); |
| 187 | macro LOCAL_MIN(arg) = (%_DateField(arg, 6)); |
| 188 | macro LOCAL_SEC(arg) = (%_DateField(arg, 7)); |
| 189 | macro LOCAL_MS(arg) = (%_DateField(arg, 8)); |
| 190 | macro LOCAL_DAYS(arg) = (%_DateField(arg, 9)); |
| 191 | macro LOCAL_TIME_IN_DAY(arg) = (%_DateField(arg, 10)); |
| 192 | |
| 193 | macro UTC_YEAR(arg) = (%_DateField(arg, 11)); |
| 194 | macro UTC_MONTH(arg) = (%_DateField(arg, 12)); |
| 195 | macro UTC_DAY(arg) = (%_DateField(arg, 13)); |
| 196 | macro UTC_WEEKDAY(arg) = (%_DateField(arg, 14)); |
| 197 | macro UTC_HOUR(arg) = (%_DateField(arg, 15)); |
| 198 | macro UTC_MIN(arg) = (%_DateField(arg, 16)); |
| 199 | macro UTC_SEC(arg) = (%_DateField(arg, 17)); |
| 200 | macro UTC_MS(arg) = (%_DateField(arg, 18)); |
| 201 | macro UTC_DAYS(arg) = (%_DateField(arg, 19)); |
| 202 | macro UTC_TIME_IN_DAY(arg) = (%_DateField(arg, 20)); |
| 203 | |
| 204 | macro TIMEZONE_OFFSET(arg) = (%_DateField(arg, 21)); |
| 205 | |
| 206 | macro SET_UTC_DATE_VALUE(arg, value) = (%DateSetValue(arg, value, 1)); |
| 207 | macro SET_LOCAL_DATE_VALUE(arg, value) = (%DateSetValue(arg, value, 0)); |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 208 | |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 209 | # Last input and last subject of regexp matches. |
yangguo@chromium.org | efdb9d7 | 2012-04-26 08:21:05 +0000 | [diff] [blame] | 210 | const LAST_SUBJECT_INDEX = 1; |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 211 | macro LAST_SUBJECT(array) = ((array)[1]); |
| 212 | macro LAST_INPUT(array) = ((array)[2]); |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 213 | |
| 214 | # REGEXP_FIRST_CAPTURE |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 215 | macro CAPTURE(index) = (3 + (index)); |
| 216 | const CAPTURE0 = 3; |
| 217 | const CAPTURE1 = 4; |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 218 | |
erik.corry@gmail.com | ed49e96 | 2012-04-17 11:57:53 +0000 | [diff] [blame] | 219 | # For the regexp capture override array. This has the same |
| 220 | # format as the arguments to a function called from |
| 221 | # String.prototype.replace. |
| 222 | macro OVERRIDE_MATCH(override) = ((override)[0]); |
| 223 | macro OVERRIDE_POS(override) = ((override)[(override).length - 2]); |
| 224 | macro OVERRIDE_SUBJECT(override) = ((override)[(override).length - 1]); |
| 225 | # 1-based so index of 1 returns the first capture |
| 226 | macro OVERRIDE_CAPTURE(override, index) = ((override)[(index)]); |
| 227 | |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 228 | # PropertyDescriptor return value indices - must match |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 229 | # PropertyDescriptorIndices in runtime.cc. |
| 230 | const IS_ACCESSOR_INDEX = 0; |
| 231 | const VALUE_INDEX = 1; |
| 232 | const GETTER_INDEX = 2; |
| 233 | const SETTER_INDEX = 3; |
| 234 | const WRITABLE_INDEX = 4; |
| 235 | const ENUMERABLE_INDEX = 5; |
| 236 | const CONFIGURABLE_INDEX = 6; |
fschneider@chromium.org | 1805e21 | 2011-09-05 10:49:12 +0000 | [diff] [blame] | 237 | |
| 238 | # For messages.js |
| 239 | # Matches Script::Type from objects.h |
| 240 | const TYPE_NATIVE = 0; |
| 241 | const TYPE_EXTENSION = 1; |
| 242 | const TYPE_NORMAL = 2; |
| 243 | |
| 244 | # Matches Script::CompilationType from objects.h |
| 245 | const COMPILATION_TYPE_HOST = 0; |
| 246 | const COMPILATION_TYPE_EVAL = 1; |
| 247 | const COMPILATION_TYPE_JSON = 2; |
| 248 | |
| 249 | # Matches Messages::kNoLineNumberInfo from v8.h |
| 250 | const kNoLineNumberInfo = 0; |