ulan@chromium.org | 65a89c2 | 2012-02-14 11:46:07 +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 | #include "v8.h" |
| 29 | |
| 30 | #include "disassembler.h" |
| 31 | #include "disasm.h" |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 32 | #include "jsregexp.h" |
danno@chromium.org | 94b0d6f | 2013-02-04 13:33:20 +0000 | [diff] [blame] | 33 | #include "macro-assembler.h" |
ricow@chromium.org | 65fae84 | 2010-08-25 15:26:24 +0000 | [diff] [blame] | 34 | #include "objects-visiting.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 35 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 36 | namespace v8 { |
| 37 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 38 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 39 | #ifdef VERIFY_HEAP |
fschneider@chromium.org | 9e3e0b6 | 2011-01-03 10:16:46 +0000 | [diff] [blame] | 40 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 41 | void MaybeObject::Verify() { |
| 42 | Object* this_as_object; |
| 43 | if (ToObject(&this_as_object)) { |
| 44 | if (this_as_object->IsSmi()) { |
| 45 | Smi::cast(this_as_object)->SmiVerify(); |
| 46 | } else { |
| 47 | HeapObject::cast(this_as_object)->HeapObjectVerify(); |
| 48 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 49 | } else { |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 50 | Failure::cast(this)->FailureVerify(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 51 | } |
| 52 | } |
| 53 | |
| 54 | |
| 55 | void Object::VerifyPointer(Object* p) { |
| 56 | if (p->IsHeapObject()) { |
| 57 | HeapObject::VerifyHeapPointer(p); |
| 58 | } else { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 59 | CHECK(p->IsSmi()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 60 | } |
| 61 | } |
| 62 | |
| 63 | |
| 64 | void Smi::SmiVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 65 | CHECK(IsSmi()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | |
| 69 | void Failure::FailureVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 70 | CHECK(IsFailure()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 74 | void HeapObject::HeapObjectVerify() { |
| 75 | InstanceType instance_type = map()->instance_type(); |
| 76 | |
| 77 | if (instance_type < FIRST_NONSTRING_TYPE) { |
| 78 | String::cast(this)->StringVerify(); |
| 79 | return; |
| 80 | } |
| 81 | |
| 82 | switch (instance_type) { |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 83 | case SYMBOL_TYPE: |
| 84 | Symbol::cast(this)->SymbolVerify(); |
| 85 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 86 | case MAP_TYPE: |
| 87 | Map::cast(this)->MapVerify(); |
| 88 | break; |
| 89 | case HEAP_NUMBER_TYPE: |
| 90 | HeapNumber::cast(this)->HeapNumberVerify(); |
| 91 | break; |
| 92 | case FIXED_ARRAY_TYPE: |
| 93 | FixedArray::cast(this)->FixedArrayVerify(); |
| 94 | break; |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 95 | case FIXED_DOUBLE_ARRAY_TYPE: |
| 96 | FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
| 97 | break; |
mstarzinger@chromium.org | a2e1a40 | 2013-10-15 08:25:05 +0000 | [diff] [blame^] | 98 | case CONSTANT_POOL_ARRAY_TYPE: |
| 99 | ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); |
| 100 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 101 | case BYTE_ARRAY_TYPE: |
| 102 | ByteArray::cast(this)->ByteArrayVerify(); |
| 103 | break; |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 104 | case FREE_SPACE_TYPE: |
| 105 | FreeSpace::cast(this)->FreeSpaceVerify(); |
| 106 | break; |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 107 | case EXTERNAL_PIXEL_ARRAY_TYPE: |
| 108 | ExternalPixelArray::cast(this)->ExternalPixelArrayVerify(); |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 109 | break; |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 110 | case EXTERNAL_BYTE_ARRAY_TYPE: |
| 111 | ExternalByteArray::cast(this)->ExternalByteArrayVerify(); |
| 112 | break; |
| 113 | case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
| 114 | ExternalUnsignedByteArray::cast(this)->ExternalUnsignedByteArrayVerify(); |
| 115 | break; |
| 116 | case EXTERNAL_SHORT_ARRAY_TYPE: |
| 117 | ExternalShortArray::cast(this)->ExternalShortArrayVerify(); |
| 118 | break; |
| 119 | case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
| 120 | ExternalUnsignedShortArray::cast(this)-> |
| 121 | ExternalUnsignedShortArrayVerify(); |
| 122 | break; |
| 123 | case EXTERNAL_INT_ARRAY_TYPE: |
| 124 | ExternalIntArray::cast(this)->ExternalIntArrayVerify(); |
| 125 | break; |
| 126 | case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
| 127 | ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayVerify(); |
| 128 | break; |
| 129 | case EXTERNAL_FLOAT_ARRAY_TYPE: |
| 130 | ExternalFloatArray::cast(this)->ExternalFloatArrayVerify(); |
| 131 | break; |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 132 | case EXTERNAL_DOUBLE_ARRAY_TYPE: |
| 133 | ExternalDoubleArray::cast(this)->ExternalDoubleArrayVerify(); |
| 134 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 135 | case CODE_TYPE: |
| 136 | Code::cast(this)->CodeVerify(); |
| 137 | break; |
| 138 | case ODDBALL_TYPE: |
| 139 | Oddball::cast(this)->OddballVerify(); |
| 140 | break; |
| 141 | case JS_OBJECT_TYPE: |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 142 | case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 143 | JSObject::cast(this)->JSObjectVerify(); |
| 144 | break; |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 145 | case JS_GENERATOR_OBJECT_TYPE: |
| 146 | JSGeneratorObject::cast(this)->JSGeneratorObjectVerify(); |
| 147 | break; |
erik.corry@gmail.com | ed49e96 | 2012-04-17 11:57:53 +0000 | [diff] [blame] | 148 | case JS_MODULE_TYPE: |
| 149 | JSModule::cast(this)->JSModuleVerify(); |
| 150 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 151 | case JS_VALUE_TYPE: |
| 152 | JSValue::cast(this)->JSValueVerify(); |
| 153 | break; |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 154 | case JS_DATE_TYPE: |
| 155 | JSDate::cast(this)->JSDateVerify(); |
| 156 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 157 | case JS_FUNCTION_TYPE: |
| 158 | JSFunction::cast(this)->JSFunctionVerify(); |
| 159 | break; |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 160 | case JS_GLOBAL_PROXY_TYPE: |
| 161 | JSGlobalProxy::cast(this)->JSGlobalProxyVerify(); |
| 162 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 163 | case JS_GLOBAL_OBJECT_TYPE: |
| 164 | JSGlobalObject::cast(this)->JSGlobalObjectVerify(); |
| 165 | break; |
| 166 | case JS_BUILTINS_OBJECT_TYPE: |
| 167 | JSBuiltinsObject::cast(this)->JSBuiltinsObjectVerify(); |
| 168 | break; |
danno@chromium.org | 4172848 | 2013-06-12 22:31:22 +0000 | [diff] [blame] | 169 | case CELL_TYPE: |
| 170 | Cell::cast(this)->CellVerify(); |
| 171 | break; |
| 172 | case PROPERTY_CELL_TYPE: |
dslomov@chromium.org | b752d40 | 2013-06-18 11:54:54 +0000 | [diff] [blame] | 173 | PropertyCell::cast(this)->PropertyCellVerify(); |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 174 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 175 | case JS_ARRAY_TYPE: |
| 176 | JSArray::cast(this)->JSArrayVerify(); |
| 177 | break; |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 178 | case JS_SET_TYPE: |
| 179 | JSSet::cast(this)->JSSetVerify(); |
| 180 | break; |
| 181 | case JS_MAP_TYPE: |
| 182 | JSMap::cast(this)->JSMapVerify(); |
| 183 | break; |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 184 | case JS_WEAK_MAP_TYPE: |
| 185 | JSWeakMap::cast(this)->JSWeakMapVerify(); |
| 186 | break; |
jkummerow@chromium.org | ba72ec8 | 2013-07-22 09:21:20 +0000 | [diff] [blame] | 187 | case JS_WEAK_SET_TYPE: |
| 188 | JSWeakSet::cast(this)->JSWeakSetVerify(); |
| 189 | break; |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 190 | case JS_REGEXP_TYPE: |
| 191 | JSRegExp::cast(this)->JSRegExpVerify(); |
| 192 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 193 | case FILLER_TYPE: |
| 194 | break; |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 195 | case JS_PROXY_TYPE: |
| 196 | JSProxy::cast(this)->JSProxyVerify(); |
| 197 | break; |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 198 | case JS_FUNCTION_PROXY_TYPE: |
| 199 | JSFunctionProxy::cast(this)->JSFunctionProxyVerify(); |
| 200 | break; |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 201 | case FOREIGN_TYPE: |
| 202 | Foreign::cast(this)->ForeignVerify(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 203 | break; |
| 204 | case SHARED_FUNCTION_INFO_TYPE: |
| 205 | SharedFunctionInfo::cast(this)->SharedFunctionInfoVerify(); |
| 206 | break; |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 207 | case JS_MESSAGE_OBJECT_TYPE: |
| 208 | JSMessageObject::cast(this)->JSMessageObjectVerify(); |
| 209 | break; |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 210 | case JS_ARRAY_BUFFER_TYPE: |
| 211 | JSArrayBuffer::cast(this)->JSArrayBufferVerify(); |
| 212 | break; |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 213 | case JS_TYPED_ARRAY_TYPE: |
| 214 | JSTypedArray::cast(this)->JSTypedArrayVerify(); |
| 215 | break; |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 216 | case JS_DATA_VIEW_TYPE: |
| 217 | JSDataView::cast(this)->JSDataViewVerify(); |
| 218 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 219 | |
| 220 | #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
| 221 | case NAME##_TYPE: \ |
| 222 | Name::cast(this)->Name##Verify(); \ |
| 223 | break; |
| 224 | STRUCT_LIST(MAKE_STRUCT_CASE) |
| 225 | #undef MAKE_STRUCT_CASE |
| 226 | |
| 227 | default: |
| 228 | UNREACHABLE(); |
| 229 | break; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | |
| 234 | void HeapObject::VerifyHeapPointer(Object* p) { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 235 | CHECK(p->IsHeapObject()); |
hpayer@chromium.org | c5d4971 | 2013-09-11 08:25:48 +0000 | [diff] [blame] | 236 | HeapObject* ho = HeapObject::cast(p); |
| 237 | CHECK(ho->GetHeap()->Contains(ho)); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 241 | void Symbol::SymbolVerify() { |
| 242 | CHECK(IsSymbol()); |
| 243 | CHECK(HasHashCode()); |
| 244 | CHECK_GT(Hash(), 0); |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 245 | CHECK(name()->IsUndefined() || name()->IsString()); |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 246 | } |
| 247 | |
| 248 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 249 | void HeapNumber::HeapNumberVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 250 | CHECK(IsHeapNumber()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 251 | } |
| 252 | |
| 253 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 254 | void ByteArray::ByteArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 255 | CHECK(IsByteArray()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 259 | void FreeSpace::FreeSpaceVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 260 | CHECK(IsFreeSpace()); |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 264 | void ExternalPixelArray::ExternalPixelArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 265 | CHECK(IsExternalPixelArray()); |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 269 | void ExternalByteArray::ExternalByteArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 270 | CHECK(IsExternalByteArray()); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | |
| 274 | void ExternalUnsignedByteArray::ExternalUnsignedByteArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 275 | CHECK(IsExternalUnsignedByteArray()); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | |
| 279 | void ExternalShortArray::ExternalShortArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 280 | CHECK(IsExternalShortArray()); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 281 | } |
| 282 | |
| 283 | |
| 284 | void ExternalUnsignedShortArray::ExternalUnsignedShortArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 285 | CHECK(IsExternalUnsignedShortArray()); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | |
| 289 | void ExternalIntArray::ExternalIntArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 290 | CHECK(IsExternalIntArray()); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | |
| 294 | void ExternalUnsignedIntArray::ExternalUnsignedIntArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 295 | CHECK(IsExternalUnsignedIntArray()); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | |
| 299 | void ExternalFloatArray::ExternalFloatArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 300 | CHECK(IsExternalFloatArray()); |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 304 | void ExternalDoubleArray::ExternalDoubleArrayVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 305 | CHECK(IsExternalDoubleArray()); |
erik.corry@gmail.com | 3847bd5 | 2011-04-27 10:38:56 +0000 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 309 | void JSObject::JSObjectVerify() { |
| 310 | VerifyHeapPointer(properties()); |
| 311 | VerifyHeapPointer(elements()); |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 312 | |
| 313 | if (GetElementsKind() == NON_STRICT_ARGUMENTS_ELEMENTS) { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 314 | CHECK(this->elements()->IsFixedArray()); |
| 315 | CHECK_GE(this->elements()->length(), 2); |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 316 | } |
| 317 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 318 | if (HasFastProperties()) { |
sgjesse@chromium.org | 911335c | 2009-08-19 12:59:44 +0000 | [diff] [blame] | 319 | CHECK_EQ(map()->unused_property_fields(), |
| 320 | (map()->inobject_properties() + properties()->length() - |
| 321 | map()->NextFreePropertyIndex())); |
ulan@chromium.org | bf9432e | 2013-05-22 14:05:23 +0000 | [diff] [blame] | 322 | DescriptorArray* descriptors = map()->instance_descriptors(); |
| 323 | for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { |
| 324 | if (descriptors->GetDetails(i).type() == FIELD) { |
| 325 | Representation r = descriptors->GetDetails(i).representation(); |
| 326 | int field = descriptors->GetFieldIndex(i); |
| 327 | Object* value = RawFastPropertyAt(field); |
ulan@chromium.org | bf9432e | 2013-05-22 14:05:23 +0000 | [diff] [blame] | 328 | if (r.IsDouble()) ASSERT(value->IsHeapNumber()); |
danno@chromium.org | 1fd77d5 | 2013-06-07 16:01:45 +0000 | [diff] [blame] | 329 | if (value->IsUninitialized()) continue; |
| 330 | if (r.IsSmi()) ASSERT(value->IsSmi()); |
ulan@chromium.org | bf9432e | 2013-05-22 14:05:23 +0000 | [diff] [blame] | 331 | if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); |
| 332 | } |
| 333 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 334 | } |
dslomov@chromium.org | e97852d | 2013-09-12 09:02:59 +0000 | [diff] [blame] | 335 | |
machenbach@chromium.org | 528ce02 | 2013-09-23 14:09:36 +0000 | [diff] [blame] | 336 | // If a GC was caused while constructing this object, the elements |
| 337 | // pointer may point to a one pointer filler map. |
| 338 | if ((FLAG_use_gvn && FLAG_use_allocation_folding) || |
| 339 | (reinterpret_cast<Map*>(elements()) != |
| 340 | GetHeap()->one_pointer_filler_map())) { |
dslomov@chromium.org | e97852d | 2013-09-12 09:02:59 +0000 | [diff] [blame] | 341 | CHECK_EQ((map()->has_fast_smi_or_object_elements() || |
| 342 | (elements() == GetHeap()->empty_fixed_array())), |
| 343 | (elements()->map() == GetHeap()->fixed_array_map() || |
| 344 | elements()->map() == GetHeap()->fixed_cow_array_map())); |
| 345 | CHECK(map()->has_fast_object_elements() == HasFastObjectElements()); |
| 346 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 347 | } |
| 348 | |
| 349 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 350 | void Map::MapVerify() { |
hpayer@chromium.org | c5d4971 | 2013-09-11 08:25:48 +0000 | [diff] [blame] | 351 | Heap* heap = GetHeap(); |
| 352 | CHECK(!heap->InNewSpace(this)); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 353 | CHECK(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE); |
| 354 | CHECK(instance_size() == kVariableSizeSentinel || |
erik.corry@gmail.com | 145eff5 | 2010-08-23 11:36:18 +0000 | [diff] [blame] | 355 | (kPointerSize <= instance_size() && |
hpayer@chromium.org | c5d4971 | 2013-09-11 08:25:48 +0000 | [diff] [blame] | 356 | instance_size() < heap->Capacity())); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 357 | VerifyHeapPointer(prototype()); |
| 358 | VerifyHeapPointer(instance_descriptors()); |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 359 | SLOW_ASSERT(instance_descriptors()->IsSortedNoDuplicates()); |
yangguo@chromium.org | 99aa490 | 2012-07-06 16:21:55 +0000 | [diff] [blame] | 360 | if (HasTransitionArray()) { |
| 361 | SLOW_ASSERT(transitions()->IsSortedNoDuplicates()); |
| 362 | SLOW_ASSERT(transitions()->IsConsistentWithBackPointers(this)); |
| 363 | } |
yangguo@chromium.org | a6bbcc8 | 2012-12-21 12:35:02 +0000 | [diff] [blame] | 364 | ASSERT(!is_observed() || instance_type() < FIRST_JS_OBJECT_TYPE || |
| 365 | instance_type() > LAST_JS_OBJECT_TYPE || |
| 366 | has_slow_elements_kind() || has_external_array_elements()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 367 | } |
| 368 | |
| 369 | |
whesse@chromium.org | 4a1fe7d | 2010-09-27 12:32:04 +0000 | [diff] [blame] | 370 | void Map::SharedMapVerify() { |
ricow@chromium.org | 65fae84 | 2010-08-25 15:26:24 +0000 | [diff] [blame] | 371 | MapVerify(); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 372 | CHECK(is_shared()); |
| 373 | CHECK(instance_descriptors()->IsEmpty()); |
| 374 | CHECK_EQ(0, pre_allocated_property_fields()); |
| 375 | CHECK_EQ(0, unused_property_fields()); |
| 376 | CHECK_EQ(StaticVisitorBase::GetVisitorId(instance_type(), instance_size()), |
ricow@chromium.org | 65fae84 | 2010-08-25 15:26:24 +0000 | [diff] [blame] | 377 | visitor_id()); |
| 378 | } |
| 379 | |
| 380 | |
danno@chromium.org | 5940060 | 2013-08-13 17:09:37 +0000 | [diff] [blame] | 381 | void Map::VerifyOmittedMapChecks() { |
| 382 | if (!FLAG_omit_map_checks_for_leaf_maps) return; |
| 383 | if (!is_stable() || |
| 384 | is_deprecated() || |
| 385 | HasTransitionArray() || |
| 386 | is_dictionary_map()) { |
ulan@chromium.org | 2e04b58 | 2013-02-21 14:06:02 +0000 | [diff] [blame] | 387 | CHECK_EQ(0, dependent_code()->number_of_entries( |
| 388 | DependentCode::kPrototypeCheckGroup)); |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 393 | void CodeCache::CodeCacheVerify() { |
| 394 | VerifyHeapPointer(default_cache()); |
| 395 | VerifyHeapPointer(normal_type_cache()); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 396 | CHECK(default_cache()->IsFixedArray()); |
| 397 | CHECK(normal_type_cache()->IsUndefined() |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 398 | || normal_type_cache()->IsCodeCacheHashTable()); |
| 399 | } |
| 400 | |
| 401 | |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 402 | void PolymorphicCodeCache::PolymorphicCodeCacheVerify() { |
| 403 | VerifyHeapPointer(cache()); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 404 | CHECK(cache()->IsUndefined() || cache()->IsPolymorphicCodeCacheHashTable()); |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 405 | } |
| 406 | |
| 407 | |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 408 | void TypeFeedbackInfo::TypeFeedbackInfoVerify() { |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 409 | VerifyObjectField(kStorage1Offset); |
| 410 | VerifyObjectField(kStorage2Offset); |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 411 | VerifyHeapPointer(type_feedback_cells()); |
| 412 | } |
| 413 | |
| 414 | |
yangguo@chromium.org | ab30bb8 | 2012-02-24 14:41:46 +0000 | [diff] [blame] | 415 | void AliasedArgumentsEntry::AliasedArgumentsEntryVerify() { |
| 416 | VerifySmiField(kAliasedContextSlot); |
| 417 | } |
| 418 | |
| 419 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 420 | void FixedArray::FixedArrayVerify() { |
| 421 | for (int i = 0; i < length(); i++) { |
| 422 | Object* e = get(i); |
| 423 | if (e->IsHeapObject()) { |
| 424 | VerifyHeapPointer(e); |
| 425 | } else { |
| 426 | e->Verify(); |
| 427 | } |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 432 | void FixedDoubleArray::FixedDoubleArrayVerify() { |
| 433 | for (int i = 0; i < length(); i++) { |
| 434 | if (!is_the_hole(i)) { |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 435 | double value = get_scalar(i); |
ulan@chromium.org | 77ca49a | 2013-04-22 09:43:56 +0000 | [diff] [blame] | 436 | CHECK(!std::isnan(value) || |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 437 | (BitCast<uint64_t>(value) == |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 438 | BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())) || |
| 439 | ((BitCast<uint64_t>(value) & Double::kSignMask) != 0)); |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 440 | } |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | |
mstarzinger@chromium.org | a2e1a40 | 2013-10-15 08:25:05 +0000 | [diff] [blame^] | 445 | void ConstantPoolArray::ConstantPoolArrayVerify() { |
| 446 | CHECK(IsConstantPoolArray()); |
| 447 | } |
| 448 | |
| 449 | |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 450 | void JSGeneratorObject::JSGeneratorObjectVerify() { |
| 451 | // In an expression like "new g()", there can be a point where a generator |
| 452 | // object is allocated but its fields are all undefined, as it hasn't yet been |
| 453 | // initialized by the generator. Hence these weak checks. |
| 454 | VerifyObjectField(kFunctionOffset); |
| 455 | VerifyObjectField(kContextOffset); |
danno@chromium.org | ca29dd8 | 2013-04-26 11:59:48 +0000 | [diff] [blame] | 456 | VerifyObjectField(kReceiverOffset); |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 457 | VerifyObjectField(kOperandStackOffset); |
| 458 | VerifyObjectField(kContinuationOffset); |
ulan@chromium.org | 57ff881 | 2013-05-10 08:16:55 +0000 | [diff] [blame] | 459 | VerifyObjectField(kStackHandlerIndexOffset); |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 460 | } |
| 461 | |
| 462 | |
erik.corry@gmail.com | ed49e96 | 2012-04-17 11:57:53 +0000 | [diff] [blame] | 463 | void JSModule::JSModuleVerify() { |
danno@chromium.org | 81cac2b | 2012-07-10 11:28:27 +0000 | [diff] [blame] | 464 | VerifyObjectField(kContextOffset); |
| 465 | VerifyObjectField(kScopeInfoOffset); |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 466 | CHECK(context()->IsUndefined() || |
| 467 | Context::cast(context())->IsModuleContext()); |
erik.corry@gmail.com | ed49e96 | 2012-04-17 11:57:53 +0000 | [diff] [blame] | 468 | } |
| 469 | |
| 470 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 471 | void JSValue::JSValueVerify() { |
| 472 | Object* v = value(); |
| 473 | if (v->IsHeapObject()) { |
| 474 | VerifyHeapPointer(v); |
| 475 | } |
| 476 | } |
| 477 | |
| 478 | |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 479 | void JSDate::JSDateVerify() { |
| 480 | if (value()->IsHeapObject()) { |
| 481 | VerifyHeapPointer(value()); |
| 482 | } |
| 483 | CHECK(value()->IsUndefined() || value()->IsSmi() || value()->IsHeapNumber()); |
| 484 | CHECK(year()->IsUndefined() || year()->IsSmi() || year()->IsNaN()); |
| 485 | CHECK(month()->IsUndefined() || month()->IsSmi() || month()->IsNaN()); |
| 486 | CHECK(day()->IsUndefined() || day()->IsSmi() || day()->IsNaN()); |
| 487 | CHECK(weekday()->IsUndefined() || weekday()->IsSmi() || weekday()->IsNaN()); |
| 488 | CHECK(hour()->IsUndefined() || hour()->IsSmi() || hour()->IsNaN()); |
| 489 | CHECK(min()->IsUndefined() || min()->IsSmi() || min()->IsNaN()); |
| 490 | CHECK(sec()->IsUndefined() || sec()->IsSmi() || sec()->IsNaN()); |
| 491 | CHECK(cache_stamp()->IsUndefined() || |
| 492 | cache_stamp()->IsSmi() || |
| 493 | cache_stamp()->IsNaN()); |
| 494 | |
| 495 | if (month()->IsSmi()) { |
| 496 | int month = Smi::cast(this->month())->value(); |
| 497 | CHECK(0 <= month && month <= 11); |
| 498 | } |
| 499 | if (day()->IsSmi()) { |
| 500 | int day = Smi::cast(this->day())->value(); |
| 501 | CHECK(1 <= day && day <= 31); |
| 502 | } |
| 503 | if (hour()->IsSmi()) { |
| 504 | int hour = Smi::cast(this->hour())->value(); |
| 505 | CHECK(0 <= hour && hour <= 23); |
| 506 | } |
| 507 | if (min()->IsSmi()) { |
| 508 | int min = Smi::cast(this->min())->value(); |
| 509 | CHECK(0 <= min && min <= 59); |
| 510 | } |
| 511 | if (sec()->IsSmi()) { |
| 512 | int sec = Smi::cast(this->sec())->value(); |
| 513 | CHECK(0 <= sec && sec <= 59); |
| 514 | } |
| 515 | if (weekday()->IsSmi()) { |
| 516 | int weekday = Smi::cast(this->weekday())->value(); |
| 517 | CHECK(0 <= weekday && weekday <= 6); |
| 518 | } |
| 519 | if (cache_stamp()->IsSmi()) { |
| 520 | CHECK(Smi::cast(cache_stamp())->value() <= |
jkummerow@chromium.org | 3d00d0a | 2013-09-04 13:57:32 +0000 | [diff] [blame] | 521 | Smi::cast(GetIsolate()->date_cache()->stamp())->value()); |
svenpanne@chromium.org | 4efbdb1 | 2012-03-12 08:18:42 +0000 | [diff] [blame] | 522 | } |
| 523 | } |
| 524 | |
| 525 | |
kmillikin@chromium.org | 31b1277 | 2011-02-02 16:08:26 +0000 | [diff] [blame] | 526 | void JSMessageObject::JSMessageObjectVerify() { |
| 527 | CHECK(IsJSMessageObject()); |
| 528 | CHECK(type()->IsString()); |
| 529 | CHECK(arguments()->IsJSArray()); |
| 530 | VerifyObjectField(kStartPositionOffset); |
| 531 | VerifyObjectField(kEndPositionOffset); |
| 532 | VerifyObjectField(kArgumentsOffset); |
| 533 | VerifyObjectField(kScriptOffset); |
| 534 | VerifyObjectField(kStackTraceOffset); |
| 535 | VerifyObjectField(kStackFramesOffset); |
| 536 | } |
| 537 | |
| 538 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 539 | void String::StringVerify() { |
| 540 | CHECK(IsString()); |
| 541 | CHECK(length() >= 0 && length() <= Smi::kMaxValue); |
yangguo@chromium.org | 4a9f655 | 2013-03-04 14:46:33 +0000 | [diff] [blame] | 542 | if (IsInternalizedString()) { |
hpayer@chromium.org | c5d4971 | 2013-09-11 08:25:48 +0000 | [diff] [blame] | 543 | CHECK(!GetHeap()->InNewSpace(this)); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 544 | } |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 545 | if (IsConsString()) { |
| 546 | ConsString::cast(this)->ConsStringVerify(); |
| 547 | } else if (IsSlicedString()) { |
| 548 | SlicedString::cast(this)->SlicedStringVerify(); |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | |
| 553 | void ConsString::ConsStringVerify() { |
| 554 | CHECK(this->first()->IsString()); |
| 555 | CHECK(this->second() == GetHeap()->empty_string() || |
| 556 | this->second()->IsString()); |
ulan@chromium.org | 2efb900 | 2012-01-19 15:36:35 +0000 | [diff] [blame] | 557 | CHECK(this->length() >= ConsString::kMinLength); |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 558 | if (this->IsFlat()) { |
| 559 | // A flat cons can only be created by String::SlowTryFlatten. |
| 560 | // Afterwards, the first part may be externalized. |
| 561 | CHECK(this->first()->IsSeqString() || this->first()->IsExternalString()); |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | |
| 566 | void SlicedString::SlicedStringVerify() { |
| 567 | CHECK(!this->parent()->IsConsString()); |
| 568 | CHECK(!this->parent()->IsSlicedString()); |
| 569 | CHECK(this->length() >= SlicedString::kMinLength); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 570 | } |
| 571 | |
| 572 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 573 | void JSFunction::JSFunctionVerify() { |
| 574 | CHECK(IsJSFunction()); |
| 575 | VerifyObjectField(kPrototypeOrInitialMapOffset); |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 576 | VerifyObjectField(kNextFunctionLinkOffset); |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 577 | CHECK(code()->IsCode()); |
verwaest@chromium.org | e4ee6de | 2012-11-06 12:13:00 +0000 | [diff] [blame] | 578 | CHECK(next_function_link() == NULL || |
| 579 | next_function_link()->IsUndefined() || |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 580 | next_function_link()->IsJSFunction()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 581 | } |
| 582 | |
| 583 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 584 | void SharedFunctionInfo::SharedFunctionInfoVerify() { |
| 585 | CHECK(IsSharedFunctionInfo()); |
| 586 | VerifyObjectField(kNameOffset); |
| 587 | VerifyObjectField(kCodeOffset); |
yangguo@chromium.org | 5a11aaf | 2012-06-20 11:29:00 +0000 | [diff] [blame] | 588 | VerifyObjectField(kOptimizedCodeMapOffset); |
ager@chromium.org | 6a2b0aa | 2010-07-13 20:58:03 +0000 | [diff] [blame] | 589 | VerifyObjectField(kScopeInfoOffset); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 590 | VerifyObjectField(kInstanceClassNameOffset); |
vegorov@chromium.org | f837290 | 2010-03-15 10:26:20 +0000 | [diff] [blame] | 591 | VerifyObjectField(kFunctionDataOffset); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 592 | VerifyObjectField(kScriptOffset); |
| 593 | VerifyObjectField(kDebugInfoOffset); |
| 594 | } |
| 595 | |
| 596 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 597 | void JSGlobalProxy::JSGlobalProxyVerify() { |
| 598 | CHECK(IsJSGlobalProxy()); |
| 599 | JSObjectVerify(); |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 600 | VerifyObjectField(JSGlobalProxy::kNativeContextOffset); |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 601 | // Make sure that this object has no properties, elements. |
| 602 | CHECK_EQ(0, properties()->length()); |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 603 | CHECK(HasFastObjectElements()); |
ricow@chromium.org | 30ce411 | 2010-05-31 10:38:25 +0000 | [diff] [blame] | 604 | CHECK_EQ(0, FixedArray::cast(elements())->length()); |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 605 | } |
| 606 | |
| 607 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 608 | void JSGlobalObject::JSGlobalObjectVerify() { |
| 609 | CHECK(IsJSGlobalObject()); |
| 610 | JSObjectVerify(); |
| 611 | for (int i = GlobalObject::kBuiltinsOffset; |
| 612 | i < JSGlobalObject::kSize; |
| 613 | i += kPointerSize) { |
| 614 | VerifyObjectField(i); |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 619 | void JSBuiltinsObject::JSBuiltinsObjectVerify() { |
| 620 | CHECK(IsJSBuiltinsObject()); |
| 621 | JSObjectVerify(); |
| 622 | for (int i = GlobalObject::kBuiltinsOffset; |
| 623 | i < JSBuiltinsObject::kSize; |
| 624 | i += kPointerSize) { |
| 625 | VerifyObjectField(i); |
| 626 | } |
| 627 | } |
| 628 | |
| 629 | |
| 630 | void Oddball::OddballVerify() { |
| 631 | CHECK(IsOddball()); |
| 632 | VerifyHeapPointer(to_string()); |
| 633 | Object* number = to_number(); |
| 634 | if (number->IsHeapObject()) { |
hpayer@chromium.org | c5d4971 | 2013-09-11 08:25:48 +0000 | [diff] [blame] | 635 | CHECK(number == HeapObject::cast(number)->GetHeap()->nan_value()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 636 | } else { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 637 | CHECK(number->IsSmi()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 638 | int value = Smi::cast(number)->value(); |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 639 | // Hidden oddballs have negative smis. |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 640 | const int kLeastHiddenOddballNumber = -4; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 641 | CHECK_LE(value, 1); |
| 642 | CHECK(value >= kLeastHiddenOddballNumber); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 643 | } |
| 644 | } |
| 645 | |
| 646 | |
danno@chromium.org | 4172848 | 2013-06-12 22:31:22 +0000 | [diff] [blame] | 647 | void Cell::CellVerify() { |
| 648 | CHECK(IsCell()); |
| 649 | VerifyObjectField(kValueOffset); |
| 650 | } |
| 651 | |
| 652 | |
dslomov@chromium.org | b752d40 | 2013-06-18 11:54:54 +0000 | [diff] [blame] | 653 | void PropertyCell::PropertyCellVerify() { |
| 654 | CHECK(IsPropertyCell()); |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 655 | VerifyObjectField(kValueOffset); |
danno@chromium.org | 4172848 | 2013-06-12 22:31:22 +0000 | [diff] [blame] | 656 | VerifyObjectField(kTypeOffset); |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 660 | void Code::CodeVerify() { |
kasperl@chromium.org | 061ef74 | 2009-02-27 12:16:20 +0000 | [diff] [blame] | 661 | CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()), |
whesse@chromium.org | 4a1fe7d | 2010-09-27 12:32:04 +0000 | [diff] [blame] | 662 | kCodeAlignment)); |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 663 | relocation_info()->Verify(); |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 664 | Address last_gc_pc = NULL; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 665 | for (RelocIterator it(this); !it.done(); it.next()) { |
| 666 | it.rinfo()->Verify(); |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 667 | // Ensure that GC will not iterate twice over the same pointer. |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 668 | if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 669 | CHECK(it.rinfo()->pc() != last_gc_pc); |
| 670 | last_gc_pc = it.rinfo()->pc(); |
| 671 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 672 | } |
| 673 | } |
| 674 | |
| 675 | |
jkummerow@chromium.org | 25b0e21 | 2013-10-04 15:38:52 +0000 | [diff] [blame] | 676 | void Code::VerifyEmbeddedObjectsDependency() { |
danno@chromium.org | 94b0d6f | 2013-02-04 13:33:20 +0000 | [diff] [blame] | 677 | int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 678 | for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
jkummerow@chromium.org | 25b0e21 | 2013-10-04 15:38:52 +0000 | [diff] [blame] | 679 | Object* obj = it.rinfo()->target_object(); |
| 680 | if (IsWeakEmbeddedObject(kind(), obj)) { |
| 681 | if (obj->IsMap()) { |
| 682 | Map* map = Map::cast(obj); |
ulan@chromium.org | 2e04b58 | 2013-02-21 14:06:02 +0000 | [diff] [blame] | 683 | CHECK(map->dependent_code()->Contains( |
| 684 | DependentCode::kWeaklyEmbeddedGroup, this)); |
jkummerow@chromium.org | 25b0e21 | 2013-10-04 15:38:52 +0000 | [diff] [blame] | 685 | } else if (obj->IsJSObject()) { |
| 686 | Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table(); |
| 687 | WeakHashTable* table = WeakHashTable::cast(raw_table); |
| 688 | CHECK(DependentCode::cast(table->Lookup(obj))->Contains( |
| 689 | DependentCode::kWeaklyEmbeddedGroup, this)); |
danno@chromium.org | 94b0d6f | 2013-02-04 13:33:20 +0000 | [diff] [blame] | 690 | } |
| 691 | } |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 696 | void JSArray::JSArrayVerify() { |
| 697 | JSObjectVerify(); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 698 | CHECK(length()->IsNumber() || length()->IsUndefined()); |
machenbach@chromium.org | 528ce02 | 2013-09-23 14:09:36 +0000 | [diff] [blame] | 699 | // If a GC was caused while constructing this array, the elements |
| 700 | // pointer may point to a one pointer filler map. |
| 701 | if ((FLAG_use_gvn && FLAG_use_allocation_folding) || |
| 702 | (reinterpret_cast<Map*>(elements()) != |
| 703 | GetHeap()->one_pointer_filler_map())) { |
dslomov@chromium.org | e97852d | 2013-09-12 09:02:59 +0000 | [diff] [blame] | 704 | CHECK(elements()->IsUndefined() || |
| 705 | elements()->IsFixedArray() || |
| 706 | elements()->IsFixedDoubleArray()); |
dslomov@chromium.org | e97852d | 2013-09-12 09:02:59 +0000 | [diff] [blame] | 707 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 708 | } |
| 709 | |
| 710 | |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 711 | void JSSet::JSSetVerify() { |
| 712 | CHECK(IsJSSet()); |
| 713 | JSObjectVerify(); |
| 714 | VerifyHeapPointer(table()); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 715 | CHECK(table()->IsHashTable() || table()->IsUndefined()); |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 716 | } |
| 717 | |
| 718 | |
| 719 | void JSMap::JSMapVerify() { |
| 720 | CHECK(IsJSMap()); |
| 721 | JSObjectVerify(); |
| 722 | VerifyHeapPointer(table()); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 723 | CHECK(table()->IsHashTable() || table()->IsUndefined()); |
erik.corry@gmail.com | 394dbcf | 2011-10-27 07:38:48 +0000 | [diff] [blame] | 724 | } |
| 725 | |
| 726 | |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 727 | void JSWeakMap::JSWeakMapVerify() { |
| 728 | CHECK(IsJSWeakMap()); |
| 729 | JSObjectVerify(); |
| 730 | VerifyHeapPointer(table()); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 731 | CHECK(table()->IsHashTable() || table()->IsUndefined()); |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 732 | } |
| 733 | |
| 734 | |
jkummerow@chromium.org | ba72ec8 | 2013-07-22 09:21:20 +0000 | [diff] [blame] | 735 | void JSWeakSet::JSWeakSetVerify() { |
| 736 | CHECK(IsJSWeakSet()); |
| 737 | JSObjectVerify(); |
| 738 | VerifyHeapPointer(table()); |
| 739 | CHECK(table()->IsHashTable() || table()->IsUndefined()); |
| 740 | } |
| 741 | |
| 742 | |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 743 | void JSRegExp::JSRegExpVerify() { |
| 744 | JSObjectVerify(); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 745 | CHECK(data()->IsUndefined() || data()->IsFixedArray()); |
kasperl@chromium.org | 9fe21c6 | 2008-10-28 08:53:51 +0000 | [diff] [blame] | 746 | switch (TypeTag()) { |
| 747 | case JSRegExp::ATOM: { |
| 748 | FixedArray* arr = FixedArray::cast(data()); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 749 | CHECK(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); |
kasperl@chromium.org | 9fe21c6 | 2008-10-28 08:53:51 +0000 | [diff] [blame] | 750 | break; |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 751 | } |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 752 | case JSRegExp::IRREGEXP: { |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 753 | bool is_native = RegExpImpl::UsesNativeRegExp(); |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 754 | |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 755 | FixedArray* arr = FixedArray::cast(data()); |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 756 | Object* ascii_data = arr->get(JSRegExp::kIrregexpASCIICodeIndex); |
jkummerow@chromium.org | ddda9e8 | 2011-07-06 11:27:02 +0000 | [diff] [blame] | 757 | // Smi : Not compiled yet (-1) or code prepared for flushing. |
ager@chromium.org | a1645e2 | 2009-09-09 19:27:10 +0000 | [diff] [blame] | 758 | // JSObject: Compilation error. |
| 759 | // Code/ByteArray: Compiled code. |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 760 | CHECK(ascii_data->IsSmi() || |
jkummerow@chromium.org | ddda9e8 | 2011-07-06 11:27:02 +0000 | [diff] [blame] | 761 | (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray())); |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 762 | Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 763 | CHECK(uc16_data->IsSmi() || |
jkummerow@chromium.org | ddda9e8 | 2011-07-06 11:27:02 +0000 | [diff] [blame] | 764 | (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray())); |
| 765 | |
| 766 | Object* ascii_saved = arr->get(JSRegExp::kIrregexpASCIICodeSavedIndex); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 767 | CHECK(ascii_saved->IsSmi() || ascii_saved->IsString() || |
jkummerow@chromium.org | ddda9e8 | 2011-07-06 11:27:02 +0000 | [diff] [blame] | 768 | ascii_saved->IsCode()); |
| 769 | Object* uc16_saved = arr->get(JSRegExp::kIrregexpUC16CodeSavedIndex); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 770 | CHECK(uc16_saved->IsSmi() || uc16_saved->IsString() || |
jkummerow@chromium.org | ddda9e8 | 2011-07-06 11:27:02 +0000 | [diff] [blame] | 771 | uc16_saved->IsCode()); |
| 772 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 773 | CHECK(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi()); |
| 774 | CHECK(arr->get(JSRegExp::kIrregexpMaxRegisterCountIndex)->IsSmi()); |
kasperl@chromium.org | 9fe21c6 | 2008-10-28 08:53:51 +0000 | [diff] [blame] | 775 | break; |
| 776 | } |
| 777 | default: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 778 | CHECK_EQ(JSRegExp::NOT_COMPILED, TypeTag()); |
| 779 | CHECK(data()->IsUndefined()); |
kasperl@chromium.org | 9fe21c6 | 2008-10-28 08:53:51 +0000 | [diff] [blame] | 780 | break; |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 781 | } |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 782 | } |
| 783 | |
| 784 | |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 785 | void JSProxy::JSProxyVerify() { |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 786 | CHECK(IsJSProxy()); |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 787 | VerifyPointer(handler()); |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 788 | CHECK(hash()->IsSmi() || hash()->IsUndefined()); |
vegorov@chromium.org | 7304bca | 2011-05-16 12:14:13 +0000 | [diff] [blame] | 789 | } |
| 790 | |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 791 | |
| 792 | void JSFunctionProxy::JSFunctionProxyVerify() { |
erik.corry@gmail.com | c3b670f | 2011-10-05 21:44:48 +0000 | [diff] [blame] | 793 | CHECK(IsJSFunctionProxy()); |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 794 | JSProxyVerify(); |
| 795 | VerifyPointer(call_trap()); |
| 796 | VerifyPointer(construct_trap()); |
| 797 | } |
| 798 | |
mstarzinger@chromium.org | e0e1b0d | 2013-07-08 08:38:06 +0000 | [diff] [blame] | 799 | |
mstarzinger@chromium.org | f705b50 | 2013-04-04 11:38:09 +0000 | [diff] [blame] | 800 | void JSArrayBuffer::JSArrayBufferVerify() { |
| 801 | CHECK(IsJSArrayBuffer()); |
| 802 | JSObjectVerify(); |
| 803 | VerifyPointer(byte_length()); |
| 804 | CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() |
| 805 | || byte_length()->IsUndefined()); |
| 806 | } |
| 807 | |
lrn@chromium.org | 34e6078 | 2011-09-15 07:25:40 +0000 | [diff] [blame] | 808 | |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 809 | void JSArrayBufferView::JSArrayBufferViewVerify() { |
| 810 | CHECK(IsJSArrayBufferView()); |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 811 | JSObjectVerify(); |
| 812 | VerifyPointer(buffer()); |
| 813 | CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined()); |
| 814 | |
| 815 | VerifyPointer(byte_offset()); |
| 816 | CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber() |
| 817 | || byte_offset()->IsUndefined()); |
| 818 | |
| 819 | VerifyPointer(byte_length()); |
| 820 | CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() |
| 821 | || byte_length()->IsUndefined()); |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 822 | } |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 823 | |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 824 | |
| 825 | void JSTypedArray::JSTypedArrayVerify() { |
| 826 | CHECK(IsJSTypedArray()); |
| 827 | JSArrayBufferViewVerify(); |
mstarzinger@chromium.org | e27d617 | 2013-04-17 11:51:44 +0000 | [diff] [blame] | 828 | VerifyPointer(length()); |
| 829 | CHECK(length()->IsSmi() || length()->IsHeapNumber() |
| 830 | || length()->IsUndefined()); |
| 831 | |
| 832 | VerifyPointer(elements()); |
| 833 | } |
| 834 | |
| 835 | |
mstarzinger@chromium.org | 1510d58 | 2013-06-28 14:00:48 +0000 | [diff] [blame] | 836 | void JSDataView::JSDataViewVerify() { |
| 837 | CHECK(IsJSDataView()); |
| 838 | JSArrayBufferViewVerify(); |
| 839 | } |
| 840 | |
| 841 | |
ager@chromium.org | ea91cc5 | 2011-05-23 06:06:11 +0000 | [diff] [blame] | 842 | void Foreign::ForeignVerify() { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 843 | CHECK(IsForeign()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 844 | } |
| 845 | |
| 846 | |
danno@chromium.org | 1fd77d5 | 2013-06-07 16:01:45 +0000 | [diff] [blame] | 847 | void Box::BoxVerify() { |
| 848 | CHECK(IsBox()); |
| 849 | value()->Verify(); |
| 850 | } |
| 851 | |
| 852 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 853 | void AccessorInfo::AccessorInfoVerify() { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 854 | VerifyPointer(name()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 855 | VerifyPointer(flag()); |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 856 | VerifyPointer(expected_receiver_type()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 857 | } |
| 858 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 859 | |
hpayer@chromium.org | 7c3372b | 2013-02-13 17:26:04 +0000 | [diff] [blame] | 860 | void ExecutableAccessorInfo::ExecutableAccessorInfoVerify() { |
| 861 | CHECK(IsExecutableAccessorInfo()); |
| 862 | AccessorInfoVerify(); |
| 863 | VerifyPointer(getter()); |
| 864 | VerifyPointer(setter()); |
| 865 | VerifyPointer(data()); |
| 866 | } |
| 867 | |
| 868 | |
| 869 | void DeclaredAccessorDescriptor::DeclaredAccessorDescriptorVerify() { |
| 870 | CHECK(IsDeclaredAccessorDescriptor()); |
ulan@chromium.org | 750145a | 2013-03-07 15:14:13 +0000 | [diff] [blame] | 871 | VerifyPointer(serialized_data()); |
hpayer@chromium.org | 7c3372b | 2013-02-13 17:26:04 +0000 | [diff] [blame] | 872 | } |
| 873 | |
| 874 | |
| 875 | void DeclaredAccessorInfo::DeclaredAccessorInfoVerify() { |
| 876 | CHECK(IsDeclaredAccessorInfo()); |
| 877 | AccessorInfoVerify(); |
| 878 | VerifyPointer(descriptor()); |
| 879 | } |
| 880 | |
| 881 | |
erik.corry@gmail.com | f2038fb | 2012-01-16 11:42:08 +0000 | [diff] [blame] | 882 | void AccessorPair::AccessorPairVerify() { |
| 883 | CHECK(IsAccessorPair()); |
| 884 | VerifyPointer(getter()); |
| 885 | VerifyPointer(setter()); |
jkummerow@chromium.org | 1e8da74 | 2013-08-26 17:13:35 +0000 | [diff] [blame] | 886 | VerifySmiField(kAccessFlagsOffset); |
erik.corry@gmail.com | f2038fb | 2012-01-16 11:42:08 +0000 | [diff] [blame] | 887 | } |
| 888 | |
| 889 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 890 | void AccessCheckInfo::AccessCheckInfoVerify() { |
| 891 | CHECK(IsAccessCheckInfo()); |
| 892 | VerifyPointer(named_callback()); |
| 893 | VerifyPointer(indexed_callback()); |
| 894 | VerifyPointer(data()); |
| 895 | } |
| 896 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 897 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 898 | void InterceptorInfo::InterceptorInfoVerify() { |
| 899 | CHECK(IsInterceptorInfo()); |
| 900 | VerifyPointer(getter()); |
| 901 | VerifyPointer(setter()); |
| 902 | VerifyPointer(query()); |
| 903 | VerifyPointer(deleter()); |
| 904 | VerifyPointer(enumerator()); |
| 905 | VerifyPointer(data()); |
| 906 | } |
| 907 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 908 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 909 | void CallHandlerInfo::CallHandlerInfoVerify() { |
| 910 | CHECK(IsCallHandlerInfo()); |
| 911 | VerifyPointer(callback()); |
| 912 | VerifyPointer(data()); |
| 913 | } |
| 914 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 915 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 916 | void TemplateInfo::TemplateInfoVerify() { |
| 917 | VerifyPointer(tag()); |
| 918 | VerifyPointer(property_list()); |
jkummerow@chromium.org | 3d00d0a | 2013-09-04 13:57:32 +0000 | [diff] [blame] | 919 | VerifyPointer(property_accessors()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 920 | } |
| 921 | |
mstarzinger@chromium.org | e0e1b0d | 2013-07-08 08:38:06 +0000 | [diff] [blame] | 922 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 923 | void FunctionTemplateInfo::FunctionTemplateInfoVerify() { |
| 924 | CHECK(IsFunctionTemplateInfo()); |
| 925 | TemplateInfoVerify(); |
| 926 | VerifyPointer(serial_number()); |
| 927 | VerifyPointer(call_code()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 928 | VerifyPointer(prototype_template()); |
| 929 | VerifyPointer(parent_template()); |
| 930 | VerifyPointer(named_property_handler()); |
| 931 | VerifyPointer(indexed_property_handler()); |
| 932 | VerifyPointer(instance_template()); |
| 933 | VerifyPointer(signature()); |
| 934 | VerifyPointer(access_check_info()); |
| 935 | } |
| 936 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 937 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 938 | void ObjectTemplateInfo::ObjectTemplateInfoVerify() { |
| 939 | CHECK(IsObjectTemplateInfo()); |
| 940 | TemplateInfoVerify(); |
| 941 | VerifyPointer(constructor()); |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 942 | VerifyPointer(internal_field_count()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 943 | } |
| 944 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 945 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 946 | void SignatureInfo::SignatureInfoVerify() { |
| 947 | CHECK(IsSignatureInfo()); |
| 948 | VerifyPointer(receiver()); |
| 949 | VerifyPointer(args()); |
| 950 | } |
| 951 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 952 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 953 | void TypeSwitchInfo::TypeSwitchInfoVerify() { |
| 954 | CHECK(IsTypeSwitchInfo()); |
| 955 | VerifyPointer(types()); |
| 956 | } |
| 957 | |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 958 | |
danno@chromium.org | bee5199 | 2013-07-10 14:57:15 +0000 | [diff] [blame] | 959 | void AllocationSite::AllocationSiteVerify() { |
| 960 | CHECK(IsAllocationSite()); |
| 961 | } |
| 962 | |
| 963 | |
jkummerow@chromium.org | ba72ec8 | 2013-07-22 09:21:20 +0000 | [diff] [blame] | 964 | void AllocationMemento::AllocationMementoVerify() { |
| 965 | CHECK(IsAllocationMemento()); |
danno@chromium.org | bee5199 | 2013-07-10 14:57:15 +0000 | [diff] [blame] | 966 | VerifyHeapPointer(allocation_site()); |
| 967 | CHECK(!IsValid() || GetAllocationSite()->IsAllocationSite()); |
jkummerow@chromium.org | 59297c7 | 2013-01-09 16:32:23 +0000 | [diff] [blame] | 968 | } |
| 969 | |
| 970 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 971 | void Script::ScriptVerify() { |
| 972 | CHECK(IsScript()); |
| 973 | VerifyPointer(source()); |
| 974 | VerifyPointer(name()); |
| 975 | line_offset()->SmiVerify(); |
| 976 | column_offset()->SmiVerify(); |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 977 | VerifyPointer(data()); |
| 978 | VerifyPointer(wrapper()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 979 | type()->SmiVerify(); |
sgjesse@chromium.org | 499aaa5 | 2009-11-30 08:07:20 +0000 | [diff] [blame] | 980 | VerifyPointer(line_ends()); |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 981 | VerifyPointer(id()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 982 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 983 | |
| 984 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 985 | void JSFunctionResultCache::JSFunctionResultCacheVerify() { |
| 986 | JSFunction::cast(get(kFactoryIndex))->Verify(); |
| 987 | |
| 988 | int size = Smi::cast(get(kCacheSizeIndex))->value(); |
| 989 | CHECK(kEntriesIndex <= size); |
| 990 | CHECK(size <= length()); |
| 991 | CHECK_EQ(0, size % kEntrySize); |
| 992 | |
| 993 | int finger = Smi::cast(get(kFingerIndex))->value(); |
| 994 | CHECK(kEntriesIndex <= finger); |
| 995 | CHECK((finger < size) || (finger == kEntriesIndex && finger == size)); |
| 996 | CHECK_EQ(0, finger % kEntrySize); |
| 997 | |
| 998 | if (FLAG_enable_slow_asserts) { |
| 999 | for (int i = kEntriesIndex; i < size; i++) { |
| 1000 | CHECK(!get(i)->IsTheHole()); |
| 1001 | get(i)->Verify(); |
| 1002 | } |
| 1003 | for (int i = size; i < length(); i++) { |
| 1004 | CHECK(get(i)->IsTheHole()); |
| 1005 | get(i)->Verify(); |
| 1006 | } |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | |
| 1011 | void NormalizedMapCache::NormalizedMapCacheVerify() { |
| 1012 | FixedArray::cast(this)->Verify(); |
| 1013 | if (FLAG_enable_slow_asserts) { |
| 1014 | for (int i = 0; i < length(); i++) { |
| 1015 | Object* e = get(i); |
| 1016 | if (e->IsMap()) { |
| 1017 | Map::cast(e)->SharedMapVerify(); |
| 1018 | } else { |
| 1019 | CHECK(e->IsUndefined()); |
| 1020 | } |
| 1021 | } |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 1026 | #ifdef ENABLE_DEBUGGER_SUPPORT |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1027 | void DebugInfo::DebugInfoVerify() { |
| 1028 | CHECK(IsDebugInfo()); |
| 1029 | VerifyPointer(shared()); |
| 1030 | VerifyPointer(original_code()); |
| 1031 | VerifyPointer(code()); |
| 1032 | VerifyPointer(break_points()); |
| 1033 | } |
| 1034 | |
| 1035 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1036 | void BreakPointInfo::BreakPointInfoVerify() { |
| 1037 | CHECK(IsBreakPointInfo()); |
| 1038 | code_position()->SmiVerify(); |
| 1039 | source_position()->SmiVerify(); |
| 1040 | statement_position()->SmiVerify(); |
| 1041 | VerifyPointer(break_point_objects()); |
| 1042 | } |
whesse@chromium.org | 023421e | 2010-12-21 12:19:12 +0000 | [diff] [blame] | 1043 | #endif // ENABLE_DEBUGGER_SUPPORT |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1044 | #endif // VERIFY_HEAP |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1045 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1046 | #ifdef DEBUG |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1047 | |
| 1048 | void JSObject::IncrementSpillStatistics(SpillInformation* info) { |
| 1049 | info->number_of_objects_++; |
| 1050 | // Named properties |
| 1051 | if (HasFastProperties()) { |
| 1052 | info->number_of_objects_with_fast_properties_++; |
| 1053 | info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); |
| 1054 | info->number_of_fast_unused_fields_ += map()->unused_property_fields(); |
| 1055 | } else { |
ulan@chromium.org | 750145a | 2013-03-07 15:14:13 +0000 | [diff] [blame] | 1056 | NameDictionary* dict = property_dictionary(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1057 | info->number_of_slow_used_properties_ += dict->NumberOfElements(); |
| 1058 | info->number_of_slow_unused_properties_ += |
| 1059 | dict->Capacity() - dict->NumberOfElements(); |
| 1060 | } |
| 1061 | // Indexed properties |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1062 | switch (GetElementsKind()) { |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 1063 | case FAST_HOLEY_SMI_ELEMENTS: |
| 1064 | case FAST_SMI_ELEMENTS: |
| 1065 | case FAST_HOLEY_DOUBLE_ELEMENTS: |
| 1066 | case FAST_DOUBLE_ELEMENTS: |
| 1067 | case FAST_HOLEY_ELEMENTS: |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1068 | case FAST_ELEMENTS: { |
| 1069 | info->number_of_objects_with_fast_elements_++; |
| 1070 | int holes = 0; |
| 1071 | FixedArray* e = FixedArray::cast(elements()); |
| 1072 | int len = e->length(); |
hpayer@chromium.org | c5d4971 | 2013-09-11 08:25:48 +0000 | [diff] [blame] | 1073 | Heap* heap = GetHeap(); |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1074 | for (int i = 0; i < len; i++) { |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 1075 | if (e->get(i) == heap->the_hole_value()) holes++; |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1076 | } |
| 1077 | info->number_of_fast_used_elements_ += len - holes; |
| 1078 | info->number_of_fast_unused_elements_ += holes; |
| 1079 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1080 | } |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 1081 | case EXTERNAL_BYTE_ELEMENTS: |
| 1082 | case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
| 1083 | case EXTERNAL_SHORT_ELEMENTS: |
| 1084 | case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
| 1085 | case EXTERNAL_INT_ELEMENTS: |
| 1086 | case EXTERNAL_UNSIGNED_INT_ELEMENTS: |
| 1087 | case EXTERNAL_FLOAT_ELEMENTS: |
| 1088 | case EXTERNAL_DOUBLE_ELEMENTS: |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 1089 | case EXTERNAL_PIXEL_ELEMENTS: { |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1090 | info->number_of_objects_with_fast_elements_++; |
danno@chromium.org | 4d3fe4e | 2011-03-10 10:14:28 +0000 | [diff] [blame] | 1091 | ExternalPixelArray* e = ExternalPixelArray::cast(elements()); |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1092 | info->number_of_fast_used_elements_ += e->length(); |
| 1093 | break; |
| 1094 | } |
| 1095 | case DICTIONARY_ELEMENTS: { |
erik.corry@gmail.com | f2038fb | 2012-01-16 11:42:08 +0000 | [diff] [blame] | 1096 | SeededNumberDictionary* dict = element_dictionary(); |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1097 | info->number_of_slow_used_elements_ += dict->NumberOfElements(); |
| 1098 | info->number_of_slow_unused_elements_ += |
| 1099 | dict->Capacity() - dict->NumberOfElements(); |
| 1100 | break; |
| 1101 | } |
svenpanne@chromium.org | 830d30c | 2012-05-29 13:20:14 +0000 | [diff] [blame] | 1102 | case NON_STRICT_ARGUMENTS_ELEMENTS: |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 1103 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1104 | } |
| 1105 | } |
| 1106 | |
| 1107 | |
| 1108 | void JSObject::SpillInformation::Clear() { |
| 1109 | number_of_objects_ = 0; |
| 1110 | number_of_objects_with_fast_properties_ = 0; |
| 1111 | number_of_objects_with_fast_elements_ = 0; |
| 1112 | number_of_fast_used_fields_ = 0; |
| 1113 | number_of_fast_unused_fields_ = 0; |
| 1114 | number_of_slow_used_properties_ = 0; |
| 1115 | number_of_slow_unused_properties_ = 0; |
| 1116 | number_of_fast_used_elements_ = 0; |
| 1117 | number_of_fast_unused_elements_ = 0; |
| 1118 | number_of_slow_used_elements_ = 0; |
| 1119 | number_of_slow_unused_elements_ = 0; |
| 1120 | } |
| 1121 | |
mstarzinger@chromium.org | e0e1b0d | 2013-07-08 08:38:06 +0000 | [diff] [blame] | 1122 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1123 | void JSObject::SpillInformation::Print() { |
| 1124 | PrintF("\n JSObject Spill Statistics (#%d):\n", number_of_objects_); |
| 1125 | |
| 1126 | PrintF(" - fast properties (#%d): %d (used) %d (unused)\n", |
| 1127 | number_of_objects_with_fast_properties_, |
| 1128 | number_of_fast_used_fields_, number_of_fast_unused_fields_); |
| 1129 | |
| 1130 | PrintF(" - slow properties (#%d): %d (used) %d (unused)\n", |
| 1131 | number_of_objects_ - number_of_objects_with_fast_properties_, |
| 1132 | number_of_slow_used_properties_, number_of_slow_unused_properties_); |
| 1133 | |
| 1134 | PrintF(" - fast elements (#%d): %d (used) %d (unused)\n", |
| 1135 | number_of_objects_with_fast_elements_, |
| 1136 | number_of_fast_used_elements_, number_of_fast_unused_elements_); |
| 1137 | |
| 1138 | PrintF(" - slow elements (#%d): %d (used) %d (unused)\n", |
| 1139 | number_of_objects_ - number_of_objects_with_fast_elements_, |
| 1140 | number_of_slow_used_elements_, number_of_slow_unused_elements_); |
| 1141 | |
| 1142 | PrintF("\n"); |
| 1143 | } |
| 1144 | |
| 1145 | |
verwaest@chromium.org | 06ab2ec | 2012-10-09 17:00:13 +0000 | [diff] [blame] | 1146 | bool DescriptorArray::IsSortedNoDuplicates(int valid_entries) { |
| 1147 | if (valid_entries == -1) valid_entries = number_of_descriptors(); |
ulan@chromium.org | 750145a | 2013-03-07 15:14:13 +0000 | [diff] [blame] | 1148 | Name* current_key = NULL; |
mads.s.ager@gmail.com | 769cc96 | 2008-08-06 10:02:49 +0000 | [diff] [blame] | 1149 | uint32_t current = 0; |
verwaest@chromium.org | 33e09c8 | 2012-10-10 17:07:22 +0000 | [diff] [blame] | 1150 | for (int i = 0; i < number_of_descriptors(); i++) { |
ulan@chromium.org | 750145a | 2013-03-07 15:14:13 +0000 | [diff] [blame] | 1151 | Name* key = GetSortedKey(i); |
mads.s.ager@gmail.com | 769cc96 | 2008-08-06 10:02:49 +0000 | [diff] [blame] | 1152 | if (key == current_key) { |
| 1153 | PrintDescriptors(); |
| 1154 | return false; |
| 1155 | } |
| 1156 | current_key = key; |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 1157 | uint32_t hash = GetSortedKey(i)->Hash(); |
mads.s.ager@gmail.com | 769cc96 | 2008-08-06 10:02:49 +0000 | [diff] [blame] | 1158 | if (hash < current) { |
| 1159 | PrintDescriptors(); |
| 1160 | return false; |
| 1161 | } |
| 1162 | current = hash; |
| 1163 | } |
| 1164 | return true; |
| 1165 | } |
| 1166 | |
| 1167 | |
verwaest@chromium.org | 06ab2ec | 2012-10-09 17:00:13 +0000 | [diff] [blame] | 1168 | bool TransitionArray::IsSortedNoDuplicates(int valid_entries) { |
| 1169 | ASSERT(valid_entries == -1); |
ulan@chromium.org | 750145a | 2013-03-07 15:14:13 +0000 | [diff] [blame] | 1170 | Name* current_key = NULL; |
yangguo@chromium.org | 99aa490 | 2012-07-06 16:21:55 +0000 | [diff] [blame] | 1171 | uint32_t current = 0; |
| 1172 | for (int i = 0; i < number_of_transitions(); i++) { |
ulan@chromium.org | 750145a | 2013-03-07 15:14:13 +0000 | [diff] [blame] | 1173 | Name* key = GetSortedKey(i); |
yangguo@chromium.org | 99aa490 | 2012-07-06 16:21:55 +0000 | [diff] [blame] | 1174 | if (key == current_key) { |
| 1175 | PrintTransitions(); |
| 1176 | return false; |
| 1177 | } |
| 1178 | current_key = key; |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 1179 | uint32_t hash = GetSortedKey(i)->Hash(); |
yangguo@chromium.org | 99aa490 | 2012-07-06 16:21:55 +0000 | [diff] [blame] | 1180 | if (hash < current) { |
| 1181 | PrintTransitions(); |
| 1182 | return false; |
| 1183 | } |
| 1184 | current = hash; |
| 1185 | } |
| 1186 | return true; |
| 1187 | } |
| 1188 | |
| 1189 | |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 1190 | static bool CheckOneBackPointer(Map* current_map, Object* target) { |
| 1191 | return !target->IsMap() || Map::cast(target)->GetBackPointer() == current_map; |
| 1192 | } |
| 1193 | |
| 1194 | |
yangguo@chromium.org | 99aa490 | 2012-07-06 16:21:55 +0000 | [diff] [blame] | 1195 | bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { |
yangguo@chromium.org | 99aa490 | 2012-07-06 16:21:55 +0000 | [diff] [blame] | 1196 | for (int i = 0; i < number_of_transitions(); ++i) { |
verwaest@chromium.org | 753aee4 | 2012-07-17 16:15:42 +0000 | [diff] [blame] | 1197 | if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
jkummerow@chromium.org | 212d964 | 2012-05-11 15:02:09 +0000 | [diff] [blame] | 1198 | } |
| 1199 | return true; |
| 1200 | } |
| 1201 | |
| 1202 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1203 | #endif // DEBUG |
| 1204 | |
| 1205 | } } // namespace v8::internal |