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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 5220007: Force pretenuring of closures that are immediately assigned to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 // Remove the pointers stored on the stack. 873 // Remove the pointers stored on the stack.
874 __ bind(loop_statement.break_target()); 874 __ bind(loop_statement.break_target());
875 __ add(Operand(esp), Immediate(5 * kPointerSize)); 875 __ add(Operand(esp), Immediate(5 * kPointerSize));
876 876
877 // Exit and decrement the loop depth. 877 // Exit and decrement the loop depth.
878 __ bind(&exit); 878 __ bind(&exit);
879 decrement_loop_depth(); 879 decrement_loop_depth();
880 } 880 }
881 881
882 882
883 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) { 883 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
884 bool pretenure) {
884 // Use the fast case closure allocation code that allocates in new 885 // Use the fast case closure allocation code that allocates in new
885 // space for nested functions that don't need literals cloning. 886 // space for nested functions that don't need literals cloning.
886 if (scope()->is_function_scope() && info->num_literals() == 0) { 887 if (scope()->is_function_scope() &&
888 info->num_literals() == 0 &&
889 !pretenure) {
887 FastNewClosureStub stub; 890 FastNewClosureStub stub;
888 __ push(Immediate(info)); 891 __ push(Immediate(info));
889 __ CallStub(&stub); 892 __ CallStub(&stub);
890 } else { 893 } else {
891 __ push(esi); 894 __ push(esi);
892 __ push(Immediate(info)); 895 __ push(Immediate(info));
893 __ CallRuntime(Runtime::kNewClosure, 2); 896 __ push(Immediate(pretenure
897 ? Factory::true_value()
898 : Factory::false_value()));
899 __ CallRuntime(Runtime::kNewClosure, 3);
894 } 900 }
895 context()->Plug(eax); 901 context()->Plug(eax);
896 } 902 }
897 903
898 904
899 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { 905 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
900 Comment cmnt(masm_, "[ VariableProxy"); 906 Comment cmnt(masm_, "[ VariableProxy");
901 EmitVariableLoad(expr->var()); 907 EmitVariableLoad(expr->var());
902 } 908 }
903 909
(...skipping 3038 matching lines...) Expand 10 before | Expand all | Expand 10 after
3942 // And return. 3948 // And return.
3943 __ ret(0); 3949 __ ret(0);
3944 } 3950 }
3945 3951
3946 3952
3947 #undef __ 3953 #undef __
3948 3954
3949 } } // namespace v8::internal 3955 } } // namespace v8::internal
3950 3956
3951 #endif // V8_TARGET_ARCH_IA32 3957 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/arm/codegen-arm.cc ('K') | « src/ia32/codegen-ia32.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698