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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 *error_message = NULL; | 321 *error_message = NULL; |
322 malloc_failure = Failure::Exception(); | 322 malloc_failure = Failure::Exception(); |
323 *code = jsRegExpCompile(pattern->GetTwoByteData(), | 323 *code = jsRegExpCompile(pattern->GetTwoByteData(), |
324 pattern->length(), | 324 pattern->length(), |
325 case_option, | 325 case_option, |
326 multiline_option, | 326 multiline_option, |
327 number_of_captures, | 327 number_of_captures, |
328 error_message, | 328 error_message, |
329 &JSREMalloc, | 329 &JSREMalloc, |
330 &JSREFree); | 330 &JSREFree); |
331 if (code == NULL && (malloc_failure->IsRetryAfterGC() || | 331 if (*code == NULL && (malloc_failure->IsRetryAfterGC() || |
332 malloc_failure->IsOutOfMemoryFailure())) { | 332 malloc_failure->IsOutOfMemoryFailure())) { |
333 return malloc_failure; | 333 return malloc_failure; |
334 } else { | 334 } else { |
335 // It doesn't matter which object we return here, we just need to return | 335 // It doesn't matter which object we return here, we just need to return |
336 // a non-failure to indicate to the GC-retry code that there was no | 336 // a non-failure to indicate to the GC-retry code that there was no |
337 // allocation failure. | 337 // allocation failure. |
338 return pattern; | 338 return pattern; |
339 } | 339 } |
340 } | 340 } |
341 | 341 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 return Smi::cast(value->get(CAPTURE_INDEX))->value(); | 561 return Smi::cast(value->get(CAPTURE_INDEX))->value(); |
562 } | 562 } |
563 | 563 |
564 | 564 |
565 ByteArray* RegExpImpl::JsreInternal(Handle<JSRegExp> re) { | 565 ByteArray* RegExpImpl::JsreInternal(Handle<JSRegExp> re) { |
566 FixedArray* value = FixedArray::cast(re->DataAt(JSRegExp::kJscreDataIndex)); | 566 FixedArray* value = FixedArray::cast(re->DataAt(JSRegExp::kJscreDataIndex)); |
567 return ByteArray::cast(value->get(INTERNAL_INDEX)); | 567 return ByteArray::cast(value->get(INTERNAL_INDEX)); |
568 } | 568 } |
569 | 569 |
570 }} // namespace v8::internal | 570 }} // namespace v8::internal |
OLD | NEW |