Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: src/factory.cc

Issue 7282026: Introduce code flushing of RegExp code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 store->set(JSRegExp::kAtomPatternIndex, *data); 1209 store->set(JSRegExp::kAtomPatternIndex, *data);
1210 regexp->set_data(*store); 1210 regexp->set_data(*store);
1211 } 1211 }
1212 1212
1213 void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp, 1213 void Factory::SetRegExpIrregexpData(Handle<JSRegExp> regexp,
1214 JSRegExp::Type type, 1214 JSRegExp::Type type,
1215 Handle<String> source, 1215 Handle<String> source,
1216 JSRegExp::Flags flags, 1216 JSRegExp::Flags flags,
1217 int capture_count) { 1217 int capture_count) {
1218 Handle<FixedArray> store = NewFixedArray(JSRegExp::kIrregexpDataSize); 1218 Handle<FixedArray> store = NewFixedArray(JSRegExp::kIrregexpDataSize);
1219 1219 Smi* uninitialized = Smi::FromInt(JSRegExp::kUninitializedValue);
1220 store->set(JSRegExp::kTagIndex, Smi::FromInt(type)); 1220 store->set(JSRegExp::kTagIndex, Smi::FromInt(type));
1221 store->set(JSRegExp::kSourceIndex, *source); 1221 store->set(JSRegExp::kSourceIndex, *source);
1222 store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value())); 1222 store->set(JSRegExp::kFlagsIndex, Smi::FromInt(flags.value()));
1223 store->set(JSRegExp::kIrregexpASCIICodeIndex, HEAP->the_hole_value()); 1223 store->set(JSRegExp::kIrregexpASCIICodeIndex, uninitialized);
1224 store->set(JSRegExp::kIrregexpUC16CodeIndex, HEAP->the_hole_value()); 1224 store->set(JSRegExp::kIrregexpUC16CodeIndex, uninitialized);
1225 store->set(JSRegExp::kIrregexpASCIICodeSavedIndex, uninitialized);
1226 store->set(JSRegExp::kIrregexpUC16CodeSavedIndex, uninitialized);
1225 store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0)); 1227 store->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(0));
1226 store->set(JSRegExp::kIrregexpCaptureCountIndex, 1228 store->set(JSRegExp::kIrregexpCaptureCountIndex,
1227 Smi::FromInt(capture_count)); 1229 Smi::FromInt(capture_count));
1228 regexp->set_data(*store); 1230 regexp->set_data(*store);
1229 } 1231 }
1230 1232
1231 1233
1232 1234
1233 void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc, 1235 void Factory::ConfigureInstance(Handle<FunctionTemplateInfo> desc,
1234 Handle<JSObject> instance, 1236 Handle<JSObject> instance,
1235 bool* pending_exception) { 1237 bool* pending_exception) {
1236 // Configure the instance by adding the properties specified by the 1238 // Configure the instance by adding the properties specified by the
1237 // instance template. 1239 // instance template.
1238 Handle<Object> instance_template = Handle<Object>(desc->instance_template()); 1240 Handle<Object> instance_template = Handle<Object>(desc->instance_template());
1239 if (!instance_template->IsUndefined()) { 1241 if (!instance_template->IsUndefined()) {
1240 Execution::ConfigureInstance(instance, 1242 Execution::ConfigureInstance(instance,
1241 instance_template, 1243 instance_template,
1242 pending_exception); 1244 pending_exception);
1243 } else { 1245 } else {
1244 *pending_exception = false; 1246 *pending_exception = false;
1245 } 1247 }
1246 } 1248 }
1247 1249
1248 1250
1249 } } // namespace v8::internal 1251 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698