ager@chromium.org | 9258b6b | 2008-09-11 09:11:10 +0000 | [diff] [blame] | 1 | // Copyright 2006-2008 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" |
| 32 | #include "macro-assembler.h" |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 33 | #include "jsregexp.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 34 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 35 | namespace v8 { |
| 36 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 37 | |
| 38 | #ifdef DEBUG |
| 39 | |
| 40 | static const char* TypeToString(InstanceType type); |
| 41 | |
| 42 | |
| 43 | void Object::Print() { |
| 44 | if (IsSmi()) { |
| 45 | Smi::cast(this)->SmiPrint(); |
| 46 | } else if (IsFailure()) { |
| 47 | Failure::cast(this)->FailurePrint(); |
| 48 | } else { |
| 49 | HeapObject::cast(this)->HeapObjectPrint(); |
| 50 | } |
| 51 | Flush(); |
| 52 | } |
| 53 | |
| 54 | |
| 55 | void Object::PrintLn() { |
| 56 | Print(); |
| 57 | PrintF("\n"); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | void Object::Verify() { |
| 62 | if (IsSmi()) { |
| 63 | Smi::cast(this)->SmiVerify(); |
| 64 | } else if (IsFailure()) { |
| 65 | Failure::cast(this)->FailureVerify(); |
| 66 | } else { |
| 67 | HeapObject::cast(this)->HeapObjectVerify(); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | |
| 72 | void Object::VerifyPointer(Object* p) { |
| 73 | if (p->IsHeapObject()) { |
| 74 | HeapObject::VerifyHeapPointer(p); |
| 75 | } else { |
| 76 | ASSERT(p->IsSmi()); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | |
| 81 | void Smi::SmiVerify() { |
| 82 | ASSERT(IsSmi()); |
| 83 | } |
| 84 | |
| 85 | |
| 86 | void Failure::FailureVerify() { |
| 87 | ASSERT(IsFailure()); |
| 88 | } |
| 89 | |
| 90 | |
| 91 | void HeapObject::PrintHeader(const char* id) { |
| 92 | PrintF("%p: [%s]\n", this, id); |
| 93 | } |
| 94 | |
| 95 | |
| 96 | void HeapObject::HeapObjectPrint() { |
| 97 | InstanceType instance_type = map()->instance_type(); |
| 98 | |
| 99 | HandleScope scope; |
| 100 | if (instance_type < FIRST_NONSTRING_TYPE) { |
| 101 | String::cast(this)->StringPrint(); |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | switch (instance_type) { |
| 106 | case MAP_TYPE: |
| 107 | Map::cast(this)->MapPrint(); |
| 108 | break; |
| 109 | case HEAP_NUMBER_TYPE: |
| 110 | HeapNumber::cast(this)->HeapNumberPrint(); |
| 111 | break; |
| 112 | case FIXED_ARRAY_TYPE: |
| 113 | FixedArray::cast(this)->FixedArrayPrint(); |
| 114 | break; |
| 115 | case BYTE_ARRAY_TYPE: |
| 116 | ByteArray::cast(this)->ByteArrayPrint(); |
| 117 | break; |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 118 | case PIXEL_ARRAY_TYPE: |
| 119 | PixelArray::cast(this)->PixelArrayPrint(); |
| 120 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 121 | case FILLER_TYPE: |
| 122 | PrintF("filler"); |
| 123 | break; |
| 124 | case JS_OBJECT_TYPE: // fall through |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 125 | case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 126 | case JS_ARRAY_TYPE: |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 127 | case JS_REGEXP_TYPE: |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 128 | JSObject::cast(this)->JSObjectPrint(); |
| 129 | break; |
| 130 | case ODDBALL_TYPE: |
| 131 | Oddball::cast(this)->to_string()->Print(); |
| 132 | break; |
| 133 | case JS_FUNCTION_TYPE: |
| 134 | JSFunction::cast(this)->JSFunctionPrint(); |
| 135 | break; |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 136 | case JS_GLOBAL_PROXY_TYPE: |
| 137 | JSGlobalProxy::cast(this)->JSGlobalProxyPrint(); |
| 138 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 139 | case JS_GLOBAL_OBJECT_TYPE: |
| 140 | JSGlobalObject::cast(this)->JSGlobalObjectPrint(); |
| 141 | break; |
| 142 | case JS_BUILTINS_OBJECT_TYPE: |
| 143 | JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(); |
| 144 | break; |
| 145 | case JS_VALUE_TYPE: |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 146 | PrintF("Value wrapper around:"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 147 | JSValue::cast(this)->value()->Print(); |
| 148 | break; |
| 149 | case CODE_TYPE: |
| 150 | Code::cast(this)->CodePrint(); |
| 151 | break; |
| 152 | case PROXY_TYPE: |
| 153 | Proxy::cast(this)->ProxyPrint(); |
| 154 | break; |
| 155 | case SHARED_FUNCTION_INFO_TYPE: |
| 156 | SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(); |
| 157 | break; |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 158 | case JS_GLOBAL_PROPERTY_CELL_TYPE: |
| 159 | JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(); |
| 160 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 161 | #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
| 162 | case NAME##_TYPE: \ |
| 163 | Name::cast(this)->Name##Print(); \ |
| 164 | break; |
| 165 | STRUCT_LIST(MAKE_STRUCT_CASE) |
| 166 | #undef MAKE_STRUCT_CASE |
| 167 | |
| 168 | default: |
| 169 | PrintF("UNKNOWN TYPE %d", map()->instance_type()); |
| 170 | UNREACHABLE(); |
| 171 | break; |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | |
| 176 | void HeapObject::HeapObjectVerify() { |
| 177 | InstanceType instance_type = map()->instance_type(); |
| 178 | |
| 179 | if (instance_type < FIRST_NONSTRING_TYPE) { |
| 180 | String::cast(this)->StringVerify(); |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | switch (instance_type) { |
| 185 | case MAP_TYPE: |
| 186 | Map::cast(this)->MapVerify(); |
| 187 | break; |
| 188 | case HEAP_NUMBER_TYPE: |
| 189 | HeapNumber::cast(this)->HeapNumberVerify(); |
| 190 | break; |
| 191 | case FIXED_ARRAY_TYPE: |
| 192 | FixedArray::cast(this)->FixedArrayVerify(); |
| 193 | break; |
| 194 | case BYTE_ARRAY_TYPE: |
| 195 | ByteArray::cast(this)->ByteArrayVerify(); |
| 196 | break; |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 197 | case PIXEL_ARRAY_TYPE: |
| 198 | PixelArray::cast(this)->PixelArrayVerify(); |
| 199 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 200 | case CODE_TYPE: |
| 201 | Code::cast(this)->CodeVerify(); |
| 202 | break; |
| 203 | case ODDBALL_TYPE: |
| 204 | Oddball::cast(this)->OddballVerify(); |
| 205 | break; |
| 206 | case JS_OBJECT_TYPE: |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 207 | case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 208 | JSObject::cast(this)->JSObjectVerify(); |
| 209 | break; |
| 210 | case JS_VALUE_TYPE: |
| 211 | JSValue::cast(this)->JSValueVerify(); |
| 212 | break; |
| 213 | case JS_FUNCTION_TYPE: |
| 214 | JSFunction::cast(this)->JSFunctionVerify(); |
| 215 | break; |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 216 | case JS_GLOBAL_PROXY_TYPE: |
| 217 | JSGlobalProxy::cast(this)->JSGlobalProxyVerify(); |
| 218 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 219 | case JS_GLOBAL_OBJECT_TYPE: |
| 220 | JSGlobalObject::cast(this)->JSGlobalObjectVerify(); |
| 221 | break; |
| 222 | case JS_BUILTINS_OBJECT_TYPE: |
| 223 | JSBuiltinsObject::cast(this)->JSBuiltinsObjectVerify(); |
| 224 | break; |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 225 | case JS_GLOBAL_PROPERTY_CELL_TYPE: |
| 226 | JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellVerify(); |
| 227 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 228 | case JS_ARRAY_TYPE: |
| 229 | JSArray::cast(this)->JSArrayVerify(); |
| 230 | break; |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 231 | case JS_REGEXP_TYPE: |
| 232 | JSRegExp::cast(this)->JSRegExpVerify(); |
| 233 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 234 | case FILLER_TYPE: |
| 235 | break; |
| 236 | case PROXY_TYPE: |
| 237 | Proxy::cast(this)->ProxyVerify(); |
| 238 | break; |
| 239 | case SHARED_FUNCTION_INFO_TYPE: |
| 240 | SharedFunctionInfo::cast(this)->SharedFunctionInfoVerify(); |
| 241 | break; |
| 242 | |
| 243 | #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
| 244 | case NAME##_TYPE: \ |
| 245 | Name::cast(this)->Name##Verify(); \ |
| 246 | break; |
| 247 | STRUCT_LIST(MAKE_STRUCT_CASE) |
| 248 | #undef MAKE_STRUCT_CASE |
| 249 | |
| 250 | default: |
| 251 | UNREACHABLE(); |
| 252 | break; |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | |
| 257 | void HeapObject::VerifyHeapPointer(Object* p) { |
| 258 | ASSERT(p->IsHeapObject()); |
| 259 | ASSERT(Heap::Contains(HeapObject::cast(p))); |
| 260 | } |
| 261 | |
| 262 | |
| 263 | void HeapNumber::HeapNumberVerify() { |
| 264 | ASSERT(IsHeapNumber()); |
| 265 | } |
| 266 | |
| 267 | |
| 268 | void ByteArray::ByteArrayPrint() { |
| 269 | PrintF("byte array, data starts at %p", GetDataStartAddress()); |
| 270 | } |
| 271 | |
| 272 | |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 273 | void PixelArray::PixelArrayPrint() { |
| 274 | PrintF("pixel array"); |
| 275 | } |
| 276 | |
| 277 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 278 | void ByteArray::ByteArrayVerify() { |
| 279 | ASSERT(IsByteArray()); |
| 280 | } |
| 281 | |
| 282 | |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 283 | void PixelArray::PixelArrayVerify() { |
| 284 | ASSERT(IsPixelArray()); |
| 285 | } |
| 286 | |
| 287 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 288 | void JSObject::PrintProperties() { |
| 289 | if (HasFastProperties()) { |
kasperl@chromium.org | defbd10 | 2009-07-13 14:04:26 +0000 | [diff] [blame] | 290 | DescriptorArray* descs = map()->instance_descriptors(); |
| 291 | for (int i = 0; i < descs->number_of_descriptors(); i++) { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 292 | PrintF(" "); |
kasperl@chromium.org | defbd10 | 2009-07-13 14:04:26 +0000 | [diff] [blame] | 293 | descs->GetKey(i)->StringPrint(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 294 | PrintF(": "); |
kasperl@chromium.org | defbd10 | 2009-07-13 14:04:26 +0000 | [diff] [blame] | 295 | switch (descs->GetType(i)) { |
| 296 | case FIELD: { |
| 297 | int index = descs->GetFieldIndex(i); |
| 298 | FastPropertyAt(index)->ShortPrint(); |
| 299 | PrintF(" (field at offset %d)\n", index); |
| 300 | break; |
| 301 | } |
| 302 | case CONSTANT_FUNCTION: |
| 303 | descs->GetConstantFunction(i)->ShortPrint(); |
| 304 | PrintF(" (constant function)\n"); |
| 305 | break; |
| 306 | case CALLBACKS: |
| 307 | descs->GetCallbacksObject(i)->ShortPrint(); |
| 308 | PrintF(" (callback)\n"); |
| 309 | break; |
| 310 | case MAP_TRANSITION: |
| 311 | PrintF(" (map transition)\n"); |
| 312 | break; |
| 313 | case CONSTANT_TRANSITION: |
| 314 | PrintF(" (constant transition)\n"); |
| 315 | break; |
| 316 | case NULL_DESCRIPTOR: |
| 317 | PrintF(" (null descriptor)\n"); |
| 318 | break; |
| 319 | default: |
| 320 | UNREACHABLE(); |
| 321 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 322 | } |
| 323 | } |
| 324 | } else { |
| 325 | property_dictionary()->Print(); |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | |
| 330 | void JSObject::PrintElements() { |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 331 | switch (GetElementsKind()) { |
| 332 | case FAST_ELEMENTS: { |
| 333 | // Print in array notation for non-sparse arrays. |
| 334 | FixedArray* p = FixedArray::cast(elements()); |
| 335 | for (int i = 0; i < p->length(); i++) { |
| 336 | PrintF(" %d: ", i); |
| 337 | p->get(i)->ShortPrint(); |
| 338 | PrintF("\n"); |
| 339 | } |
| 340 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 341 | } |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 342 | case PIXEL_ELEMENTS: { |
| 343 | PixelArray* p = PixelArray::cast(elements()); |
| 344 | for (int i = 0; i < p->length(); i++) { |
| 345 | PrintF(" %d: %d\n", i, p->get(i)); |
| 346 | } |
| 347 | break; |
| 348 | } |
| 349 | case DICTIONARY_ELEMENTS: |
| 350 | elements()->Print(); |
| 351 | break; |
| 352 | default: |
| 353 | UNREACHABLE(); |
| 354 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 355 | } |
| 356 | } |
| 357 | |
| 358 | |
| 359 | void JSObject::JSObjectPrint() { |
| 360 | PrintF("%p: [JSObject]\n", this); |
| 361 | PrintF(" - map = %p\n", map()); |
| 362 | PrintF(" - prototype = %p\n", GetPrototype()); |
| 363 | PrintF(" {\n"); |
| 364 | PrintProperties(); |
| 365 | PrintElements(); |
| 366 | PrintF(" }\n"); |
| 367 | } |
| 368 | |
| 369 | |
| 370 | void JSObject::JSObjectVerify() { |
| 371 | VerifyHeapPointer(properties()); |
| 372 | VerifyHeapPointer(elements()); |
| 373 | if (HasFastProperties()) { |
| 374 | CHECK(map()->unused_property_fields() == |
ager@chromium.org | 7c537e2 | 2008-10-16 08:43:32 +0000 | [diff] [blame] | 375 | (map()->inobject_properties() + properties()->length() - |
| 376 | map()->NextFreePropertyIndex())); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 377 | } |
| 378 | } |
| 379 | |
| 380 | |
| 381 | static const char* TypeToString(InstanceType type) { |
| 382 | switch (type) { |
kasperl@chromium.org | 9fe21c6 | 2008-10-28 08:53:51 +0000 | [diff] [blame] | 383 | case INVALID_TYPE: return "INVALID"; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 384 | case MAP_TYPE: return "MAP"; |
| 385 | case HEAP_NUMBER_TYPE: return "HEAP_NUMBER"; |
| 386 | case SHORT_SYMBOL_TYPE: |
| 387 | case MEDIUM_SYMBOL_TYPE: |
| 388 | case LONG_SYMBOL_TYPE: return "SYMBOL"; |
| 389 | case SHORT_ASCII_SYMBOL_TYPE: |
| 390 | case MEDIUM_ASCII_SYMBOL_TYPE: |
| 391 | case LONG_ASCII_SYMBOL_TYPE: return "ASCII_SYMBOL"; |
| 392 | case SHORT_SLICED_SYMBOL_TYPE: |
| 393 | case MEDIUM_SLICED_SYMBOL_TYPE: |
| 394 | case LONG_SLICED_SYMBOL_TYPE: return "SLICED_SYMBOL"; |
| 395 | case SHORT_SLICED_ASCII_SYMBOL_TYPE: |
| 396 | case MEDIUM_SLICED_ASCII_SYMBOL_TYPE: |
| 397 | case LONG_SLICED_ASCII_SYMBOL_TYPE: return "SLICED_ASCII_SYMBOL"; |
| 398 | case SHORT_CONS_SYMBOL_TYPE: |
| 399 | case MEDIUM_CONS_SYMBOL_TYPE: |
| 400 | case LONG_CONS_SYMBOL_TYPE: return "CONS_SYMBOL"; |
| 401 | case SHORT_CONS_ASCII_SYMBOL_TYPE: |
| 402 | case MEDIUM_CONS_ASCII_SYMBOL_TYPE: |
| 403 | case LONG_CONS_ASCII_SYMBOL_TYPE: return "CONS_ASCII_SYMBOL"; |
| 404 | case SHORT_EXTERNAL_ASCII_SYMBOL_TYPE: |
| 405 | case MEDIUM_EXTERNAL_ASCII_SYMBOL_TYPE: |
| 406 | case LONG_EXTERNAL_ASCII_SYMBOL_TYPE: |
| 407 | case SHORT_EXTERNAL_SYMBOL_TYPE: |
| 408 | case MEDIUM_EXTERNAL_SYMBOL_TYPE: |
| 409 | case LONG_EXTERNAL_SYMBOL_TYPE: return "EXTERNAL_SYMBOL"; |
| 410 | case SHORT_ASCII_STRING_TYPE: |
| 411 | case MEDIUM_ASCII_STRING_TYPE: |
| 412 | case LONG_ASCII_STRING_TYPE: return "ASCII_STRING"; |
| 413 | case SHORT_STRING_TYPE: |
| 414 | case MEDIUM_STRING_TYPE: |
| 415 | case LONG_STRING_TYPE: return "TWO_BYTE_STRING"; |
| 416 | case SHORT_CONS_STRING_TYPE: |
| 417 | case MEDIUM_CONS_STRING_TYPE: |
| 418 | case LONG_CONS_STRING_TYPE: |
| 419 | case SHORT_CONS_ASCII_STRING_TYPE: |
| 420 | case MEDIUM_CONS_ASCII_STRING_TYPE: |
| 421 | case LONG_CONS_ASCII_STRING_TYPE: return "CONS_STRING"; |
| 422 | case SHORT_SLICED_STRING_TYPE: |
| 423 | case MEDIUM_SLICED_STRING_TYPE: |
| 424 | case LONG_SLICED_STRING_TYPE: |
| 425 | case SHORT_SLICED_ASCII_STRING_TYPE: |
| 426 | case MEDIUM_SLICED_ASCII_STRING_TYPE: |
| 427 | case LONG_SLICED_ASCII_STRING_TYPE: return "SLICED_STRING"; |
| 428 | case SHORT_EXTERNAL_ASCII_STRING_TYPE: |
| 429 | case MEDIUM_EXTERNAL_ASCII_STRING_TYPE: |
| 430 | case LONG_EXTERNAL_ASCII_STRING_TYPE: |
| 431 | case SHORT_EXTERNAL_STRING_TYPE: |
| 432 | case MEDIUM_EXTERNAL_STRING_TYPE: |
| 433 | case LONG_EXTERNAL_STRING_TYPE: return "EXTERNAL_STRING"; |
| 434 | case FIXED_ARRAY_TYPE: return "FIXED_ARRAY"; |
| 435 | case BYTE_ARRAY_TYPE: return "BYTE_ARRAY"; |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 436 | case PIXEL_ARRAY_TYPE: return "PIXEL_ARRAY"; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 437 | case FILLER_TYPE: return "FILLER"; |
| 438 | case JS_OBJECT_TYPE: return "JS_OBJECT"; |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 439 | case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 440 | case ODDBALL_TYPE: return "ODDBALL"; |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 441 | case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL"; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 442 | case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; |
| 443 | case JS_FUNCTION_TYPE: return "JS_FUNCTION"; |
| 444 | case CODE_TYPE: return "CODE"; |
| 445 | case JS_ARRAY_TYPE: return "JS_ARRAY"; |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 446 | case JS_REGEXP_TYPE: return "JS_REGEXP"; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 447 | case JS_VALUE_TYPE: return "JS_VALUE"; |
| 448 | case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; |
| 449 | case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 450 | case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 451 | case PROXY_TYPE: return "PROXY"; |
| 452 | case SMI_TYPE: return "SMI"; |
| 453 | #define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; |
| 454 | STRUCT_LIST(MAKE_STRUCT_CASE) |
| 455 | #undef MAKE_STRUCT_CASE |
| 456 | } |
| 457 | return "UNKNOWN"; |
| 458 | } |
| 459 | |
| 460 | |
| 461 | void Map::MapPrint() { |
| 462 | HeapObject::PrintHeader("Map"); |
| 463 | PrintF(" - type: %s\n", TypeToString(instance_type())); |
| 464 | PrintF(" - instance size: %d\n", instance_size()); |
| 465 | PrintF(" - unused property fields: %d\n", unused_property_fields()); |
ager@chromium.org | ddb913d | 2009-01-27 10:01:48 +0000 | [diff] [blame] | 466 | if (is_hidden_prototype()) { |
| 467 | PrintF(" - hidden_prototype\n"); |
| 468 | } |
| 469 | if (has_named_interceptor()) { |
| 470 | PrintF(" - named_interceptor\n"); |
| 471 | } |
| 472 | if (has_indexed_interceptor()) { |
| 473 | PrintF(" - indexed_interceptor\n"); |
| 474 | } |
| 475 | if (is_undetectable()) { |
| 476 | PrintF(" - undetectable\n"); |
| 477 | } |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 478 | if (needs_loading()) { |
| 479 | PrintF(" - needs_loading\n"); |
| 480 | } |
ager@chromium.org | ddb913d | 2009-01-27 10:01:48 +0000 | [diff] [blame] | 481 | if (has_instance_call_handler()) { |
| 482 | PrintF(" - instance_call_handler\n"); |
| 483 | } |
| 484 | if (is_access_check_needed()) { |
| 485 | PrintF(" - access_check_needed\n"); |
| 486 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 487 | PrintF(" - instance descriptors: "); |
| 488 | instance_descriptors()->ShortPrint(); |
| 489 | PrintF("\n - prototype: "); |
| 490 | prototype()->ShortPrint(); |
| 491 | PrintF("\n - constructor: "); |
| 492 | constructor()->ShortPrint(); |
| 493 | PrintF("\n"); |
| 494 | } |
| 495 | |
| 496 | |
| 497 | void Map::MapVerify() { |
| 498 | ASSERT(!Heap::InNewSpace(this)); |
| 499 | ASSERT(FIRST_TYPE <= instance_type() && instance_type() <= LAST_TYPE); |
| 500 | ASSERT(kPointerSize <= instance_size() |
| 501 | && instance_size() < Heap::Capacity()); |
| 502 | VerifyHeapPointer(prototype()); |
| 503 | VerifyHeapPointer(instance_descriptors()); |
| 504 | } |
| 505 | |
| 506 | |
| 507 | void FixedArray::FixedArrayPrint() { |
| 508 | HeapObject::PrintHeader("FixedArray"); |
| 509 | PrintF(" - length: %d", length()); |
| 510 | for (int i = 0; i < length(); i++) { |
| 511 | PrintF("\n [%d]: ", i); |
| 512 | get(i)->ShortPrint(); |
| 513 | } |
| 514 | PrintF("\n"); |
| 515 | } |
| 516 | |
| 517 | |
| 518 | void FixedArray::FixedArrayVerify() { |
| 519 | for (int i = 0; i < length(); i++) { |
| 520 | Object* e = get(i); |
| 521 | if (e->IsHeapObject()) { |
| 522 | VerifyHeapPointer(e); |
| 523 | } else { |
| 524 | e->Verify(); |
| 525 | } |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | |
| 530 | void JSValue::JSValuePrint() { |
| 531 | HeapObject::PrintHeader("ValueObject"); |
| 532 | value()->Print(); |
| 533 | } |
| 534 | |
| 535 | |
| 536 | void JSValue::JSValueVerify() { |
| 537 | Object* v = value(); |
| 538 | if (v->IsHeapObject()) { |
| 539 | VerifyHeapPointer(v); |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | |
| 544 | void String::StringPrint() { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 545 | if (StringShape(this).IsSymbol()) { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 546 | PrintF("#"); |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 547 | } else if (StringShape(this).IsCons()) { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 548 | PrintF("c\""); |
| 549 | } else { |
| 550 | PrintF("\""); |
| 551 | } |
| 552 | |
| 553 | for (int i = 0; i < length(); i++) { |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 554 | PrintF("%c", Get(i)); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 555 | } |
| 556 | |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 557 | if (!StringShape(this).IsSymbol()) PrintF("\""); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | |
| 561 | void String::StringVerify() { |
| 562 | CHECK(IsString()); |
| 563 | CHECK(length() >= 0 && length() <= Smi::kMaxValue); |
| 564 | if (IsSymbol()) { |
| 565 | CHECK(!Heap::InNewSpace(this)); |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | |
| 570 | void JSFunction::JSFunctionPrint() { |
| 571 | HeapObject::PrintHeader("Function"); |
| 572 | PrintF(" - map = 0x%p\n", map()); |
| 573 | PrintF(" - is boilerplate: %s\n", IsBoilerplate() ? "yes" : "no"); |
| 574 | PrintF(" - initial_map = "); |
| 575 | if (has_initial_map()) { |
| 576 | initial_map()->ShortPrint(); |
| 577 | } |
| 578 | PrintF("\n - shared_info = "); |
| 579 | shared()->ShortPrint(); |
| 580 | PrintF("\n - name = "); |
| 581 | shared()->name()->Print(); |
| 582 | PrintF("\n - context = "); |
| 583 | unchecked_context()->ShortPrint(); |
| 584 | PrintF("\n - code = "); |
| 585 | code()->ShortPrint(); |
| 586 | PrintF("\n"); |
| 587 | |
| 588 | PrintProperties(); |
| 589 | PrintElements(); |
| 590 | |
| 591 | PrintF("\n"); |
| 592 | } |
| 593 | |
| 594 | |
| 595 | void JSFunction::JSFunctionVerify() { |
| 596 | CHECK(IsJSFunction()); |
| 597 | VerifyObjectField(kPrototypeOrInitialMapOffset); |
| 598 | } |
| 599 | |
| 600 | |
| 601 | void SharedFunctionInfo::SharedFunctionInfoPrint() { |
| 602 | HeapObject::PrintHeader("SharedFunctionInfo"); |
| 603 | PrintF(" - name: "); |
| 604 | name()->ShortPrint(); |
| 605 | PrintF("\n - expected_nof_properties: %d", expected_nof_properties()); |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 606 | PrintF("\n - instance class name = "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 607 | instance_class_name()->Print(); |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 608 | PrintF("\n - code = "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 609 | code()->ShortPrint(); |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 610 | PrintF("\n - source code = "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 611 | GetSourceCode()->ShortPrint(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 612 | // Script files are often large, hard to read. |
| 613 | // PrintF("\n - script ="); |
| 614 | // script()->Print(); |
| 615 | PrintF("\n - function token position = %d", function_token_position()); |
| 616 | PrintF("\n - start position = %d", start_position()); |
| 617 | PrintF("\n - end position = %d", end_position()); |
| 618 | PrintF("\n - is expression = %d", is_expression()); |
| 619 | PrintF("\n - debug info = "); |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 620 | debug_info()->ShortPrint(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 621 | PrintF("\n - length = %d", length()); |
| 622 | PrintF("\n"); |
| 623 | } |
| 624 | |
| 625 | void SharedFunctionInfo::SharedFunctionInfoVerify() { |
| 626 | CHECK(IsSharedFunctionInfo()); |
| 627 | VerifyObjectField(kNameOffset); |
| 628 | VerifyObjectField(kCodeOffset); |
| 629 | VerifyObjectField(kInstanceClassNameOffset); |
| 630 | VerifyObjectField(kExternalReferenceDataOffset); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 631 | VerifyObjectField(kScriptOffset); |
| 632 | VerifyObjectField(kDebugInfoOffset); |
| 633 | } |
| 634 | |
| 635 | |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 636 | void JSGlobalProxy::JSGlobalProxyPrint() { |
| 637 | PrintF("global_proxy"); |
| 638 | JSObjectPrint(); |
| 639 | PrintF("context : "); |
| 640 | context()->ShortPrint(); |
| 641 | PrintF("\n"); |
| 642 | } |
| 643 | |
| 644 | |
| 645 | void JSGlobalProxy::JSGlobalProxyVerify() { |
| 646 | CHECK(IsJSGlobalProxy()); |
| 647 | JSObjectVerify(); |
| 648 | VerifyObjectField(JSGlobalProxy::kContextOffset); |
| 649 | // Make sure that this object has no properties, elements. |
| 650 | CHECK_EQ(0, properties()->length()); |
| 651 | CHECK_EQ(0, elements()->length()); |
| 652 | } |
| 653 | |
| 654 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 655 | void JSGlobalObject::JSGlobalObjectPrint() { |
| 656 | PrintF("global "); |
| 657 | JSObjectPrint(); |
kasperl@chromium.org | 5a8ca6c | 2008-10-23 13:57:19 +0000 | [diff] [blame] | 658 | PrintF("global context : "); |
| 659 | global_context()->ShortPrint(); |
| 660 | PrintF("\n"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 661 | } |
| 662 | |
| 663 | |
| 664 | void JSGlobalObject::JSGlobalObjectVerify() { |
| 665 | CHECK(IsJSGlobalObject()); |
| 666 | JSObjectVerify(); |
| 667 | for (int i = GlobalObject::kBuiltinsOffset; |
| 668 | i < JSGlobalObject::kSize; |
| 669 | i += kPointerSize) { |
| 670 | VerifyObjectField(i); |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | |
| 675 | void JSBuiltinsObject::JSBuiltinsObjectPrint() { |
| 676 | PrintF("builtins "); |
| 677 | JSObjectPrint(); |
| 678 | } |
| 679 | |
| 680 | |
| 681 | void JSBuiltinsObject::JSBuiltinsObjectVerify() { |
| 682 | CHECK(IsJSBuiltinsObject()); |
| 683 | JSObjectVerify(); |
| 684 | for (int i = GlobalObject::kBuiltinsOffset; |
| 685 | i < JSBuiltinsObject::kSize; |
| 686 | i += kPointerSize) { |
| 687 | VerifyObjectField(i); |
| 688 | } |
| 689 | } |
| 690 | |
| 691 | |
| 692 | void Oddball::OddballVerify() { |
| 693 | CHECK(IsOddball()); |
| 694 | VerifyHeapPointer(to_string()); |
| 695 | Object* number = to_number(); |
| 696 | if (number->IsHeapObject()) { |
| 697 | ASSERT(number == Heap::nan_value()); |
| 698 | } else { |
| 699 | ASSERT(number->IsSmi()); |
| 700 | int value = Smi::cast(number)->value(); |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 701 | ASSERT(value == 0 || value == 1 || value == -1 || value == -2); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 702 | } |
| 703 | } |
| 704 | |
| 705 | |
kasperl@chromium.org | 2abc450 | 2009-07-02 07:00:29 +0000 | [diff] [blame] | 706 | void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() { |
| 707 | CHECK(IsJSGlobalPropertyCell()); |
| 708 | VerifyObjectField(kValueOffset); |
| 709 | } |
| 710 | |
| 711 | |
| 712 | void JSGlobalPropertyCell::JSGlobalPropertyCellPrint() { |
| 713 | HeapObject::PrintHeader("JSGlobalPropertyCell"); |
| 714 | } |
| 715 | |
| 716 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 717 | void Code::CodePrint() { |
| 718 | HeapObject::PrintHeader("Code"); |
mads.s.ager | 31e7138 | 2008-08-13 09:32:07 +0000 | [diff] [blame] | 719 | #ifdef ENABLE_DISASSEMBLER |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 720 | Disassemble(NULL); |
mads.s.ager | 31e7138 | 2008-08-13 09:32:07 +0000 | [diff] [blame] | 721 | #endif |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | |
| 725 | void Code::CodeVerify() { |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 726 | CHECK(ic_flag() == IC_TARGET_IS_ADDRESS); |
kasperl@chromium.org | 061ef74 | 2009-02-27 12:16:20 +0000 | [diff] [blame] | 727 | CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()), |
| 728 | static_cast<intptr_t>(kCodeAlignment))); |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 729 | Address last_gc_pc = NULL; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 730 | for (RelocIterator it(this); !it.done(); it.next()) { |
| 731 | it.rinfo()->Verify(); |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 732 | // Ensure that GC will not iterate twice over the same pointer. |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 733 | if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { |
kasper.lund | 7276f14 | 2008-07-30 08:49:36 +0000 | [diff] [blame] | 734 | CHECK(it.rinfo()->pc() != last_gc_pc); |
| 735 | last_gc_pc = it.rinfo()->pc(); |
| 736 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 737 | } |
| 738 | } |
| 739 | |
| 740 | |
| 741 | void JSArray::JSArrayVerify() { |
| 742 | JSObjectVerify(); |
| 743 | ASSERT(length()->IsNumber() || length()->IsUndefined()); |
| 744 | ASSERT(elements()->IsUndefined() || elements()->IsFixedArray()); |
| 745 | } |
| 746 | |
| 747 | |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 748 | void JSRegExp::JSRegExpVerify() { |
| 749 | JSObjectVerify(); |
kasperl@chromium.org | 9fe21c6 | 2008-10-28 08:53:51 +0000 | [diff] [blame] | 750 | ASSERT(data()->IsUndefined() || data()->IsFixedArray()); |
| 751 | switch (TypeTag()) { |
| 752 | case JSRegExp::ATOM: { |
| 753 | FixedArray* arr = FixedArray::cast(data()); |
| 754 | ASSERT(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); |
| 755 | break; |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 756 | } |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 757 | case JSRegExp::IRREGEXP: { |
kasperl@chromium.org | 68ac009 | 2009-07-09 06:00:35 +0000 | [diff] [blame] | 758 | bool is_native = RegExpImpl::UsesNativeRegExp(); |
ager@chromium.org | bb29dc9 | 2009-03-24 13:25:23 +0000 | [diff] [blame] | 759 | |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 760 | FixedArray* arr = FixedArray::cast(data()); |
kasperl@chromium.org | 7be3c99 | 2009-03-12 07:19:55 +0000 | [diff] [blame] | 761 | Object* ascii_data = arr->get(JSRegExp::kIrregexpASCIICodeIndex); |
| 762 | ASSERT(ascii_data->IsTheHole() |
| 763 | || (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray())); |
| 764 | Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex); |
| 765 | ASSERT(uc16_data->IsTheHole() |
| 766 | || (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray())); |
| 767 | ASSERT(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi()); |
| 768 | ASSERT(arr->get(JSRegExp::kIrregexpMaxRegisterCountIndex)->IsSmi()); |
kasperl@chromium.org | 9fe21c6 | 2008-10-28 08:53:51 +0000 | [diff] [blame] | 769 | break; |
| 770 | } |
| 771 | default: |
| 772 | ASSERT_EQ(JSRegExp::NOT_COMPILED, TypeTag()); |
| 773 | ASSERT(data()->IsUndefined()); |
| 774 | break; |
kasperl@chromium.org | 41044eb | 2008-10-06 08:24:46 +0000 | [diff] [blame] | 775 | } |
ager@chromium.org | 236ad96 | 2008-09-25 09:45:57 +0000 | [diff] [blame] | 776 | } |
| 777 | |
| 778 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 779 | void Proxy::ProxyPrint() { |
| 780 | PrintF("proxy to %p", proxy()); |
| 781 | } |
| 782 | |
| 783 | |
| 784 | void Proxy::ProxyVerify() { |
| 785 | ASSERT(IsProxy()); |
| 786 | } |
| 787 | |
| 788 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 789 | void AccessorInfo::AccessorInfoVerify() { |
| 790 | CHECK(IsAccessorInfo()); |
| 791 | VerifyPointer(getter()); |
| 792 | VerifyPointer(setter()); |
| 793 | VerifyPointer(name()); |
| 794 | VerifyPointer(data()); |
| 795 | VerifyPointer(flag()); |
| 796 | } |
| 797 | |
| 798 | void AccessorInfo::AccessorInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 799 | HeapObject::PrintHeader("AccessorInfo"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 800 | PrintF("\n - getter: "); |
| 801 | getter()->ShortPrint(); |
| 802 | PrintF("\n - setter: "); |
| 803 | setter()->ShortPrint(); |
| 804 | PrintF("\n - name: "); |
| 805 | name()->ShortPrint(); |
| 806 | PrintF("\n - data: "); |
| 807 | data()->ShortPrint(); |
| 808 | PrintF("\n - flag: "); |
| 809 | flag()->ShortPrint(); |
| 810 | } |
| 811 | |
| 812 | void AccessCheckInfo::AccessCheckInfoVerify() { |
| 813 | CHECK(IsAccessCheckInfo()); |
| 814 | VerifyPointer(named_callback()); |
| 815 | VerifyPointer(indexed_callback()); |
| 816 | VerifyPointer(data()); |
| 817 | } |
| 818 | |
| 819 | void AccessCheckInfo::AccessCheckInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 820 | HeapObject::PrintHeader("AccessCheckInfo"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 821 | PrintF("\n - named_callback: "); |
| 822 | named_callback()->ShortPrint(); |
| 823 | PrintF("\n - indexed_callback: "); |
| 824 | indexed_callback()->ShortPrint(); |
| 825 | PrintF("\n - data: "); |
| 826 | data()->ShortPrint(); |
| 827 | } |
| 828 | |
| 829 | void InterceptorInfo::InterceptorInfoVerify() { |
| 830 | CHECK(IsInterceptorInfo()); |
| 831 | VerifyPointer(getter()); |
| 832 | VerifyPointer(setter()); |
| 833 | VerifyPointer(query()); |
| 834 | VerifyPointer(deleter()); |
| 835 | VerifyPointer(enumerator()); |
| 836 | VerifyPointer(data()); |
| 837 | } |
| 838 | |
| 839 | void InterceptorInfo::InterceptorInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 840 | HeapObject::PrintHeader("InterceptorInfo"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 841 | PrintF("\n - getter: "); |
| 842 | getter()->ShortPrint(); |
| 843 | PrintF("\n - setter: "); |
| 844 | setter()->ShortPrint(); |
| 845 | PrintF("\n - query: "); |
| 846 | query()->ShortPrint(); |
| 847 | PrintF("\n - deleter: "); |
| 848 | deleter()->ShortPrint(); |
| 849 | PrintF("\n - enumerator: "); |
| 850 | enumerator()->ShortPrint(); |
| 851 | PrintF("\n - data: "); |
| 852 | data()->ShortPrint(); |
| 853 | } |
| 854 | |
| 855 | void CallHandlerInfo::CallHandlerInfoVerify() { |
| 856 | CHECK(IsCallHandlerInfo()); |
| 857 | VerifyPointer(callback()); |
| 858 | VerifyPointer(data()); |
| 859 | } |
| 860 | |
| 861 | void CallHandlerInfo::CallHandlerInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 862 | HeapObject::PrintHeader("CallHandlerInfo"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 863 | PrintF("\n - callback: "); |
| 864 | callback()->ShortPrint(); |
| 865 | PrintF("\n - data: "); |
| 866 | data()->ShortPrint(); |
| 867 | } |
| 868 | |
| 869 | void TemplateInfo::TemplateInfoVerify() { |
| 870 | VerifyPointer(tag()); |
| 871 | VerifyPointer(property_list()); |
| 872 | } |
| 873 | |
| 874 | void FunctionTemplateInfo::FunctionTemplateInfoVerify() { |
| 875 | CHECK(IsFunctionTemplateInfo()); |
| 876 | TemplateInfoVerify(); |
| 877 | VerifyPointer(serial_number()); |
| 878 | VerifyPointer(call_code()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 879 | VerifyPointer(property_accessors()); |
| 880 | VerifyPointer(prototype_template()); |
| 881 | VerifyPointer(parent_template()); |
| 882 | VerifyPointer(named_property_handler()); |
| 883 | VerifyPointer(indexed_property_handler()); |
| 884 | VerifyPointer(instance_template()); |
| 885 | VerifyPointer(signature()); |
| 886 | VerifyPointer(access_check_info()); |
| 887 | } |
| 888 | |
| 889 | void FunctionTemplateInfo::FunctionTemplateInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 890 | HeapObject::PrintHeader("FunctionTemplateInfo"); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 891 | PrintF("\n - tag: "); |
| 892 | tag()->ShortPrint(); |
| 893 | PrintF("\n - property_list: "); |
| 894 | property_list()->ShortPrint(); |
| 895 | PrintF("\n - serial_number: "); |
| 896 | serial_number()->ShortPrint(); |
| 897 | PrintF("\n - call_code: "); |
| 898 | call_code()->ShortPrint(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 899 | PrintF("\n - property_accessors: "); |
| 900 | property_accessors()->ShortPrint(); |
| 901 | PrintF("\n - prototype_template: "); |
| 902 | prototype_template()->ShortPrint(); |
| 903 | PrintF("\n - parent_template: "); |
| 904 | parent_template()->ShortPrint(); |
| 905 | PrintF("\n - named_property_handler: "); |
| 906 | named_property_handler()->ShortPrint(); |
| 907 | PrintF("\n - indexed_property_handler: "); |
| 908 | indexed_property_handler()->ShortPrint(); |
| 909 | PrintF("\n - instance_template: "); |
| 910 | instance_template()->ShortPrint(); |
| 911 | PrintF("\n - signature: "); |
| 912 | signature()->ShortPrint(); |
| 913 | PrintF("\n - access_check_info: "); |
| 914 | access_check_info()->ShortPrint(); |
| 915 | PrintF("\n - hidden_prototype: %s", hidden_prototype() ? "true" : "false"); |
| 916 | PrintF("\n - undetectable: %s", undetectable() ? "true" : "false"); |
| 917 | PrintF("\n - need_access_check: %s", needs_access_check() ? "true" : "false"); |
| 918 | } |
| 919 | |
| 920 | void ObjectTemplateInfo::ObjectTemplateInfoVerify() { |
| 921 | CHECK(IsObjectTemplateInfo()); |
| 922 | TemplateInfoVerify(); |
| 923 | VerifyPointer(constructor()); |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 924 | VerifyPointer(internal_field_count()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 925 | } |
| 926 | |
| 927 | void ObjectTemplateInfo::ObjectTemplateInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 928 | HeapObject::PrintHeader("ObjectTemplateInfo"); |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 929 | PrintF("\n - constructor: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 930 | constructor()->ShortPrint(); |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 931 | PrintF("\n - internal_field_count: "); |
| 932 | internal_field_count()->ShortPrint(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 933 | } |
| 934 | |
| 935 | void SignatureInfo::SignatureInfoVerify() { |
| 936 | CHECK(IsSignatureInfo()); |
| 937 | VerifyPointer(receiver()); |
| 938 | VerifyPointer(args()); |
| 939 | } |
| 940 | |
| 941 | void SignatureInfo::SignatureInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 942 | HeapObject::PrintHeader("SignatureInfo"); |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 943 | PrintF("\n - receiver: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 944 | receiver()->ShortPrint(); |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 945 | PrintF("\n - args: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 946 | args()->ShortPrint(); |
| 947 | } |
| 948 | |
| 949 | void TypeSwitchInfo::TypeSwitchInfoVerify() { |
| 950 | CHECK(IsTypeSwitchInfo()); |
| 951 | VerifyPointer(types()); |
| 952 | } |
| 953 | |
| 954 | void TypeSwitchInfo::TypeSwitchInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 955 | HeapObject::PrintHeader("TypeSwitchInfo"); |
kasper.lund | 212ac23 | 2008-07-16 07:07:30 +0000 | [diff] [blame] | 956 | PrintF("\n - types: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 957 | types()->ShortPrint(); |
| 958 | } |
| 959 | |
| 960 | |
| 961 | void Script::ScriptVerify() { |
| 962 | CHECK(IsScript()); |
| 963 | VerifyPointer(source()); |
| 964 | VerifyPointer(name()); |
| 965 | line_offset()->SmiVerify(); |
| 966 | column_offset()->SmiVerify(); |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 967 | VerifyPointer(data()); |
| 968 | VerifyPointer(wrapper()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 969 | type()->SmiVerify(); |
ager@chromium.org | 65dad4b | 2009-04-23 08:48:43 +0000 | [diff] [blame] | 970 | VerifyPointer(line_ends()); |
| 971 | VerifyPointer(id()); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 972 | } |
| 973 | |
| 974 | |
| 975 | void Script::ScriptPrint() { |
| 976 | HeapObject::PrintHeader("Script"); |
| 977 | PrintF("\n - source: "); |
| 978 | source()->ShortPrint(); |
| 979 | PrintF("\n - name: "); |
| 980 | name()->ShortPrint(); |
| 981 | PrintF("\n - line_offset: "); |
| 982 | line_offset()->ShortPrint(); |
| 983 | PrintF("\n - column_offset: "); |
| 984 | column_offset()->ShortPrint(); |
| 985 | PrintF("\n - type: "); |
| 986 | type()->ShortPrint(); |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 987 | PrintF("\n - id: "); |
| 988 | id()->ShortPrint(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 989 | PrintF("\n"); |
| 990 | } |
| 991 | |
| 992 | |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 993 | #ifdef ENABLE_DEBUGGER_SUPPORT |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 994 | void DebugInfo::DebugInfoVerify() { |
| 995 | CHECK(IsDebugInfo()); |
| 996 | VerifyPointer(shared()); |
| 997 | VerifyPointer(original_code()); |
| 998 | VerifyPointer(code()); |
| 999 | VerifyPointer(break_points()); |
| 1000 | } |
| 1001 | |
| 1002 | |
| 1003 | void DebugInfo::DebugInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 1004 | HeapObject::PrintHeader("DebugInfo"); |
| 1005 | PrintF("\n - shared: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1006 | shared()->ShortPrint(); |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 1007 | PrintF("\n - original_code: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1008 | original_code()->ShortPrint(); |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 1009 | PrintF("\n - code: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1010 | code()->ShortPrint(); |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 1011 | PrintF("\n - break_points: "); |
| 1012 | break_points()->Print(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1013 | } |
| 1014 | |
| 1015 | |
| 1016 | void BreakPointInfo::BreakPointInfoVerify() { |
| 1017 | CHECK(IsBreakPointInfo()); |
| 1018 | code_position()->SmiVerify(); |
| 1019 | source_position()->SmiVerify(); |
| 1020 | statement_position()->SmiVerify(); |
| 1021 | VerifyPointer(break_point_objects()); |
| 1022 | } |
| 1023 | |
| 1024 | |
| 1025 | void BreakPointInfo::BreakPointInfoPrint() { |
ager@chromium.org | 381abbb | 2009-02-25 13:23:22 +0000 | [diff] [blame] | 1026 | HeapObject::PrintHeader("BreakPointInfo"); |
| 1027 | PrintF("\n - code_position: %d", code_position()); |
| 1028 | PrintF("\n - source_position: %d", source_position()); |
| 1029 | PrintF("\n - statement_position: %d", statement_position()); |
| 1030 | PrintF("\n - break_point_objects: "); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1031 | break_point_objects()->ShortPrint(); |
| 1032 | } |
kasperl@chromium.org | e959c18 | 2009-07-27 08:59:04 +0000 | [diff] [blame] | 1033 | #endif |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1034 | |
| 1035 | |
| 1036 | void JSObject::IncrementSpillStatistics(SpillInformation* info) { |
| 1037 | info->number_of_objects_++; |
| 1038 | // Named properties |
| 1039 | if (HasFastProperties()) { |
| 1040 | info->number_of_objects_with_fast_properties_++; |
| 1041 | info->number_of_fast_used_fields_ += map()->NextFreePropertyIndex(); |
| 1042 | info->number_of_fast_unused_fields_ += map()->unused_property_fields(); |
| 1043 | } else { |
kasperl@chromium.org | 86f77b7 | 2009-07-06 08:21:57 +0000 | [diff] [blame] | 1044 | StringDictionary* dict = property_dictionary(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1045 | info->number_of_slow_used_properties_ += dict->NumberOfElements(); |
| 1046 | info->number_of_slow_unused_properties_ += |
| 1047 | dict->Capacity() - dict->NumberOfElements(); |
| 1048 | } |
| 1049 | // Indexed properties |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 1050 | switch (GetElementsKind()) { |
| 1051 | case FAST_ELEMENTS: { |
| 1052 | info->number_of_objects_with_fast_elements_++; |
| 1053 | int holes = 0; |
| 1054 | FixedArray* e = FixedArray::cast(elements()); |
| 1055 | int len = e->length(); |
| 1056 | for (int i = 0; i < len; i++) { |
| 1057 | if (e->get(i) == Heap::the_hole_value()) holes++; |
| 1058 | } |
| 1059 | info->number_of_fast_used_elements_ += len - holes; |
| 1060 | info->number_of_fast_unused_elements_ += holes; |
| 1061 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1062 | } |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame^] | 1063 | case PIXEL_ELEMENTS: { |
| 1064 | info->number_of_objects_with_fast_elements_++; |
| 1065 | PixelArray* e = PixelArray::cast(elements()); |
| 1066 | info->number_of_fast_used_elements_ += e->length(); |
| 1067 | break; |
| 1068 | } |
| 1069 | case DICTIONARY_ELEMENTS: { |
| 1070 | NumberDictionary* dict = element_dictionary(); |
| 1071 | info->number_of_slow_used_elements_ += dict->NumberOfElements(); |
| 1072 | info->number_of_slow_unused_elements_ += |
| 1073 | dict->Capacity() - dict->NumberOfElements(); |
| 1074 | break; |
| 1075 | } |
| 1076 | default: |
| 1077 | UNREACHABLE(); |
| 1078 | break; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1079 | } |
| 1080 | } |
| 1081 | |
| 1082 | |
| 1083 | void JSObject::SpillInformation::Clear() { |
| 1084 | number_of_objects_ = 0; |
| 1085 | number_of_objects_with_fast_properties_ = 0; |
| 1086 | number_of_objects_with_fast_elements_ = 0; |
| 1087 | number_of_fast_used_fields_ = 0; |
| 1088 | number_of_fast_unused_fields_ = 0; |
| 1089 | number_of_slow_used_properties_ = 0; |
| 1090 | number_of_slow_unused_properties_ = 0; |
| 1091 | number_of_fast_used_elements_ = 0; |
| 1092 | number_of_fast_unused_elements_ = 0; |
| 1093 | number_of_slow_used_elements_ = 0; |
| 1094 | number_of_slow_unused_elements_ = 0; |
| 1095 | } |
| 1096 | |
| 1097 | void JSObject::SpillInformation::Print() { |
| 1098 | PrintF("\n JSObject Spill Statistics (#%d):\n", number_of_objects_); |
| 1099 | |
| 1100 | PrintF(" - fast properties (#%d): %d (used) %d (unused)\n", |
| 1101 | number_of_objects_with_fast_properties_, |
| 1102 | number_of_fast_used_fields_, number_of_fast_unused_fields_); |
| 1103 | |
| 1104 | PrintF(" - slow properties (#%d): %d (used) %d (unused)\n", |
| 1105 | number_of_objects_ - number_of_objects_with_fast_properties_, |
| 1106 | number_of_slow_used_properties_, number_of_slow_unused_properties_); |
| 1107 | |
| 1108 | PrintF(" - fast elements (#%d): %d (used) %d (unused)\n", |
| 1109 | number_of_objects_with_fast_elements_, |
| 1110 | number_of_fast_used_elements_, number_of_fast_unused_elements_); |
| 1111 | |
| 1112 | PrintF(" - slow elements (#%d): %d (used) %d (unused)\n", |
| 1113 | number_of_objects_ - number_of_objects_with_fast_elements_, |
| 1114 | number_of_slow_used_elements_, number_of_slow_unused_elements_); |
| 1115 | |
| 1116 | PrintF("\n"); |
| 1117 | } |
| 1118 | |
| 1119 | |
| 1120 | void DescriptorArray::PrintDescriptors() { |
| 1121 | PrintF("Descriptor array %d\n", number_of_descriptors()); |
kasperl@chromium.org | defbd10 | 2009-07-13 14:04:26 +0000 | [diff] [blame] | 1122 | for (int i = 0; i < number_of_descriptors(); i++) { |
| 1123 | PrintF(" %d: ", i); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1124 | Descriptor desc; |
kasperl@chromium.org | defbd10 | 2009-07-13 14:04:26 +0000 | [diff] [blame] | 1125 | Get(i, &desc); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1126 | desc.Print(); |
| 1127 | } |
| 1128 | PrintF("\n"); |
| 1129 | } |
| 1130 | |
| 1131 | |
mads.s.ager@gmail.com | 769cc96 | 2008-08-06 10:02:49 +0000 | [diff] [blame] | 1132 | bool DescriptorArray::IsSortedNoDuplicates() { |
| 1133 | String* current_key = NULL; |
| 1134 | uint32_t current = 0; |
kasperl@chromium.org | defbd10 | 2009-07-13 14:04:26 +0000 | [diff] [blame] | 1135 | for (int i = 0; i < number_of_descriptors(); i++) { |
| 1136 | String* key = GetKey(i); |
mads.s.ager@gmail.com | 769cc96 | 2008-08-06 10:02:49 +0000 | [diff] [blame] | 1137 | if (key == current_key) { |
| 1138 | PrintDescriptors(); |
| 1139 | return false; |
| 1140 | } |
| 1141 | current_key = key; |
kasperl@chromium.org | defbd10 | 2009-07-13 14:04:26 +0000 | [diff] [blame] | 1142 | uint32_t hash = GetKey(i)->Hash(); |
mads.s.ager@gmail.com | 769cc96 | 2008-08-06 10:02:49 +0000 | [diff] [blame] | 1143 | if (hash < current) { |
| 1144 | PrintDescriptors(); |
| 1145 | return false; |
| 1146 | } |
| 1147 | current = hash; |
| 1148 | } |
| 1149 | return true; |
| 1150 | } |
| 1151 | |
| 1152 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 1153 | #endif // DEBUG |
| 1154 | |
| 1155 | } } // namespace v8::internal |