| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // character must be from start to start + length_of_bitmap_in_bits. | 54 // character must be from start to start + length_of_bitmap_in_bits. |
| 55 virtual void CheckBitmap( | 55 virtual void CheckBitmap( |
| 56 uc16 start, // The bitmap is indexed from this character. | 56 uc16 start, // The bitmap is indexed from this character. |
| 57 Label* bitmap, // Where the bitmap is emitted. | 57 Label* bitmap, // Where the bitmap is emitted. |
| 58 Label* on_zero) = 0; // Where to go if the bit is 0. Fall through on 1. | 58 Label* on_zero) = 0; // Where to go if the bit is 0. Fall through on 1. |
| 59 // Dispatch after looking the current character up in a 2-bits-per-entry | 59 // Dispatch after looking the current character up in a 2-bits-per-entry |
| 60 // map. The destinations vector has up to 4 labels. | 60 // map. The destinations vector has up to 4 labels. |
| 61 virtual void CheckCharacter(uc16 c, Label* on_equal) = 0; | 61 virtual void CheckCharacter(uc16 c, Label* on_equal) = 0; |
| 62 virtual void CheckCharacterGT(uc16 limit, Label* on_greater) = 0; | 62 virtual void CheckCharacterGT(uc16 limit, Label* on_greater) = 0; |
| 63 virtual void CheckCharacterLT(uc16 limit, Label* on_less) = 0; | 63 virtual void CheckCharacterLT(uc16 limit, Label* on_less) = 0; |
| 64 // Check the current character for a match with a literal string. If we |
| 65 // fail to match then goto the on_failure label. End of input always |
| 66 // matches. If the label is NULL then we should pop a backtrack address off |
| 67 // the stack abnd go to that. |
| 64 virtual void CheckCharacters( | 68 virtual void CheckCharacters( |
| 65 Vector<const uc16> str, | 69 Vector<const uc16> str, |
| 66 int cp_offset, | 70 int cp_offset, |
| 67 Label* on_failure) = 0; | 71 Label* on_failure) = 0; |
| 68 // Check the current input position against a register. If the register is | 72 // Check the current input position against a register. If the register is |
| 69 // equal to the current position then go to the label. If the label is NULL | 73 // equal to the current position then go to the label. If the label is NULL |
| 70 // then backtrack instead. | 74 // then backtrack instead. |
| 71 virtual void CheckCurrentPosition( | 75 virtual void CheckCurrentPosition( |
| 72 int register_index, | 76 int register_index, |
| 73 Label* on_equal) = 0; | 77 Label* on_equal) = 0; |
| 74 virtual void CheckNotBackReference(int start_reg, Label* on_no_match) = 0; | 78 virtual void CheckNotBackReference(int start_reg, Label* on_no_match) = 0; |
| 75 // Check the current character for a match with a literal string. If we | 79 // Check the current character for a match with a literal character. If we |
| 76 // fail to match then goto the on_failure label. End of input always | 80 // fail to match then goto the on_failure label. End of input always |
| 77 // matches. If the label is NULL then we should pop a backtrack address off | 81 // matches. If the label is NULL then we should pop a backtrack address off |
| 78 // the stack and go to that. | 82 // the stack and go to that. |
| 79 virtual void CheckNotCharacter(uc16 c, Label* on_not_equal) = 0; | 83 virtual void CheckNotCharacter(uc16 c, Label* on_not_equal) = 0; |
| 84 // Bitwise or the current character with the given constant and then |
| 85 // check for a match with c. |
| 86 virtual void CheckNotCharacterAfterOr(uc16 c, |
| 87 uc16 or_with, |
| 88 Label* on_not_equal) = 0; |
| 89 // Subtract a constant from the current character, then or with the given |
| 90 // constant and then check for a match with c. |
| 91 virtual void CheckNotCharacterAfterMinusOr(uc16 c, |
| 92 uc16 minus_then_or_with, |
| 93 Label* on_not_equal) = 0; |
| 80 // Dispatch after looking the current character up in a byte map. The | 94 // Dispatch after looking the current character up in a byte map. The |
| 81 // destinations vector has up to 256 labels. | 95 // destinations vector has up to 256 labels. |
| 82 virtual void DispatchByteMap( | 96 virtual void DispatchByteMap( |
| 83 uc16 start, | 97 uc16 start, |
| 84 Label* byte_map, | 98 Label* byte_map, |
| 85 const Vector<Label*>& destinations) = 0; | 99 const Vector<Label*>& destinations) = 0; |
| 86 virtual void DispatchHalfNibbleMap( | 100 virtual void DispatchHalfNibbleMap( |
| 87 uc16 start, | 101 uc16 start, |
| 88 Label* half_nibble_map, | 102 Label* half_nibble_map, |
| 89 const Vector<Label*>& destinations) = 0; | 103 const Vector<Label*>& destinations) = 0; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 ArraySlice GetBuffer(Vector<T> values); | 172 ArraySlice GetBuffer(Vector<T> values); |
| 159 private: | 173 private: |
| 160 size_t byte_array_size_; | 174 size_t byte_array_size_; |
| 161 Handle<ByteArray> current_byte_array_; | 175 Handle<ByteArray> current_byte_array_; |
| 162 int current_byte_array_free_offset_; | 176 int current_byte_array_free_offset_; |
| 163 }; | 177 }; |
| 164 | 178 |
| 165 } } // namespace v8::internal | 179 } } // namespace v8::internal |
| 166 | 180 |
| 167 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ | 181 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ |
| OLD | NEW |