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

Side by Side Diff: src/factory.cc

Issue 7013: - Optimized JSArray allocation in runtime system by using NewJSArrayWithEleme... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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
« no previous file with comments | « no previous file | src/handles.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 277
278 Handle<Object> Factory::NewReferenceError(Handle<String> message) { 278 Handle<Object> Factory::NewReferenceError(Handle<String> message) {
279 return NewError("$ReferenceError", message); 279 return NewError("$ReferenceError", message);
280 } 280 }
281 281
282 282
283 Handle<Object> Factory::NewError(const char* maker, const char* type, 283 Handle<Object> Factory::NewError(const char* maker, const char* type,
284 Vector< Handle<Object> > args) { 284 Vector< Handle<Object> > args) {
285 HandleScope scope; 285 HandleScope scope;
286 Handle<JSArray> array = NewJSArray(args.length()); 286 Handle<FixedArray> array = Factory::NewFixedArray(args.length());
287 for (int i = 0; i < args.length(); i++) 287 for (int i = 0; i < args.length(); i++) {
288 SetElement(array, i, args[i]); 288 array->set(i, *args[i]);
289 Handle<Object> result = NewError(maker, type, array); 289 }
290 Handle<JSArray> object = Factory::NewJSArrayWithElements(array);
291 Handle<Object> result = NewError(maker, type, object);
290 return result.EscapeFrom(&scope); 292 return result.EscapeFrom(&scope);
291 } 293 }
292 294
293 295
294 Handle<Object> Factory::NewEvalError(const char* type, 296 Handle<Object> Factory::NewEvalError(const char* type,
295 Vector< Handle<Object> > args) { 297 Vector< Handle<Object> > args) {
296 return NewError("MakeEvalError", type, args); 298 return NewError("MakeEvalError", type, args);
297 } 299 }
298 300
299 301
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 Execution::ConfigureInstance(instance, 806 Execution::ConfigureInstance(instance,
805 instance_template, 807 instance_template,
806 pending_exception); 808 pending_exception);
807 } else { 809 } else {
808 *pending_exception = false; 810 *pending_exception = false;
809 } 811 }
810 } 812 }
811 813
812 814
813 } } // namespace v8::internal 815 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698