| OLD | NEW |
| 1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-2009 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 return array; | 472 return array; |
| 473 } | 473 } |
| 474 | 474 |
| 475 | 475 |
| 476 int RegExpMacroAssemblerIrregexp::length() { | 476 int RegExpMacroAssemblerIrregexp::length() { |
| 477 return pc_; | 477 return pc_; |
| 478 } | 478 } |
| 479 | 479 |
| 480 | 480 |
| 481 void RegExpMacroAssemblerIrregexp::Copy(Address a) { | 481 void RegExpMacroAssemblerIrregexp::Copy(Address a) { |
| 482 memcpy(a, buffer_.start(), length()); | 482 OS::MemCopy(a, buffer_.start(), length()); |
| 483 } | 483 } |
| 484 | 484 |
| 485 | 485 |
| 486 void RegExpMacroAssemblerIrregexp::Expand() { | 486 void RegExpMacroAssemblerIrregexp::Expand() { |
| 487 bool old_buffer_was_our_own = own_buffer_; | 487 bool old_buffer_was_our_own = own_buffer_; |
| 488 Vector<byte> old_buffer = buffer_; | 488 Vector<byte> old_buffer = buffer_; |
| 489 buffer_ = Vector<byte>::New(old_buffer.length() * 2); | 489 buffer_ = Vector<byte>::New(old_buffer.length() * 2); |
| 490 own_buffer_ = true; | 490 own_buffer_ = true; |
| 491 memcpy(buffer_.start(), old_buffer.start(), old_buffer.length()); | 491 OS::MemCopy(buffer_.start(), old_buffer.start(), old_buffer.length()); |
| 492 if (old_buffer_was_our_own) { | 492 if (old_buffer_was_our_own) { |
| 493 old_buffer.Dispose(); | 493 old_buffer.Dispose(); |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 | 496 |
| 497 #endif // V8_INTERPRETED_REGEXP | 497 #endif // V8_INTERPRETED_REGEXP |
| 498 | 498 |
| 499 } } // namespace v8::internal | 499 } } // namespace v8::internal |
| OLD | NEW |