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

Side by Side Diff: src/compiler.cc

Issue 10121007: Allow more functions to be lazy compiled. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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/ast.cc ('k') | src/scopes.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 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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 info.SetScope(literal->scope()); 710 info.SetScope(literal->scope());
711 info.SetLanguageMode(literal->scope()->language_mode()); 711 info.SetLanguageMode(literal->scope()->language_mode());
712 712
713 LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal); 713 LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal);
714 // Determine if the function can be lazily compiled. This is necessary to 714 // Determine if the function can be lazily compiled. This is necessary to
715 // allow some of our builtin JS files to be lazily compiled. These 715 // allow some of our builtin JS files to be lazily compiled. These
716 // builtins cannot be handled lazily by the parser, since we have to know 716 // builtins cannot be handled lazily by the parser, since we have to know
717 // if a function uses the special natives syntax, which is something the 717 // if a function uses the special natives syntax, which is something the
718 // parser records. 718 // parser records.
719 bool allow_lazy = literal->AllowsLazyCompilation() && 719 bool allow_lazy = literal->AllowsLazyCompilation() &&
720 !LiveEditFunctionTracker::IsActive(info.isolate()); 720 !LiveEditFunctionTracker::IsActive(info.isolate()) &&
721 (!info.is_native() || literal->AllowsLazyCompilationForNative());
721 722
722 Handle<ScopeInfo> scope_info(ScopeInfo::Empty()); 723 Handle<ScopeInfo> scope_info(ScopeInfo::Empty());
723 724
724 // Generate code 725 // Generate code
725 if (FLAG_lazy && allow_lazy) { 726 if (FLAG_lazy && allow_lazy) {
726 Handle<Code> code = info.isolate()->builtins()->LazyCompile(); 727 Handle<Code> code = info.isolate()->builtins()->LazyCompile();
727 info.SetCode(code); 728 info.SetCode(code);
728 } else if ((V8::UseCrankshaft() && MakeCrankshaftCode(&info)) || 729 } else if ((V8::UseCrankshaft() && MakeCrankshaftCode(&info)) ||
729 (!V8::UseCrankshaft() && FullCodeGenerator::MakeCode(&info))) { 730 (!V8::UseCrankshaft() && FullCodeGenerator::MakeCode(&info))) {
730 ASSERT(!info.code().is_null()); 731 ASSERT(!info.code().is_null());
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 818 }
818 } 819 }
819 820
820 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 821 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
821 Handle<Script>(info->script()), 822 Handle<Script>(info->script()),
822 Handle<Code>(info->code()), 823 Handle<Code>(info->code()),
823 info)); 824 info));
824 } 825 }
825 826
826 } } // namespace v8::internal 827 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698