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

Side by Side Diff: src/compiler.cc

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing to ToT Created 9 years, 11 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/flag-definitions.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 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 !LiveEditFunctionTracker::IsActive(); 655 !LiveEditFunctionTracker::IsActive();
656 656
657 Handle<SerializedScopeInfo> scope_info(SerializedScopeInfo::Empty()); 657 Handle<SerializedScopeInfo> scope_info(SerializedScopeInfo::Empty());
658 658
659 // Generate code 659 // Generate code
660 if (FLAG_lazy && allow_lazy) { 660 if (FLAG_lazy && allow_lazy) {
661 Handle<Code> code(Builtins::builtin(Builtins::LazyCompile)); 661 Handle<Code> code(Builtins::builtin(Builtins::LazyCompile));
662 info.SetCode(code); 662 info.SetCode(code);
663 } else { 663 } else {
664 if (V8::UseCrankshaft()) { 664 if (V8::UseCrankshaft()) {
665 if (!MakeCrankshaftCode(&info)) { 665 if (!MakeCrankshaftCode(&info)) {
Kevin Millikin (Chromium) 2011/01/14 12:48:59 The code here is confusing. From my reading of th
666 return Handle<SharedFunctionInfo>::null(); 666 return Handle<SharedFunctionInfo>::null();
667 } 667 }
668 if (FLAG_optimize_closures
669 && !AlwaysFullCompiler()
Kevin Millikin (Chromium) 2011/01/14 12:48:59 I'm not sure all these checks are necessary. I wo
670 && !info.scope()->HasTrivialOuterContext()
671 && !info.scope()->outer_scope_calls_eval()
672 && !info.scope()->inside_with()) {
673 ASSERT(info.code()->kind() == Code::FUNCTION);
674 info.code()->set_optimizable(true);
Kevin Millikin (Chromium) 2011/01/14 12:48:59 Then, I'm not a fan of compiling with non-optimiza
675 }
668 } else { 676 } else {
669 // The bodies of function literals have not yet been visited by the 677 // The bodies of function literals have not yet been visited by the
670 // AST optimizer/analyzer. 678 // AST optimizer/analyzer.
671 if (!Rewriter::Analyze(&info)) return Handle<SharedFunctionInfo>::null(); 679 if (!Rewriter::Analyze(&info)) return Handle<SharedFunctionInfo>::null();
672 680
673 bool is_run_once = literal->try_full_codegen(); 681 bool is_run_once = literal->try_full_codegen();
674 bool can_use_full = FLAG_full_compiler && !literal->contains_loops(); 682 bool can_use_full = FLAG_full_compiler && !literal->contains_loops();
675 683
676 if (AlwaysFullCompiler() || (is_run_once && can_use_full)) { 684 if (AlwaysFullCompiler() || (is_run_once && can_use_full)) {
677 if (!FullCodeGenerator::MakeCode(&info)) { 685 if (!FullCodeGenerator::MakeCode(&info)) {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 *code, 776 *code,
769 *name)); 777 *name));
770 OPROFILE(CreateNativeCodeRegion(*name, 778 OPROFILE(CreateNativeCodeRegion(*name,
771 code->instruction_start(), 779 code->instruction_start(),
772 code->instruction_size())); 780 code->instruction_size()));
773 } 781 }
774 } 782 }
775 } 783 }
776 784
777 } } // namespace v8::internal 785 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698