OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #error Unsupported target architecture. | 59 #error Unsupported target architecture. |
60 #endif | 60 #endif |
61 #endif | 61 #endif |
62 | 62 |
63 #include "interpreter-irregexp.h" | 63 #include "interpreter-irregexp.h" |
64 | 64 |
65 | 65 |
66 namespace v8 { | 66 namespace v8 { |
67 namespace internal { | 67 namespace internal { |
68 | 68 |
69 Handle<Object> RegExpImpl::CreateRegExpLiteral(Handle<JSFunction> constructor, | 69 MaybeHandle<Object> RegExpImpl::CreateRegExpLiteral( |
70 Handle<String> pattern, | 70 Handle<JSFunction> constructor, |
71 Handle<String> flags, | 71 Handle<String> pattern, |
72 bool* has_pending_exception) { | 72 Handle<String> flags) { |
73 // Call the construct code with 2 arguments. | 73 // Call the construct code with 2 arguments. |
74 Handle<Object> argv[] = { pattern, flags }; | 74 Handle<Object> argv[] = { pattern, flags }; |
75 return Execution::New(constructor, ARRAY_SIZE(argv), argv, | 75 return Execution::New(constructor, ARRAY_SIZE(argv), argv); |
76 has_pending_exception); | |
77 } | 76 } |
78 | 77 |
79 | 78 |
80 static JSRegExp::Flags RegExpFlagsFromString(Handle<String> str) { | 79 static JSRegExp::Flags RegExpFlagsFromString(Handle<String> str) { |
81 int flags = JSRegExp::NONE; | 80 int flags = JSRegExp::NONE; |
82 for (int i = 0; i < str->length(); i++) { | 81 for (int i = 0; i < str->length(); i++) { |
83 switch (str->Get(i)) { | 82 switch (str->Get(i)) { |
84 case 'i': | 83 case 'i': |
85 flags |= JSRegExp::IGNORE_CASE; | 84 flags |= JSRegExp::IGNORE_CASE; |
86 break; | 85 break; |
(...skipping 6040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6127 } | 6126 } |
6128 | 6127 |
6129 return compiler.Assemble(¯o_assembler, | 6128 return compiler.Assemble(¯o_assembler, |
6130 node, | 6129 node, |
6131 data->capture_count, | 6130 data->capture_count, |
6132 pattern); | 6131 pattern); |
6133 } | 6132 } |
6134 | 6133 |
6135 | 6134 |
6136 }} // namespace v8::internal | 6135 }} // namespace v8::internal |
OLD | NEW |