| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
| 8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
| 9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
| 10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 switch (TypeTag()) { | 745 switch (TypeTag()) { |
| 746 case JSRegExp::ATOM: { | 746 case JSRegExp::ATOM: { |
| 747 FixedArray* arr = FixedArray::cast(data()); | 747 FixedArray* arr = FixedArray::cast(data()); |
| 748 CHECK(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); | 748 CHECK(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); |
| 749 break; | 749 break; |
| 750 } | 750 } |
| 751 case JSRegExp::IRREGEXP: { | 751 case JSRegExp::IRREGEXP: { |
| 752 bool is_native = RegExpImpl::UsesNativeRegExp(); | 752 bool is_native = RegExpImpl::UsesNativeRegExp(); |
| 753 | 753 |
| 754 FixedArray* arr = FixedArray::cast(data()); | 754 FixedArray* arr = FixedArray::cast(data()); |
| 755 Object* ascii_data = arr->get(JSRegExp::kIrregexpASCIICodeIndex); | 755 Object* one_byte_data = arr->get(JSRegExp::kIrregexpLatin1CodeIndex); |
| 756 // Smi : Not compiled yet (-1) or code prepared for flushing. | 756 // Smi : Not compiled yet (-1) or code prepared for flushing. |
| 757 // JSObject: Compilation error. | 757 // JSObject: Compilation error. |
| 758 // Code/ByteArray: Compiled code. | 758 // Code/ByteArray: Compiled code. |
| 759 CHECK(ascii_data->IsSmi() || | 759 CHECK( |
| 760 (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray())); | 760 one_byte_data->IsSmi() || |
| 761 (is_native ? one_byte_data->IsCode() : one_byte_data->IsByteArray())); |
| 761 Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex); | 762 Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex); |
| 762 CHECK(uc16_data->IsSmi() || | 763 CHECK(uc16_data->IsSmi() || |
| 763 (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray())); | 764 (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray())); |
| 764 | 765 |
| 765 Object* ascii_saved = arr->get(JSRegExp::kIrregexpASCIICodeSavedIndex); | 766 Object* one_byte_saved = |
| 766 CHECK(ascii_saved->IsSmi() || ascii_saved->IsString() || | 767 arr->get(JSRegExp::kIrregexpLatin1CodeSavedIndex); |
| 767 ascii_saved->IsCode()); | 768 CHECK(one_byte_saved->IsSmi() || one_byte_saved->IsString() || |
| 769 one_byte_saved->IsCode()); |
| 768 Object* uc16_saved = arr->get(JSRegExp::kIrregexpUC16CodeSavedIndex); | 770 Object* uc16_saved = arr->get(JSRegExp::kIrregexpUC16CodeSavedIndex); |
| 769 CHECK(uc16_saved->IsSmi() || uc16_saved->IsString() || | 771 CHECK(uc16_saved->IsSmi() || uc16_saved->IsString() || |
| 770 uc16_saved->IsCode()); | 772 uc16_saved->IsCode()); |
| 771 | 773 |
| 772 CHECK(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi()); | 774 CHECK(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi()); |
| 773 CHECK(arr->get(JSRegExp::kIrregexpMaxRegisterCountIndex)->IsSmi()); | 775 CHECK(arr->get(JSRegExp::kIrregexpMaxRegisterCountIndex)->IsSmi()); |
| 774 break; | 776 break; |
| 775 } | 777 } |
| 776 default: | 778 default: |
| 777 CHECK_EQ(JSRegExp::NOT_COMPILED, TypeTag()); | 779 CHECK_EQ(JSRegExp::NOT_COMPILED, TypeTag()); |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1194 for (int i = 0; i < number_of_transitions(); ++i) { | 1196 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1195 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1197 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1196 } | 1198 } |
| 1197 return true; | 1199 return true; |
| 1198 } | 1200 } |
| 1199 | 1201 |
| 1200 | 1202 |
| 1201 #endif // DEBUG | 1203 #endif // DEBUG |
| 1202 | 1204 |
| 1203 } } // namespace v8::internal | 1205 } } // namespace v8::internal |
| OLD | NEW |