| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual void Backtrack() = 0; | 51 virtual void Backtrack() = 0; |
| 52 virtual void Bind(Label* label) = 0; | 52 virtual void Bind(Label* label) = 0; |
| 53 // Check the current character against a bitmap. The range of the current | 53 // Check the current character against a bitmap. The range of the current |
| 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(uint32_t c, Label* on_equal) = 0; |
| 62 // Bitwise and the current character with the given constant and then |
| 63 // check for a match with c. |
| 64 virtual void CheckCharacterAfterAnd(uint32_t c, |
| 65 uint32_t and_with, |
| 66 Label* on_equal) = 0; |
| 62 virtual void CheckCharacterGT(uc16 limit, Label* on_greater) = 0; | 67 virtual void CheckCharacterGT(uc16 limit, Label* on_greater) = 0; |
| 63 virtual void CheckCharacterLT(uc16 limit, Label* on_less) = 0; | 68 virtual void CheckCharacterLT(uc16 limit, Label* on_less) = 0; |
| 64 // Check the current character for a match with a literal string. If we | 69 // Check the current character for a match with a literal string. If we |
| 65 // fail to match then goto the on_failure label. If check_eos is set then | 70 // fail to match then goto the on_failure label. If check_eos is set then |
| 66 // the end of input always fails. If check_eos is clear then it is the | 71 // the end of input always fails. If check_eos is clear then it is the |
| 67 // caller's responsibility to ensure that the end of string is not hit. | 72 // caller's responsibility to ensure that the end of string is not hit. |
| 68 // If the label is NULL then we should pop a backtrack address off | 73 // If the label is NULL then we should pop a backtrack address off |
| 69 // the stack and go to that. | 74 // the stack and go to that. |
| 70 virtual void CheckCharacters( | 75 virtual void CheckCharacters( |
| 71 Vector<const uc16> str, | 76 Vector<const uc16> str, |
| 72 int cp_offset, | 77 int cp_offset, |
| 73 Label* on_failure, | 78 Label* on_failure, |
| 74 bool check_eos) = 0; | 79 bool check_eos) = 0; |
| 75 virtual void CheckGreedyLoop(Label* on_tos_equals_current_position) = 0; | 80 virtual void CheckGreedyLoop(Label* on_tos_equals_current_position) = 0; |
| 76 virtual void CheckNotAtStart(Label* on_not_at_start) = 0; | 81 virtual void CheckNotAtStart(Label* on_not_at_start) = 0; |
| 77 virtual void CheckNotBackReference(int start_reg, Label* on_no_match) = 0; | 82 virtual void CheckNotBackReference(int start_reg, Label* on_no_match) = 0; |
| 78 virtual void CheckNotBackReferenceIgnoreCase(int start_reg, | 83 virtual void CheckNotBackReferenceIgnoreCase(int start_reg, |
| 79 Label* on_no_match) = 0; | 84 Label* on_no_match) = 0; |
| 80 // Check the current character for a match with a literal character. If we | 85 // Check the current character for a match with a literal character. If we |
| 81 // fail to match then goto the on_failure label. End of input always | 86 // fail to match then goto the on_failure label. End of input always |
| 82 // matches. If the label is NULL then we should pop a backtrack address off | 87 // matches. If the label is NULL then we should pop a backtrack address off |
| 83 // the stack and go to that. | 88 // the stack and go to that. |
| 84 virtual void CheckNotCharacter(uc16 c, Label* on_not_equal) = 0; | 89 virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal) = 0; |
| 85 // Bitwise or the current character with the given constant and then | 90 virtual void CheckNotCharacterAfterAnd(uint32_t c, |
| 86 // check for a match with c. | 91 uint32_t and_with, |
| 87 virtual void CheckNotCharacterAfterOr(uc16 c, | 92 Label* on_not_equal) = 0; |
| 88 uc16 or_with, | |
| 89 Label* on_not_equal) = 0; | |
| 90 // Subtract a constant from the current character, then or with the given | 93 // Subtract a constant from the current character, then or with the given |
| 91 // constant and then check for a match with c. | 94 // constant and then check for a match with c. |
| 92 virtual void CheckNotCharacterAfterMinusOr(uc16 c, | 95 virtual void CheckNotCharacterAfterMinusAnd(uc16 c, |
| 93 uc16 minus_then_or_with, | 96 uc16 minus, |
| 94 Label* on_not_equal) = 0; | 97 uc16 and_with, |
| 98 Label* on_not_equal) = 0; |
| 95 virtual void CheckNotRegistersEqual(int reg1, | 99 virtual void CheckNotRegistersEqual(int reg1, |
| 96 int reg2, | 100 int reg2, |
| 97 Label* on_not_equal) = 0; | 101 Label* on_not_equal) = 0; |
| 98 // Dispatch after looking the current character up in a byte map. The | 102 // Dispatch after looking the current character up in a byte map. The |
| 99 // destinations vector has up to 256 labels. | 103 // destinations vector has up to 256 labels. |
| 100 virtual void DispatchByteMap( | 104 virtual void DispatchByteMap( |
| 101 uc16 start, | 105 uc16 start, |
| 102 Label* byte_map, | 106 Label* byte_map, |
| 103 const Vector<Label*>& destinations) = 0; | 107 const Vector<Label*>& destinations) = 0; |
| 104 virtual void DispatchHalfNibbleMap( | 108 virtual void DispatchHalfNibbleMap( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 115 virtual void Fail() = 0; | 119 virtual void Fail() = 0; |
| 116 virtual Handle<Object> GetCode(Handle<String> source) = 0; | 120 virtual Handle<Object> GetCode(Handle<String> source) = 0; |
| 117 virtual void GoTo(Label* label) = 0; | 121 virtual void GoTo(Label* label) = 0; |
| 118 // Check whether a register is >= a given constant and go to a label if it | 122 // Check whether a register is >= a given constant and go to a label if it |
| 119 // is. Backtracks instead if the label is NULL. | 123 // is. Backtracks instead if the label is NULL. |
| 120 virtual void IfRegisterGE(int reg, int comparand, Label* if_ge) = 0; | 124 virtual void IfRegisterGE(int reg, int comparand, Label* if_ge) = 0; |
| 121 // Check whether a register is < a given constant and go to a label if it is. | 125 // Check whether a register is < a given constant and go to a label if it is. |
| 122 // Backtracks instead if the label is NULL. | 126 // Backtracks instead if the label is NULL. |
| 123 virtual void IfRegisterLT(int reg, int comparand, Label* if_lt) = 0; | 127 virtual void IfRegisterLT(int reg, int comparand, Label* if_lt) = 0; |
| 124 virtual IrregexpImplementation Implementation() = 0; | 128 virtual IrregexpImplementation Implementation() = 0; |
| 125 virtual void LoadCurrentCharacter(int cp_offset, Label* on_end_of_input) = 0; | 129 virtual void LoadCurrentCharacter(int cp_offset, |
| 126 virtual void LoadCurrentCharacterUnchecked(int cp_offset) = 0; | 130 Label* on_end_of_input, |
| 131 bool check_bounds = true, |
| 132 int characters = 1) = 0; |
| 127 virtual void PopCurrentPosition() = 0; | 133 virtual void PopCurrentPosition() = 0; |
| 128 virtual void PopRegister(int register_index) = 0; | 134 virtual void PopRegister(int register_index) = 0; |
| 129 virtual void PushBacktrack(Label* label) = 0; | 135 virtual void PushBacktrack(Label* label) = 0; |
| 130 virtual void PushCurrentPosition() = 0; | 136 virtual void PushCurrentPosition() = 0; |
| 131 virtual void PushRegister(int register_index) = 0; | 137 virtual void PushRegister(int register_index) = 0; |
| 132 virtual void ReadCurrentPositionFromRegister(int reg) = 0; | 138 virtual void ReadCurrentPositionFromRegister(int reg) = 0; |
| 133 virtual void ReadStackPointerFromRegister(int reg) = 0; | 139 virtual void ReadStackPointerFromRegister(int reg) = 0; |
| 134 virtual void SetRegister(int register_index, int to) = 0; | 140 virtual void SetRegister(int register_index, int to) = 0; |
| 135 virtual void Succeed() = 0; | 141 virtual void Succeed() = 0; |
| 136 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0; | 142 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset) = 0; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 ArraySlice GetBuffer(Vector<T> values); | 182 ArraySlice GetBuffer(Vector<T> values); |
| 177 private: | 183 private: |
| 178 size_t byte_array_size_; | 184 size_t byte_array_size_; |
| 179 Handle<ByteArray> current_byte_array_; | 185 Handle<ByteArray> current_byte_array_; |
| 180 int current_byte_array_free_offset_; | 186 int current_byte_array_free_offset_; |
| 181 }; | 187 }; |
| 182 | 188 |
| 183 } } // namespace v8::internal | 189 } } // namespace v8::internal |
| 184 | 190 |
| 185 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ | 191 #endif // V8_REGEXP_MACRO_ASSEMBLER_H_ |
| OLD | NEW |