| 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 12 matching lines...) Expand all Loading... |
| 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 #include "execution.h" | 30 #include "execution.h" |
| 31 #include "factory.h" | 31 #include "factory.h" |
| 32 #include "jsregexp.h" | 32 #include "jsregexp.h" |
| 33 #include "third_party/jscre/pcre.h" | |
| 34 #include "platform.h" | 33 #include "platform.h" |
| 35 #include "runtime.h" | 34 #include "runtime.h" |
| 36 #include "top.h" | 35 #include "top.h" |
| 37 #include "compilation-cache.h" | 36 #include "compilation-cache.h" |
| 38 | 37 |
| 38 // Including pcre.h undefines DEBUG to avoid getting debug output from |
| 39 // the JSCRE implementation. Make sure to redefine it in debug mode |
| 40 // after having included the header file. |
| 41 #ifdef DEBUG |
| 42 #include "third_party/jscre/pcre.h" |
| 43 #define DEBUG |
| 44 #else |
| 45 #include "third_party/jscre/pcre.h" |
| 46 #endif |
| 47 |
| 39 namespace v8 { namespace internal { | 48 namespace v8 { namespace internal { |
| 40 | 49 |
| 41 | 50 |
| 42 #define CAPTURE_INDEX 0 | 51 #define CAPTURE_INDEX 0 |
| 43 #define INTERNAL_INDEX 1 | 52 #define INTERNAL_INDEX 1 |
| 44 | 53 |
| 45 static Failure* malloc_failure; | 54 static Failure* malloc_failure; |
| 46 | 55 |
| 47 static void* JSREMalloc(size_t size) { | 56 static void* JSREMalloc(size_t size) { |
| 48 Object* obj = Heap::AllocateByteArray(size); | 57 Object* obj = Heap::AllocateByteArray(size); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 return Smi::cast(value->get(CAPTURE_INDEX))->value(); | 541 return Smi::cast(value->get(CAPTURE_INDEX))->value(); |
| 533 } | 542 } |
| 534 | 543 |
| 535 | 544 |
| 536 ByteArray* RegExpImpl::JsreInternal(Handle<JSRegExp> re) { | 545 ByteArray* RegExpImpl::JsreInternal(Handle<JSRegExp> re) { |
| 537 FixedArray* value = FixedArray::cast(re->DataAt(JSRegExp::kJscreDataIndex)); | 546 FixedArray* value = FixedArray::cast(re->DataAt(JSRegExp::kJscreDataIndex)); |
| 538 return ByteArray::cast(value->get(INTERNAL_INDEX)); | 547 return ByteArray::cast(value->get(INTERNAL_INDEX)); |
| 539 } | 548 } |
| 540 | 549 |
| 541 }} // namespace v8::internal | 550 }} // namespace v8::internal |
| OLD | NEW |