| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 int start_offset = cp_offset * char_size(); | 176 int start_offset = cp_offset * char_size(); |
| 177 __ mov(ebx, edi); | 177 __ mov(ebx, edi); |
| 178 __ add(Operand(ebx), Immediate(start_offset + byte_length)); | 178 __ add(Operand(ebx), Immediate(start_offset + byte_length)); |
| 179 BranchOrBacktrack(greater_equal, on_failure); | 179 BranchOrBacktrack(greater_equal, on_failure); |
| 180 | 180 |
| 181 ArraySlice constant_buffer = constants_.GetBuffer(str.length(), char_size()); | 181 ArraySlice constant_buffer = constants_.GetBuffer(str.length(), char_size()); |
| 182 for (int i = 0; i < str.length(); i++) { | 182 for (int i = 0; i < str.length(); i++) { |
| 183 if (mode_ == ASCII) { | 183 if (mode_ == ASCII) { |
| 184 constant_buffer.at<char>(i) = static_cast<char>(str[i]); | 184 constant_buffer.at<char>(i) = static_cast<char>(str[i]); |
| 185 } else { | 185 } else { |
| 186 memcpy(constant_buffer.location<void>(), | 186 memcpy(constant_buffer.location(), |
| 187 str.start(), | 187 str.start(), |
| 188 str.length() * sizeof(uc16)); | 188 str.length() * sizeof(uc16)); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 | 191 |
| 192 __ mov(eax, edi); | 192 __ mov(eax, edi); |
| 193 __ mov(ebx, esi); | 193 __ mov(ebx, esi); |
| 194 __ lea(edi, Operand(esi, edi, times_1, start_offset)); | 194 __ lea(edi, Operand(esi, edi, times_1, start_offset)); |
| 195 LoadConstantBufferAddress(esi, &constant_buffer); | 195 LoadConstantBufferAddress(esi, &constant_buffer); |
| 196 __ mov(ecx, str.length()); | 196 __ mov(ecx, str.length()); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 | 599 |
| 600 | 600 |
| 601 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg, | 601 void RegExpMacroAssemblerIA32::LoadConstantBufferAddress(Register reg, |
| 602 ArraySlice* buffer) { | 602 ArraySlice* buffer) { |
| 603 __ mov(reg, buffer->array()); | 603 __ mov(reg, buffer->array()); |
| 604 __ add(Operand(reg), Immediate(buffer->base_offset())); | 604 __ add(Operand(reg), Immediate(buffer->base_offset())); |
| 605 } | 605 } |
| 606 | 606 |
| 607 #undef __ | 607 #undef __ |
| 608 }} | 608 }} |
| OLD | NEW |