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

Side by Side Diff: src/runtime.cc

Issue 5274002: Version 2.5.8... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years 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 | « src/runtime.h ('k') | src/scanner.h » ('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-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 6322 matching lines...) Expand 10 before | Expand all | Expand 10 after
6333 array->set(i, *--parameters, mode); 6333 array->set(i, *--parameters, mode);
6334 } 6334 }
6335 JSObject::cast(result)->set_elements(FixedArray::cast(obj)); 6335 JSObject::cast(result)->set_elements(FixedArray::cast(obj));
6336 } 6336 }
6337 return result; 6337 return result;
6338 } 6338 }
6339 6339
6340 6340
6341 static MaybeObject* Runtime_NewClosure(Arguments args) { 6341 static MaybeObject* Runtime_NewClosure(Arguments args) {
6342 HandleScope scope; 6342 HandleScope scope;
6343 ASSERT(args.length() == 2); 6343 ASSERT(args.length() == 3);
6344 CONVERT_ARG_CHECKED(Context, context, 0); 6344 CONVERT_ARG_CHECKED(Context, context, 0);
6345 CONVERT_ARG_CHECKED(SharedFunctionInfo, shared, 1); 6345 CONVERT_ARG_CHECKED(SharedFunctionInfo, shared, 1);
6346 CONVERT_BOOLEAN_CHECKED(pretenure, args[2]);
6346 6347
6347 PretenureFlag pretenure = (context->global_context() == *context) 6348 // Allocate global closures in old space and allocate local closures
6348 ? TENURED // Allocate global closures in old space. 6349 // in new space. Additionally pretenure closures that are assigned
6349 : NOT_TENURED; // Allocate local closures in new space. 6350 // directly to properties.
6351 pretenure = pretenure || (context->global_context() == *context);
6352 PretenureFlag pretenure_flag = pretenure ? TENURED : NOT_TENURED;
6350 Handle<JSFunction> result = 6353 Handle<JSFunction> result =
6351 Factory::NewFunctionFromSharedFunctionInfo(shared, context, pretenure); 6354 Factory::NewFunctionFromSharedFunctionInfo(shared,
6355 context,
6356 pretenure_flag);
6352 return *result; 6357 return *result;
6353 } 6358 }
6354 6359
6355 static MaybeObject* Runtime_NewObjectFromBound(Arguments args) { 6360 static MaybeObject* Runtime_NewObjectFromBound(Arguments args) {
6356 HandleScope scope; 6361 HandleScope scope;
6357 ASSERT(args.length() == 2); 6362 ASSERT(args.length() == 2);
6358 CONVERT_ARG_CHECKED(JSFunction, function, 0); 6363 CONVERT_ARG_CHECKED(JSFunction, function, 0);
6359 CONVERT_ARG_CHECKED(JSArray, params, 1); 6364 CONVERT_ARG_CHECKED(JSArray, params, 1);
6360 6365
6361 RUNTIME_ASSERT(params->HasFastElements()); 6366 RUNTIME_ASSERT(params->HasFastElements());
(...skipping 3958 matching lines...) Expand 10 before | Expand all | Expand 10 after
10320 } else { 10325 } else {
10321 // Handle last resort GC and make sure to allow future allocations 10326 // Handle last resort GC and make sure to allow future allocations
10322 // to grow the heap without causing GCs (if possible). 10327 // to grow the heap without causing GCs (if possible).
10323 Counters::gc_last_resort_from_js.Increment(); 10328 Counters::gc_last_resort_from_js.Increment();
10324 Heap::CollectAllGarbage(false); 10329 Heap::CollectAllGarbage(false);
10325 } 10330 }
10326 } 10331 }
10327 10332
10328 10333
10329 } } // namespace v8::internal 10334 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698