| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 switch (tag) { | 506 switch (tag) { |
| 507 case RegExpMacroAssembler::kIA32Implementation: { | 507 case RegExpMacroAssembler::kIA32Implementation: { |
| 508 Code* code = Code::cast(irregexp->get(kIrregexpCodeIndex)); | 508 Code* code = Code::cast(irregexp->get(kIrregexpCodeIndex)); |
| 509 Address start_addr = | 509 Address start_addr = |
| 510 Handle<SeqTwoByteString>::cast(two_byte_subject)->GetCharsAddress(); | 510 Handle<SeqTwoByteString>::cast(two_byte_subject)->GetCharsAddress(); |
| 511 int string_offset = | 511 int string_offset = |
| 512 start_addr - reinterpret_cast<Address>(*two_byte_subject); | 512 start_addr - reinterpret_cast<Address>(*two_byte_subject); |
| 513 int start_offset = string_offset + previous_index * sizeof(uc16); | 513 int start_offset = string_offset + previous_index * sizeof(uc16); |
| 514 int end_offset = | 514 int end_offset = |
| 515 string_offset + two_byte_subject->length() * sizeof(uc16); | 515 string_offset + two_byte_subject->length() * sizeof(uc16); |
| 516 typedef bool testfunc(String**, int, int, int*); | 516 rc = RegExpMacroAssemblerIA32::Execute(code, |
| 517 testfunc* test = FUNCTION_CAST<testfunc*>(code->entry()); | 517 two_byte_subject.location(), |
| 518 rc = test(two_byte_subject.location(), | 518 start_offset, |
| 519 start_offset, | 519 end_offset, |
| 520 end_offset, | 520 offsets_vector, |
| 521 offsets_vector); | 521 previous_index == 0); |
| 522 if (rc) { | 522 if (rc) { |
| 523 // Capture values are relative to start_offset only. | 523 // Capture values are relative to start_offset only. |
| 524 for (int i = 0; i < offsets_vector_length; i++) { | 524 for (int i = 0; i < offsets_vector_length; i++) { |
| 525 if (offsets_vector[i] >= 0) { | 525 if (offsets_vector[i] >= 0) { |
| 526 offsets_vector[i] += previous_index; | 526 offsets_vector[i] += previous_index; |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 break; | 530 break; |
| 531 } | 531 } |
| (...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2731 } | 2731 } |
| 2732 EmbeddedVector<byte, 1024> codes; | 2732 EmbeddedVector<byte, 1024> codes; |
| 2733 RegExpMacroAssemblerIrregexp macro_assembler(codes); | 2733 RegExpMacroAssemblerIrregexp macro_assembler(codes); |
| 2734 return compiler.Assemble(¯o_assembler, | 2734 return compiler.Assemble(¯o_assembler, |
| 2735 node, | 2735 node, |
| 2736 input->capture_count); | 2736 input->capture_count); |
| 2737 } | 2737 } |
| 2738 | 2738 |
| 2739 | 2739 |
| 2740 }} // namespace v8::internal | 2740 }} // namespace v8::internal |
| OLD | NEW |