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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 | 600 |
601 | 601 |
602 // Verify() is inline to avoid ifdef-s around its calls in release | 602 // Verify() is inline to avoid ifdef-s around its calls in release |
603 // mode. | 603 // mode. |
604 void ExternalStringTable::Verify() { | 604 void ExternalStringTable::Verify() { |
605 #ifdef DEBUG | 605 #ifdef DEBUG |
606 for (int i = 0; i < new_space_strings_.length(); ++i) { | 606 for (int i = 0; i < new_space_strings_.length(); ++i) { |
607 Object* obj = Object::cast(new_space_strings_[i]); | 607 Object* obj = Object::cast(new_space_strings_[i]); |
608 // TODO(yangguo): check that the object is indeed an external string. | 608 // TODO(yangguo): check that the object is indeed an external string. |
609 ASSERT(heap_->InNewSpace(obj)); | 609 ASSERT(heap_->InNewSpace(obj)); |
610 ASSERT(obj != HEAP->raw_unchecked_the_hole_value()); | 610 ASSERT(obj != HEAP->the_hole_value()); |
611 if (obj->IsExternalAsciiString()) { | 611 if (obj->IsExternalAsciiString()) { |
612 ExternalAsciiString* string = ExternalAsciiString::cast(obj); | 612 ExternalAsciiString* string = ExternalAsciiString::cast(obj); |
613 ASSERT(String::IsAscii(string->GetChars(), string->length())); | 613 ASSERT(String::IsAscii(string->GetChars(), string->length())); |
614 } | 614 } |
615 } | 615 } |
616 for (int i = 0; i < old_space_strings_.length(); ++i) { | 616 for (int i = 0; i < old_space_strings_.length(); ++i) { |
617 Object* obj = Object::cast(old_space_strings_[i]); | 617 Object* obj = Object::cast(old_space_strings_[i]); |
618 // TODO(yangguo): check that the object is indeed an external string. | 618 // TODO(yangguo): check that the object is indeed an external string. |
619 ASSERT(!heap_->InNewSpace(obj)); | 619 ASSERT(!heap_->InNewSpace(obj)); |
620 ASSERT(obj != HEAP->raw_unchecked_the_hole_value()); | 620 ASSERT(obj != HEAP->the_hole_value()); |
621 if (obj->IsExternalAsciiString()) { | 621 if (obj->IsExternalAsciiString()) { |
622 ExternalAsciiString* string = ExternalAsciiString::cast(obj); | 622 ExternalAsciiString* string = ExternalAsciiString::cast(obj); |
623 ASSERT(String::IsAscii(string->GetChars(), string->length())); | 623 ASSERT(String::IsAscii(string->GetChars(), string->length())); |
624 } | 624 } |
625 } | 625 } |
626 #endif | 626 #endif |
627 } | 627 } |
628 | 628 |
629 | 629 |
630 void ExternalStringTable::AddOldString(String* string) { | 630 void ExternalStringTable::AddOldString(String* string) { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 AssertNoAllocation::~AssertNoAllocation() { } | 804 AssertNoAllocation::~AssertNoAllocation() { } |
805 DisableAssertNoAllocation::DisableAssertNoAllocation() { } | 805 DisableAssertNoAllocation::DisableAssertNoAllocation() { } |
806 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } | 806 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } |
807 | 807 |
808 #endif | 808 #endif |
809 | 809 |
810 | 810 |
811 } } // namespace v8::internal | 811 } } // namespace v8::internal |
812 | 812 |
813 #endif // V8_HEAP_INL_H_ | 813 #endif // V8_HEAP_INL_H_ |
OLD | NEW |