| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 | 342 |
| 343 void StringStream::PrintUsingMap(JSObject* js_object) { | 343 void StringStream::PrintUsingMap(JSObject* js_object) { |
| 344 Map* map = js_object->map(); | 344 Map* map = js_object->map(); |
| 345 if (!HEAP->Contains(map) || | 345 if (!HEAP->Contains(map) || |
| 346 !map->IsHeapObject() || | 346 !map->IsHeapObject() || |
| 347 !map->IsMap()) { | 347 !map->IsMap()) { |
| 348 Add("<Invalid map>\n"); | 348 Add("<Invalid map>\n"); |
| 349 return; | 349 return; |
| 350 } | 350 } |
| 351 int real_size = map->NumberOfOwnDescriptors(); | |
| 352 DescriptorArray* descs = map->instance_descriptors(); | 351 DescriptorArray* descs = map->instance_descriptors(); |
| 353 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 352 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
| 354 PropertyDetails details = descs->GetDetails(i); | 353 if (descs->GetType(i) == FIELD) { |
| 355 if (details.descriptor_index() > real_size) continue; | |
| 356 if (details.type() == FIELD) { | |
| 357 Object* key = descs->GetKey(i); | 354 Object* key = descs->GetKey(i); |
| 358 if (key->IsString() || key->IsNumber()) { | 355 if (key->IsString() || key->IsNumber()) { |
| 359 int len = 3; | 356 int len = 3; |
| 360 if (key->IsString()) { | 357 if (key->IsString()) { |
| 361 len = String::cast(key)->length(); | 358 len = String::cast(key)->length(); |
| 362 } | 359 } |
| 363 for (; len < 18; len++) | 360 for (; len < 18; len++) |
| 364 Put(' '); | 361 Put(' '); |
| 365 if (key->IsString()) { | 362 if (key->IsString()) { |
| 366 Put(String::cast(key)); | 363 Put(String::cast(key)); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 580 |
| 584 // Only grow once to the maximum allowable size. | 581 // Only grow once to the maximum allowable size. |
| 585 char* NoAllocationStringAllocator::grow(unsigned* bytes) { | 582 char* NoAllocationStringAllocator::grow(unsigned* bytes) { |
| 586 ASSERT(size_ >= *bytes); | 583 ASSERT(size_ >= *bytes); |
| 587 *bytes = size_; | 584 *bytes = size_; |
| 588 return space_; | 585 return space_; |
| 589 } | 586 } |
| 590 | 587 |
| 591 | 588 |
| 592 } } // namespace v8::internal | 589 } } // namespace v8::internal |
| OLD | NEW |