OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 void JSRegExp::JSRegExpVerify() { | 689 void JSRegExp::JSRegExpVerify() { |
690 JSObjectVerify(); | 690 JSObjectVerify(); |
691 ASSERT(data()->IsUndefined() || data()->IsFixedArray()); | 691 ASSERT(data()->IsUndefined() || data()->IsFixedArray()); |
692 switch (TypeTag()) { | 692 switch (TypeTag()) { |
693 case JSRegExp::ATOM: { | 693 case JSRegExp::ATOM: { |
694 FixedArray* arr = FixedArray::cast(data()); | 694 FixedArray* arr = FixedArray::cast(data()); |
695 ASSERT(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); | 695 ASSERT(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); |
696 break; | 696 break; |
697 } | 697 } |
698 case JSRegExp::IRREGEXP: { | 698 case JSRegExp::IRREGEXP: { |
699 bool is_native = FLAG_regexp_native; | |
700 #ifdef ARM | |
701 // No native regexp on arm yet. | |
702 is_native = false; | |
703 #endif | |
704 FixedArray* arr = FixedArray::cast(data()); | 699 FixedArray* arr = FixedArray::cast(data()); |
705 Object* ascii_data = arr->get(JSRegExp::kIrregexpASCIICodeIndex); | 700 Object* irregexp_data = arr->get(JSRegExp::kIrregexpDataIndex); |
706 ASSERT(ascii_data->IsTheHole() | 701 ASSERT(irregexp_data->IsFixedArray()); |
707 || (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray())); | |
708 Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex); | |
709 ASSERT(uc16_data->IsTheHole() | |
710 || (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray())); | |
711 ASSERT(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi()); | |
712 ASSERT(arr->get(JSRegExp::kIrregexpMaxRegisterCountIndex)->IsSmi()); | |
713 break; | 702 break; |
714 } | 703 } |
715 default: | 704 default: |
716 ASSERT_EQ(JSRegExp::NOT_COMPILED, TypeTag()); | 705 ASSERT_EQ(JSRegExp::NOT_COMPILED, TypeTag()); |
717 ASSERT(data()->IsUndefined()); | 706 ASSERT(data()->IsUndefined()); |
718 break; | 707 break; |
719 } | 708 } |
720 } | 709 } |
721 | 710 |
722 | 711 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 } | 1077 } |
1089 current = hash; | 1078 current = hash; |
1090 } | 1079 } |
1091 return true; | 1080 return true; |
1092 } | 1081 } |
1093 | 1082 |
1094 | 1083 |
1095 #endif // DEBUG | 1084 #endif // DEBUG |
1096 | 1085 |
1097 } } // namespace v8::internal | 1086 } } // namespace v8::internal |
OLD | NEW |