| 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| 12 // * Neither the name of Google Inc. nor the names of its | 12 // * Neither the name of Google Inc. nor the names of its |
| 13 // contributors may be used to endorse or promote products derived | 13 // contributors may be used to endorse or promote products derived |
| 14 // from this software without specific prior written permission. | 14 // from this software without specific prior written permission. |
| 15 // | 15 // |
| 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #if defined(V8_TARGET_ARCH_IA32) | 30 #if V8_TARGET_ARCH_IA32 |
| 31 | 31 |
| 32 #include "cpu-profiler.h" |
| 32 #include "unicode.h" | 33 #include "unicode.h" |
| 33 #include "log.h" | 34 #include "log.h" |
| 34 #include "regexp-stack.h" | 35 #include "regexp-stack.h" |
| 35 #include "macro-assembler.h" | 36 #include "macro-assembler.h" |
| 36 #include "regexp-macro-assembler.h" | 37 #include "regexp-macro-assembler.h" |
| 37 #include "ia32/regexp-macro-assembler-ia32.h" | 38 #include "ia32/regexp-macro-assembler-ia32.h" |
| 38 | 39 |
| 39 namespace v8 { | 40 namespace v8 { |
| 40 namespace internal { | 41 namespace internal { |
| 41 | 42 |
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 __ cmp(edi, -by * char_size()); | 1023 __ cmp(edi, -by * char_size()); |
| 1023 __ j(greater_equal, &after_position, Label::kNear); | 1024 __ j(greater_equal, &after_position, Label::kNear); |
| 1024 __ mov(edi, -by * char_size()); | 1025 __ mov(edi, -by * char_size()); |
| 1025 // On RegExp code entry (where this operation is used), the character before | 1026 // On RegExp code entry (where this operation is used), the character before |
| 1026 // the current position is expected to be already loaded. | 1027 // the current position is expected to be already loaded. |
| 1027 // We have advanced the position, so it's safe to read backwards. | 1028 // We have advanced the position, so it's safe to read backwards. |
| 1028 LoadCurrentCharacterUnchecked(-1, 1); | 1029 LoadCurrentCharacterUnchecked(-1, 1); |
| 1029 __ bind(&after_position); | 1030 __ bind(&after_position); |
| 1030 } | 1031 } |
| 1031 | 1032 |
| 1033 |
| 1032 void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) { | 1034 void RegExpMacroAssemblerIA32::SetRegister(int register_index, int to) { |
| 1033 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! | 1035 ASSERT(register_index >= num_saved_registers_); // Reserved for positions! |
| 1034 __ mov(register_location(register_index), Immediate(to)); | 1036 __ mov(register_location(register_index), Immediate(to)); |
| 1035 } | 1037 } |
| 1036 | 1038 |
| 1037 | 1039 |
| 1038 bool RegExpMacroAssemblerIA32::Succeed() { | 1040 bool RegExpMacroAssemblerIA32::Succeed() { |
| 1039 __ jmp(&success_label_); | 1041 __ jmp(&success_label_); |
| 1040 return global(); | 1042 return global(); |
| 1041 } | 1043 } |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 } | 1323 } |
| 1322 | 1324 |
| 1323 | 1325 |
| 1324 #undef __ | 1326 #undef __ |
| 1325 | 1327 |
| 1326 #endif // V8_INTERPRETED_REGEXP | 1328 #endif // V8_INTERPRETED_REGEXP |
| 1327 | 1329 |
| 1328 }} // namespace v8::internal | 1330 }} // namespace v8::internal |
| 1329 | 1331 |
| 1330 #endif // V8_TARGET_ARCH_IA32 | 1332 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |