| 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 25 matching lines...) Expand all Loading... |
| 36 enum Mode { ASCII = 1, UC16 = 2 }; | 36 enum Mode { ASCII = 1, UC16 = 2 }; |
| 37 enum Result { EXCEPTION = -1, FAILURE = 0, SUCCESS = 1 }; | 37 enum Result { EXCEPTION = -1, FAILURE = 0, SUCCESS = 1 }; |
| 38 | 38 |
| 39 RegExpMacroAssemblerIA32(Mode mode, int registers_to_save); | 39 RegExpMacroAssemblerIA32(Mode mode, int registers_to_save); |
| 40 virtual ~RegExpMacroAssemblerIA32(); | 40 virtual ~RegExpMacroAssemblerIA32(); |
| 41 virtual void AdvanceCurrentPosition(int by); | 41 virtual void AdvanceCurrentPosition(int by); |
| 42 virtual void AdvanceRegister(int reg, int by); | 42 virtual void AdvanceRegister(int reg, int by); |
| 43 virtual void Backtrack(); | 43 virtual void Backtrack(); |
| 44 virtual void Bind(Label* label); | 44 virtual void Bind(Label* label); |
| 45 virtual void CheckBitmap(uc16 start, Label* bitmap, Label* on_zero); | 45 virtual void CheckBitmap(uc16 start, Label* bitmap, Label* on_zero); |
| 46 virtual void CheckCharacter(uc16 c, Label* on_equal); | 46 virtual void CheckCharacter(uint32_t c, Label* on_equal); |
| 47 virtual void CheckCharacterAfterAnd(uint32_t c, |
| 48 uint32_t mask, |
| 49 Label* on_equal); |
| 47 virtual void CheckCharacterGT(uc16 limit, Label* on_greater); | 50 virtual void CheckCharacterGT(uc16 limit, Label* on_greater); |
| 48 virtual void CheckCharacterLT(uc16 limit, Label* on_less); | 51 virtual void CheckCharacterLT(uc16 limit, Label* on_less); |
| 49 virtual void CheckCharacters(Vector<const uc16> str, | 52 virtual void CheckCharacters(Vector<const uc16> str, |
| 50 int cp_offset, | 53 int cp_offset, |
| 51 Label* on_failure, | 54 Label* on_failure, |
| 52 bool check_end_of_string); | 55 bool check_end_of_string); |
| 53 virtual void CheckGreedyLoop(Label* on_tos_equals_current_position); | 56 virtual void CheckGreedyLoop(Label* on_tos_equals_current_position); |
| 54 virtual void CheckNotAtStart(Label* on_not_at_start); | 57 virtual void CheckNotAtStart(Label* on_not_at_start); |
| 55 virtual void CheckNotBackReference(int start_reg, Label* on_no_match); | 58 virtual void CheckNotBackReference(int start_reg, Label* on_no_match); |
| 56 virtual void CheckNotBackReferenceIgnoreCase(int start_reg, | 59 virtual void CheckNotBackReferenceIgnoreCase(int start_reg, |
| 57 Label* on_no_match); | 60 Label* on_no_match); |
| 58 virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal); | 61 virtual void CheckNotRegistersEqual(int reg1, int reg2, Label* on_not_equal); |
| 59 virtual void CheckNotCharacter(uc16 c, Label* on_not_equal); | 62 virtual void CheckNotCharacter(uint32_t c, Label* on_not_equal); |
| 60 virtual void CheckNotCharacterAfterOr(uc16 c, uc16 mask, Label* on_not_equal); | 63 virtual void CheckNotCharacterAfterAnd(uint32_t c, |
| 61 virtual void CheckNotCharacterAfterMinusOr(uc16 c, | 64 uint32_t mask, |
| 62 uc16 mask, | 65 Label* on_not_equal); |
| 63 Label* on_not_equal); | 66 virtual void CheckNotCharacterAfterMinusAnd(uc16 c, |
| 67 uc16 minus, |
| 68 uc16 mask, |
| 69 Label* on_not_equal); |
| 64 virtual void DispatchByteMap(uc16 start, | 70 virtual void DispatchByteMap(uc16 start, |
| 65 Label* byte_map, | 71 Label* byte_map, |
| 66 const Vector<Label*>& destinations); | 72 const Vector<Label*>& destinations); |
| 67 virtual void DispatchHalfNibbleMap(uc16 start, | 73 virtual void DispatchHalfNibbleMap(uc16 start, |
| 68 Label* half_nibble_map, | 74 Label* half_nibble_map, |
| 69 const Vector<Label*>& destinations); | 75 const Vector<Label*>& destinations); |
| 70 virtual void DispatchHighByteMap(byte start, | 76 virtual void DispatchHighByteMap(byte start, |
| 71 Label* byte_map, | 77 Label* byte_map, |
| 72 const Vector<Label*>& destinations); | 78 const Vector<Label*>& destinations); |
| 73 virtual void EmitOrLink(Label* label); | 79 virtual void EmitOrLink(Label* label); |
| 74 virtual void Fail(); | 80 virtual void Fail(); |
| 75 virtual Handle<Object> GetCode(Handle<String> source); | 81 virtual Handle<Object> GetCode(Handle<String> source); |
| 76 virtual void GoTo(Label* label); | 82 virtual void GoTo(Label* label); |
| 77 virtual void IfRegisterGE(int reg, int comparand, Label* if_ge); | 83 virtual void IfRegisterGE(int reg, int comparand, Label* if_ge); |
| 78 virtual void IfRegisterLT(int reg, int comparand, Label* if_lt); | 84 virtual void IfRegisterLT(int reg, int comparand, Label* if_lt); |
| 79 virtual IrregexpImplementation Implementation(); | 85 virtual IrregexpImplementation Implementation(); |
| 80 virtual void LoadCurrentCharacter(int cp_offset, Label* on_end_of_input); | 86 virtual void LoadCurrentCharacter(int cp_offset, |
| 81 virtual void LoadCurrentCharacterUnchecked(int cp_offset); | 87 Label* on_end_of_input, |
| 82 | 88 bool check_bounds = true, |
| 89 int characters = 1); |
| 83 virtual void PopCurrentPosition(); | 90 virtual void PopCurrentPosition(); |
| 84 virtual void PopRegister(int register_index); | 91 virtual void PopRegister(int register_index); |
| 85 virtual void PushBacktrack(Label* label); | 92 virtual void PushBacktrack(Label* label); |
| 86 virtual void PushCurrentPosition(); | 93 virtual void PushCurrentPosition(); |
| 87 virtual void PushRegister(int register_index); | 94 virtual void PushRegister(int register_index); |
| 88 virtual void ReadCurrentPositionFromRegister(int reg); | 95 virtual void ReadCurrentPositionFromRegister(int reg); |
| 89 virtual void ReadStackPointerFromRegister(int reg); | 96 virtual void ReadStackPointerFromRegister(int reg); |
| 90 virtual void SetRegister(int register_index, int to); | 97 virtual void SetRegister(int register_index, int to); |
| 91 virtual void Succeed(); | 98 virtual void Succeed(); |
| 92 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); | 99 virtual void WriteCurrentPositionToRegister(int reg, int cp_offset); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 static const int kRegExpConstantsSize = 256; | 135 static const int kRegExpConstantsSize = 256; |
| 129 // Only unroll loops up to this length. TODO(lrn): Actually use this. | 136 // Only unroll loops up to this length. TODO(lrn): Actually use this. |
| 130 static const int kMaxInlineStringTests = 32; | 137 static const int kMaxInlineStringTests = 32; |
| 131 | 138 |
| 132 // Compares two-byte strings case insensitively. | 139 // Compares two-byte strings case insensitively. |
| 133 static int CaseInsensitiveCompareUC16(uc16** buffer, | 140 static int CaseInsensitiveCompareUC16(uc16** buffer, |
| 134 int byte_offset1, | 141 int byte_offset1, |
| 135 int byte_offset2, | 142 int byte_offset2, |
| 136 size_t byte_length); | 143 size_t byte_length); |
| 137 | 144 |
| 145 void LoadCurrentCharacterUnchecked(int cp_offset, int characters); |
| 146 |
| 138 // Called from RegExp if the stack-guard is triggered. | 147 // Called from RegExp if the stack-guard is triggered. |
| 139 // If the code object is relocated, the return address is fixed before | 148 // If the code object is relocated, the return address is fixed before |
| 140 // returning. | 149 // returning. |
| 141 static int CheckStackGuardState(Address return_address, Code* re_code); | 150 static int CheckStackGuardState(Address return_address, Code* re_code); |
| 142 | 151 |
| 143 // The ebp-relative location of a regexp register. | 152 // The ebp-relative location of a regexp register. |
| 144 Operand register_location(int register_index); | 153 Operand register_location(int register_index); |
| 145 | 154 |
| 146 // The register containing the current character after LoadCurrentCharacter. | 155 // The register containing the current character after LoadCurrentCharacter. |
| 147 Register current_character(); | 156 Register current_character(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 Label success_label_; | 203 Label success_label_; |
| 195 Label exit_label_; | 204 Label exit_label_; |
| 196 Label check_preempt_label_; | 205 Label check_preempt_label_; |
| 197 // Handle used to represent the generated code object itself. | 206 // Handle used to represent the generated code object itself. |
| 198 Handle<Object> self_; | 207 Handle<Object> self_; |
| 199 }; | 208 }; |
| 200 | 209 |
| 201 }} // namespace v8::internal | 210 }} // namespace v8::internal |
| 202 | 211 |
| 203 #endif /* REGEXP_MACRO_ASSEMBLER_IA32_H_ */ | 212 #endif /* REGEXP_MACRO_ASSEMBLER_IA32_H_ */ |
| OLD | NEW |