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

Side by Side Diff: src/compiler.cc

Issue 10837037: Age code to allow reclaiming old unexecuted functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Nits Created 8 years, 1 month 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 info.SetLanguageMode(FLAG_harmony_scoping ? EXTENDED_MODE : STRICT_MODE); 602 info.SetLanguageMode(FLAG_harmony_scoping ? EXTENDED_MODE : STRICT_MODE);
603 } 603 }
604 result = MakeFunctionInfo(&info); 604 result = MakeFunctionInfo(&info);
605 if (extension == NULL && !result.is_null() && !result->dont_cache()) { 605 if (extension == NULL && !result.is_null() && !result->dont_cache()) {
606 compilation_cache->PutScript(source, context, result); 606 compilation_cache->PutScript(source, context, result);
607 } 607 }
608 } else { 608 } else {
609 if (result->ic_age() != HEAP->global_ic_age()) { 609 if (result->ic_age() != HEAP->global_ic_age()) {
610 result->ResetForNewContext(HEAP->global_ic_age()); 610 result->ResetForNewContext(HEAP->global_ic_age());
611 } 611 }
612 result->code()->MakeYoung();
612 } 613 }
613 614
614 if (result.is_null()) isolate->ReportPendingMessages(); 615 if (result.is_null()) isolate->ReportPendingMessages();
615 return result; 616 return result;
616 } 617 }
617 618
618 619
619 Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source, 620 Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
620 Handle<Context> context, 621 Handle<Context> context,
621 bool is_global, 622 bool is_global,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 result->is_extended_mode()); 664 result->is_extended_mode());
664 if (!result->dont_cache()) { 665 if (!result->dont_cache()) {
665 compilation_cache->PutEval( 666 compilation_cache->PutEval(
666 source, context, is_global, result, scope_position); 667 source, context, is_global, result, scope_position);
667 } 668 }
668 } 669 }
669 } else { 670 } else {
670 if (result->ic_age() != HEAP->global_ic_age()) { 671 if (result->ic_age() != HEAP->global_ic_age()) {
671 result->ResetForNewContext(HEAP->global_ic_age()); 672 result->ResetForNewContext(HEAP->global_ic_age());
672 } 673 }
674 result->code()->MakeYoung();
673 } 675 }
674 676
675 return result; 677 return result;
676 } 678 }
677 679
678 680
679 static bool InstallFullCode(CompilationInfo* info) { 681 static bool InstallFullCode(CompilationInfo* info) {
680 // Update the shared function info with the compiled code and the 682 // Update the shared function info with the compiled code and the
681 // scope info. Please note, that the order of the shared function 683 // scope info. Please note, that the order of the shared function
682 // info initialization is important since set_scope_info might 684 // info initialization is important since set_scope_info might
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 } 1049 }
1048 } 1050 }
1049 1051
1050 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 1052 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
1051 Handle<Script>(info->script()), 1053 Handle<Script>(info->script()),
1052 Handle<Code>(info->code()), 1054 Handle<Code>(info->code()),
1053 info)); 1055 info));
1054 } 1056 }
1055 1057
1056 } } // namespace v8::internal 1058 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/debug.cc » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698