OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 4264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4275 Handle<String> type, | 4275 Handle<String> type, |
4276 Vector< Handle<Object> > arguments) { | 4276 Vector< Handle<Object> > arguments) { |
4277 if (is_pre_parsing_) return NULL; | 4277 if (is_pre_parsing_) return NULL; |
4278 | 4278 |
4279 int argc = arguments.length(); | 4279 int argc = arguments.length(); |
4280 Handle<JSArray> array = Factory::NewJSArray(argc, TENURED); | 4280 Handle<JSArray> array = Factory::NewJSArray(argc, TENURED); |
4281 ASSERT(array->IsJSArray() && array->HasFastElements()); | 4281 ASSERT(array->IsJSArray() && array->HasFastElements()); |
4282 for (int i = 0; i < argc; i++) { | 4282 for (int i = 0; i < argc; i++) { |
4283 Handle<Object> element = arguments[i]; | 4283 Handle<Object> element = arguments[i]; |
4284 if (!element.is_null()) { | 4284 if (!element.is_null()) { |
4285 array->SetFastElement(i, *element); | 4285 Object* ok = array->SetFastElement(i, *element); |
| 4286 USE(ok); // Don't get an unused variable warning. |
| 4287 // We know this doesn't cause a GC here because we allocated the JSArray |
| 4288 // large enough. |
| 4289 ASSERT(!ok->IsFailure()); |
4286 } | 4290 } |
4287 } | 4291 } |
4288 ZoneList<Expression*>* args = new ZoneList<Expression*>(2); | 4292 ZoneList<Expression*>* args = new ZoneList<Expression*>(2); |
4289 args->Add(new Literal(type)); | 4293 args->Add(new Literal(type)); |
4290 args->Add(new Literal(array)); | 4294 args->Add(new Literal(array)); |
4291 return new Throw(new CallRuntime(constructor, NULL, args), | 4295 return new Throw(new CallRuntime(constructor, NULL, args), |
4292 scanner().location().beg_pos); | 4296 scanner().location().beg_pos); |
4293 } | 4297 } |
4294 | 4298 |
4295 // ---------------------------------------------------------------------------- | 4299 // ---------------------------------------------------------------------------- |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5354 parser.ParseLazy(script_source, name, | 5358 parser.ParseLazy(script_source, name, |
5355 start_position, end_position, is_expression); | 5359 start_position, end_position, is_expression); |
5356 return result; | 5360 return result; |
5357 } | 5361 } |
5358 | 5362 |
5359 | 5363 |
5360 #undef NEW | 5364 #undef NEW |
5361 | 5365 |
5362 | 5366 |
5363 } } // namespace v8::internal | 5367 } } // namespace v8::internal |
OLD | NEW |