OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 | 111 |
112 Handle<Object> RegExpImpl::Compile(Handle<JSRegExp> re, | 112 Handle<Object> RegExpImpl::Compile(Handle<JSRegExp> re, |
113 Handle<String> pattern, | 113 Handle<String> pattern, |
114 Handle<String> flag_str) { | 114 Handle<String> flag_str) { |
115 Isolate* isolate = re->GetIsolate(); | 115 Isolate* isolate = re->GetIsolate(); |
116 JSRegExp::Flags flags = RegExpFlagsFromString(flag_str); | 116 JSRegExp::Flags flags = RegExpFlagsFromString(flag_str); |
117 CompilationCache* compilation_cache = isolate->compilation_cache(); | 117 CompilationCache* compilation_cache = isolate->compilation_cache(); |
118 Handle<FixedArray> cached = compilation_cache->LookupRegExp(pattern, flags); | 118 Handle<FixedArray> cached = compilation_cache->LookupRegExp(pattern, flags); |
119 bool in_cache = !cached.is_null(); | 119 bool in_cache = !cached.is_null(); |
120 LOG(RegExpCompileEvent(re, in_cache)); | 120 LOG(isolate, RegExpCompileEvent(re, in_cache)); |
121 | 121 |
122 Handle<Object> result; | 122 Handle<Object> result; |
123 if (in_cache) { | 123 if (in_cache) { |
124 re->set_data(*cached); | 124 re->set_data(*cached); |
125 return re; | 125 return re; |
126 } | 126 } |
127 pattern = FlattenGetString(pattern); | 127 pattern = FlattenGetString(pattern); |
128 CompilationZoneScope zone_scope(DELETE_ON_EXIT); | 128 CompilationZoneScope zone_scope(DELETE_ON_EXIT); |
129 PostponeInterruptsScope postpone(isolate); | 129 PostponeInterruptsScope postpone(isolate); |
130 RegExpCompileData parse_result; | 130 RegExpCompileData parse_result; |
(...skipping 5226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5357 } | 5357 } |
5358 | 5358 |
5359 return compiler.Assemble(¯o_assembler, | 5359 return compiler.Assemble(¯o_assembler, |
5360 node, | 5360 node, |
5361 data->capture_count, | 5361 data->capture_count, |
5362 pattern); | 5362 pattern); |
5363 } | 5363 } |
5364 | 5364 |
5365 | 5365 |
5366 }} // namespace v8::internal | 5366 }} // namespace v8::internal |
OLD | NEW |