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 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 Counters::regexp_entry_runtime.Increment(); | 1223 Counters::regexp_entry_runtime.Increment(); |
1224 Handle<Object> result = RegExpImpl::Exec(regexp, | 1224 Handle<Object> result = RegExpImpl::Exec(regexp, |
1225 subject, | 1225 subject, |
1226 index, | 1226 index, |
1227 last_match_info); | 1227 last_match_info); |
1228 if (result.is_null()) return Failure::Exception(); | 1228 if (result.is_null()) return Failure::Exception(); |
1229 return *result; | 1229 return *result; |
1230 } | 1230 } |
1231 | 1231 |
1232 | 1232 |
| 1233 static Object* Runtime_FinishArrayPrototypeSetup(Arguments args) { |
| 1234 HandleScope scope; |
| 1235 ASSERT(args.length() == 1); |
| 1236 CONVERT_ARG_CHECKED(JSArray, prototype, 0); |
| 1237 // This is necessary to enable fast checks for absence of elements |
| 1238 // on Array.prototype and below. |
| 1239 prototype->set_elements(Heap::empty_fixed_array()); |
| 1240 return Smi::FromInt(0); |
| 1241 } |
| 1242 |
| 1243 |
1233 static Object* Runtime_MaterializeRegExpLiteral(Arguments args) { | 1244 static Object* Runtime_MaterializeRegExpLiteral(Arguments args) { |
1234 HandleScope scope; | 1245 HandleScope scope; |
1235 ASSERT(args.length() == 4); | 1246 ASSERT(args.length() == 4); |
1236 CONVERT_ARG_CHECKED(FixedArray, literals, 0); | 1247 CONVERT_ARG_CHECKED(FixedArray, literals, 0); |
1237 int index = Smi::cast(args[1])->value(); | 1248 int index = Smi::cast(args[1])->value(); |
1238 Handle<String> pattern = args.at<String>(2); | 1249 Handle<String> pattern = args.at<String>(2); |
1239 Handle<String> flags = args.at<String>(3); | 1250 Handle<String> flags = args.at<String>(3); |
1240 | 1251 |
1241 // Get the RegExp function from the context in the literals array. | 1252 // Get the RegExp function from the context in the literals array. |
1242 // This is the RegExp function from the context in which the | 1253 // This is the RegExp function from the context in which the |
(...skipping 7104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8347 } else { | 8358 } else { |
8348 // Handle last resort GC and make sure to allow future allocations | 8359 // Handle last resort GC and make sure to allow future allocations |
8349 // to grow the heap without causing GCs (if possible). | 8360 // to grow the heap without causing GCs (if possible). |
8350 Counters::gc_last_resort_from_js.Increment(); | 8361 Counters::gc_last_resort_from_js.Increment(); |
8351 Heap::CollectAllGarbage(false); | 8362 Heap::CollectAllGarbage(false); |
8352 } | 8363 } |
8353 } | 8364 } |
8354 | 8365 |
8355 | 8366 |
8356 } } // namespace v8::internal | 8367 } } // namespace v8::internal |
OLD | NEW |