| 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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 626 |
| 627 // Verify() is inline to avoid ifdef-s around its calls in release | 627 // Verify() is inline to avoid ifdef-s around its calls in release |
| 628 // mode. | 628 // mode. |
| 629 void ExternalStringTable::Verify() { | 629 void ExternalStringTable::Verify() { |
| 630 #ifdef DEBUG | 630 #ifdef DEBUG |
| 631 for (int i = 0; i < new_space_strings_.length(); ++i) { | 631 for (int i = 0; i < new_space_strings_.length(); ++i) { |
| 632 Object* obj = Object::cast(new_space_strings_[i]); | 632 Object* obj = Object::cast(new_space_strings_[i]); |
| 633 // TODO(yangguo): check that the object is indeed an external string. | 633 // TODO(yangguo): check that the object is indeed an external string. |
| 634 ASSERT(heap_->InNewSpace(obj)); | 634 ASSERT(heap_->InNewSpace(obj)); |
| 635 ASSERT(obj != HEAP->the_hole_value()); | 635 ASSERT(obj != HEAP->the_hole_value()); |
| 636 #ifndef ENABLE_LATIN_1 |
| 636 if (obj->IsExternalAsciiString()) { | 637 if (obj->IsExternalAsciiString()) { |
| 637 ExternalAsciiString* string = ExternalAsciiString::cast(obj); | 638 ExternalAsciiString* string = ExternalAsciiString::cast(obj); |
| 638 ASSERT(String::IsAscii(string->GetChars(), string->length())); | 639 ASSERT(String::IsAscii(string->GetChars(), string->length())); |
| 639 } | 640 } |
| 641 #endif |
| 640 } | 642 } |
| 641 for (int i = 0; i < old_space_strings_.length(); ++i) { | 643 for (int i = 0; i < old_space_strings_.length(); ++i) { |
| 642 Object* obj = Object::cast(old_space_strings_[i]); | 644 Object* obj = Object::cast(old_space_strings_[i]); |
| 643 // TODO(yangguo): check that the object is indeed an external string. | 645 // TODO(yangguo): check that the object is indeed an external string. |
| 644 ASSERT(!heap_->InNewSpace(obj)); | 646 ASSERT(!heap_->InNewSpace(obj)); |
| 645 ASSERT(obj != HEAP->the_hole_value()); | 647 ASSERT(obj != HEAP->the_hole_value()); |
| 648 #ifndef ENABLE_LATIN_1 |
| 646 if (obj->IsExternalAsciiString()) { | 649 if (obj->IsExternalAsciiString()) { |
| 647 ExternalAsciiString* string = ExternalAsciiString::cast(obj); | 650 ExternalAsciiString* string = ExternalAsciiString::cast(obj); |
| 648 ASSERT(String::IsAscii(string->GetChars(), string->length())); | 651 ASSERT(String::IsAscii(string->GetChars(), string->length())); |
| 649 } | 652 } |
| 653 #endif |
| 650 } | 654 } |
| 651 #endif | 655 #endif |
| 652 } | 656 } |
| 653 | 657 |
| 654 | 658 |
| 655 void ExternalStringTable::AddOldString(String* string) { | 659 void ExternalStringTable::AddOldString(String* string) { |
| 656 ASSERT(string->IsExternalString()); | 660 ASSERT(string->IsExternalString()); |
| 657 ASSERT(!heap_->InNewSpace(string)); | 661 ASSERT(!heap_->InNewSpace(string)); |
| 658 old_space_strings_.Add(string); | 662 old_space_strings_.Add(string); |
| 659 } | 663 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 AssertNoAllocation::~AssertNoAllocation() { } | 833 AssertNoAllocation::~AssertNoAllocation() { } |
| 830 DisableAssertNoAllocation::DisableAssertNoAllocation() { } | 834 DisableAssertNoAllocation::DisableAssertNoAllocation() { } |
| 831 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } | 835 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } |
| 832 | 836 |
| 833 #endif | 837 #endif |
| 834 | 838 |
| 835 | 839 |
| 836 } } // namespace v8::internal | 840 } } // namespace v8::internal |
| 837 | 841 |
| 838 #endif // V8_HEAP_INL_H_ | 842 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |