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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 Handle<Object> RegExpImpl::CreateRegExpLiteral(Handle<JSFunction> constructor, | 99 Handle<Object> RegExpImpl::CreateRegExpLiteral(Handle<JSFunction> constructor, |
100 Handle<String> pattern, | 100 Handle<String> pattern, |
101 Handle<String> flags, | 101 Handle<String> flags, |
102 bool* has_pending_exception) { | 102 bool* has_pending_exception) { |
103 // Ensure that the constructor function has been loaded. | 103 // Ensure that the constructor function has been loaded. |
104 if (!constructor->IsLoaded()) { | 104 if (!constructor->IsLoaded()) { |
105 LoadLazy(constructor, has_pending_exception); | 105 LoadLazy(constructor, has_pending_exception); |
106 if (*has_pending_exception) return Handle<Object>(Failure::Exception()); | 106 if (*has_pending_exception) return Handle<Object>(); |
107 } | 107 } |
108 // Call the construct code with 2 arguments. | 108 // Call the construct code with 2 arguments. |
109 Object** argv[2] = { Handle<Object>::cast(pattern).location(), | 109 Object** argv[2] = { Handle<Object>::cast(pattern).location(), |
110 Handle<Object>::cast(flags).location() }; | 110 Handle<Object>::cast(flags).location() }; |
111 return Execution::New(constructor, 2, argv, has_pending_exception); | 111 return Execution::New(constructor, 2, argv, has_pending_exception); |
112 } | 112 } |
113 | 113 |
114 | 114 |
115 // Converts a source string to a 16 bit flat string or a SlicedString containing | 115 // Converts a source string to a 16 bit flat string or a SlicedString containing |
116 // a 16 bit flat string). | 116 // a 16 bit flat string). |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 return Smi::cast(value->get(CAPTURE_INDEX))->value(); | 567 return Smi::cast(value->get(CAPTURE_INDEX))->value(); |
568 } | 568 } |
569 | 569 |
570 | 570 |
571 ByteArray* RegExpImpl::JsreInternal(Handle<JSRegExp> re) { | 571 ByteArray* RegExpImpl::JsreInternal(Handle<JSRegExp> re) { |
572 FixedArray* value = FixedArray::cast(re->DataAt(JSRegExp::kJscreDataIndex)); | 572 FixedArray* value = FixedArray::cast(re->DataAt(JSRegExp::kJscreDataIndex)); |
573 return ByteArray::cast(value->get(INTERNAL_INDEX)); | 573 return ByteArray::cast(value->get(INTERNAL_INDEX)); |
574 } | 574 } |
575 | 575 |
576 }} // namespace v8::internal | 576 }} // namespace v8::internal |
OLD | NEW |