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

Side by Side Diff: src/runtime.cc

Issue 6821009: Introduce runtime function %OptimizeFunctionOnNextCall to manually trigger optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years, 8 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 | « src/runtime.h ('k') | src/runtime-profiler.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 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 7387 matching lines...) Expand 10 before | Expand all | Expand 10 after
7398 ASSERT(args.length() == 1); 7398 ASSERT(args.length() == 1);
7399 CONVERT_ARG_CHECKED(JSFunction, function, 0); 7399 CONVERT_ARG_CHECKED(JSFunction, function, 0);
7400 if (!function->IsOptimized()) return isolate->heap()->undefined_value(); 7400 if (!function->IsOptimized()) return isolate->heap()->undefined_value();
7401 7401
7402 Deoptimizer::DeoptimizeFunction(*function); 7402 Deoptimizer::DeoptimizeFunction(*function);
7403 7403
7404 return isolate->heap()->undefined_value(); 7404 return isolate->heap()->undefined_value();
7405 } 7405 }
7406 7406
7407 7407
7408 RUNTIME_FUNCTION(MaybeObject*, Runtime_OptimizeFunctionOnNextCall) {
7409 HandleScope scope(isolate);
7410 ASSERT(args.length() == 1);
7411 CONVERT_ARG_CHECKED(JSFunction, function, 0);
7412 if (!function->IsOptimizable()) return isolate->heap()->undefined_value();
7413 function->MarkForLazyRecompilation();
7414 return isolate->heap()->undefined_value();
7415 }
7416
7417
7408 RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) { 7418 RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
7409 HandleScope scope(isolate); 7419 HandleScope scope(isolate);
7410 ASSERT(args.length() == 1); 7420 ASSERT(args.length() == 1);
7411 CONVERT_ARG_CHECKED(JSFunction, function, 0); 7421 CONVERT_ARG_CHECKED(JSFunction, function, 0);
7412 7422
7413 // We're not prepared to handle a function with arguments object. 7423 // We're not prepared to handle a function with arguments object.
7414 ASSERT(!function->shared()->scope_info()->HasArgumentsShadow()); 7424 ASSERT(!function->shared()->scope_info()->HasArgumentsShadow());
7415 7425
7416 // We have hit a back edge in an unoptimized frame for a function that was 7426 // We have hit a back edge in an unoptimized frame for a function that was
7417 // selected for on-stack replacement. Find the unoptimized code object. 7427 // selected for on-stack replacement. Find the unoptimized code object.
(...skipping 4534 matching lines...) Expand 10 before | Expand all | Expand 10 after
11952 } else { 11962 } else {
11953 // Handle last resort GC and make sure to allow future allocations 11963 // Handle last resort GC and make sure to allow future allocations
11954 // to grow the heap without causing GCs (if possible). 11964 // to grow the heap without causing GCs (if possible).
11955 isolate->counters()->gc_last_resort_from_js()->Increment(); 11965 isolate->counters()->gc_last_resort_from_js()->Increment();
11956 isolate->heap()->CollectAllGarbage(false); 11966 isolate->heap()->CollectAllGarbage(false);
11957 } 11967 }
11958 } 11968 }
11959 11969
11960 11970
11961 } } // namespace v8::internal 11971 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698