OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1214 store->set(JSRegExp::kAtomPatternIndex, *data); | 1214 store->set(JSRegExp::kAtomPatternIndex, *data); |
1215 regexp->set_data(*store); | 1215 regexp->set_data(*store); |
1216 } | 1216 } |
1217 | 1217 |
1218 void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp, | 1218 void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp, |
1219 JSRegExp::Type type, | 1219 JSRegExp::Type type, |
1220 Handle<String> source, | 1220 Handle<String> source, |
1221 JSRegExp::Flags flags, | 1221 JSRegExp::Flags flags, |
1222 int capture_count) { | 1222 int capture_count) { |
1223 Handle<FixedArray> store = NewFixedArray(JSRegExp::kIrregexpDataSize); | 1223 Handle<FixedArray> store = NewFixedArray(JSRegExp::kIrregexpDataSize); |
1224 | 1224 Smi* uninitialized = Smi::FromInt(JSRegExp::kUninitializedValue); |
1225 store->set(JSRegExp::kTagIndex, Smi::FromInt(type)); | 1225 store->set(JSRegExp::kTagIndex, Smi::FromInt(type)); |
1226 store->set(JSRegExp::kSourceIndex, *source); | 1226 store->set(JSRegExp::kSourceIndex, *source); |
1227 store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value())); | 1227 store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value())); |
1228 store->set(JSRegExp::kIrregexpASCIICodeIndex, HEAP->the_hole_value()); | 1228 store->set(JSRegExp::kIrregexpASCIICodeIndex, uninitialized); |
1229 store->set(JSRegExp::kIrregexpUC16CodeIndex, HEAP->the_hole_value()); | 1229 store->set(JSRegExp::kIrregexpUC16CodeIndex, uninitialized); |
| 1230 store->set(JSRegExp::kIrregexpASCIICodeSavedIndex, uninitialized); |
| 1231 store->set(JSRegExp::kIrregexpUC16CodeSavedIndex, uninitialized); |
1230 store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0)); | 1232 store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0)); |
1231 store->set(JSRegExp::kIrregexpCaptureCountIndex, | 1233 store->set(JSRegExp::kIrregexpCaptureCountIndex, |
1232 Smi::FromInt(capture_count)); | 1234 Smi::FromInt(capture_count)); |
1233 regexp->set_data(*store); | 1235 regexp->set_data(*store); |
1234 } | 1236 } |
1235 | 1237 |
1236 | 1238 |
1237 | 1239 |
1238 void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc, | 1240 void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc, |
1239 Handle<JSObject> instance, | 1241 Handle<JSObject> instance, |
1240 bool* pending_exception) { | 1242 bool* pending_exception) { |
1241 // Configure the instance by adding the properties specified by the | 1243 // Configure the instance by adding the properties specified by the |
1242 // instance template. | 1244 // instance template. |
1243 Handle<Object> instance_template = Handle<Object>(desc->instance_template()); | 1245 Handle<Object> instance_template = Handle<Object>(desc->instance_template()); |
1244 if (!instance_template->IsUndefined()) { | 1246 if (!instance_template->IsUndefined()) { |
1245 Execution::ConfigureInstance(instance, | 1247 Execution::ConfigureInstance(instance, |
1246 instance_template, | 1248 instance_template, |
1247 pending_exception); | 1249 pending_exception); |
1248 } else { | 1250 } else { |
1249 *pending_exception = false; | 1251 *pending_exception = false; |
1250 } | 1252 } |
1251 } | 1253 } |
1252 | 1254 |
1253 | 1255 |
1254 } } // namespace v8::internal | 1256 } } // namespace v8::internal |
OLD | NEW |