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

Unified Diff: src/compiler.cc

Issue 23444029: Add OptimizedCodeList and DeoptimizedCodeList to native contexts. Both lists are weak. This makes i… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/contexts.h » ('j') | src/deoptimizer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 6c2bdce26f9a2540adf5a66484d51103afc91628..24099a97464202b01314dee9be7e92e7023d61fc 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -877,9 +877,13 @@ static void InstallCodeCommon(CompilationInfo* info) {
static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
Handle<Code> code = info->code();
- if (FLAG_cache_optimized_code &&
- info->osr_ast_id().IsNone() &&
- code->kind() == Code::OPTIMIZED_FUNCTION) {
+ if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do.
+
+ // The native context has a weak list of all optimized code.
+ info->context()->native_context()->AddOptimizedCode(*code);
Michael Starzinger 2013/09/03 21:52:31 This is a bad choking point to add code to the wea
titzer 2013/09/04 11:19:04 I've moved it out to the point that the optimized
+
+ // Cache non-OSR optimized code.
+ if (FLAG_cache_optimized_code && info->osr_ast_id().IsNone()) {
Handle<JSFunction> function = info->closure();
Handle<SharedFunctionInfo> shared(function->shared());
Handle<FixedArray> literals(function->literals());
« no previous file with comments | « no previous file | src/contexts.h » ('j') | src/deoptimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698