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 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2755 VisitMarker marker(info()); | 2755 VisitMarker marker(info()); |
2756 int choice_count = alternatives_->length(); | 2756 int choice_count = alternatives_->length(); |
2757 | 2757 |
2758 for (int i = 0; i < choice_count; i++) { | 2758 for (int i = 0; i < choice_count; i++) { |
2759 GuardedAlternative alternative = alternatives_->at(i); | 2759 GuardedAlternative alternative = alternatives_->at(i); |
2760 if (alternative.guards() != NULL && alternative.guards()->length() != 0) { | 2760 if (alternative.guards() != NULL && alternative.guards()->length() != 0) { |
2761 set_replacement(this); | 2761 set_replacement(this); |
2762 return this; | 2762 return this; |
2763 } | 2763 } |
2764 } | 2764 } |
2765 | 2765 |
2766 int surviving = 0; | 2766 int surviving = 0; |
2767 RegExpNode* survivor = NULL; | 2767 RegExpNode* survivor = NULL; |
2768 for (int i = 0; i < choice_count; i++) { | 2768 for (int i = 0; i < choice_count; i++) { |
2769 GuardedAlternative alternative = alternatives_->at(i); | 2769 GuardedAlternative alternative = alternatives_->at(i); |
2770 RegExpNode* replacement = alternative.node()->FilterASCII(depth - 1); | 2770 RegExpNode* replacement = alternative.node()->FilterASCII(depth - 1); |
2771 ASSERT(replacement != this); // No missing EMPTY_MATCH_CHECK. | 2771 ASSERT(replacement != this); // No missing EMPTY_MATCH_CHECK. |
2772 if (replacement != NULL) { | 2772 if (replacement != NULL) { |
2773 alternatives_->at(i).set_node(replacement); | 2773 alternatives_->at(i).set_node(replacement); |
2774 surviving++; | 2774 surviving++; |
2775 survivor = replacement; | 2775 survivor = replacement; |
(...skipping 3186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5962 } | 5962 } |
5963 | 5963 |
5964 return compiler.Assemble(¯o_assembler, | 5964 return compiler.Assemble(¯o_assembler, |
5965 node, | 5965 node, |
5966 data->capture_count, | 5966 data->capture_count, |
5967 pattern); | 5967 pattern); |
5968 } | 5968 } |
5969 | 5969 |
5970 | 5970 |
5971 }} // namespace v8::internal | 5971 }} // namespace v8::internal |
OLD | NEW |