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 4248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4259 Handle<String> type, | 4259 Handle<String> type, |
4260 Vector< Handle<Object> > arguments) { | 4260 Vector< Handle<Object> > arguments) { |
4261 if (is_pre_parsing_) return NULL; | 4261 if (is_pre_parsing_) return NULL; |
4262 | 4262 |
4263 int argc = arguments.length(); | 4263 int argc = arguments.length(); |
4264 Handle<JSArray> array = Factory::NewJSArray(argc, TENURED); | 4264 Handle<JSArray> array = Factory::NewJSArray(argc, TENURED); |
4265 ASSERT(array->IsJSArray() && array->HasFastElements()); | 4265 ASSERT(array->IsJSArray() && array->HasFastElements()); |
4266 for (int i = 0; i < argc; i++) { | 4266 for (int i = 0; i < argc; i++) { |
4267 Handle<Object> element = arguments[i]; | 4267 Handle<Object> element = arguments[i]; |
4268 if (!element.is_null()) { | 4268 if (!element.is_null()) { |
4269 Object* ok = array->SetFastElement(i, *element); | |
4270 USE(ok); // Don't get an unused variable warning. | |
4271 // We know this doesn't cause a GC here because we allocated the JSArray | 4269 // We know this doesn't cause a GC here because we allocated the JSArray |
4272 // large enough. | 4270 // large enough. |
4273 ASSERT(!ok->IsFailure()); | 4271 array->SetFastElement(i, *element)->ToObjectUnchecked(); |
4274 } | 4272 } |
4275 } | 4273 } |
4276 ZoneList<Expression*>* args = new ZoneList<Expression*>(2); | 4274 ZoneList<Expression*>* args = new ZoneList<Expression*>(2); |
4277 args->Add(new Literal(type)); | 4275 args->Add(new Literal(type)); |
4278 args->Add(new Literal(array)); | 4276 args->Add(new Literal(array)); |
4279 return new Throw(new CallRuntime(constructor, NULL, args), | 4277 return new Throw(new CallRuntime(constructor, NULL, args), |
4280 scanner().location().beg_pos); | 4278 scanner().location().beg_pos); |
4281 } | 4279 } |
4282 | 4280 |
4283 // ---------------------------------------------------------------------------- | 4281 // ---------------------------------------------------------------------------- |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5378 } | 5376 } |
5379 } | 5377 } |
5380 | 5378 |
5381 info->SetFunction(result); | 5379 info->SetFunction(result); |
5382 return (result != NULL); | 5380 return (result != NULL); |
5383 } | 5381 } |
5384 | 5382 |
5385 #undef NEW | 5383 #undef NEW |
5386 | 5384 |
5387 } } // namespace v8::internal | 5385 } } // namespace v8::internal |
OLD | NEW |