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

Side by Side Diff: src/x64/full-codegen-x64.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
« src/arm/codegen-arm.cc ('K') | « src/x64/codegen-x64.cc ('k') | no next file » | 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 // Remove the pointers stored on the stack. 830 // Remove the pointers stored on the stack.
831 __ bind(loop_statement.break_target()); 831 __ bind(loop_statement.break_target());
832 __ addq(rsp, Immediate(5 * kPointerSize)); 832 __ addq(rsp, Immediate(5 * kPointerSize));
833 833
834 // Exit and decrement the loop depth. 834 // Exit and decrement the loop depth.
835 __ bind(&exit); 835 __ bind(&exit);
836 decrement_loop_depth(); 836 decrement_loop_depth();
837 } 837 }
838 838
839 839
840 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) { 840 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
841 bool pretenure) {
841 // Use the fast case closure allocation code that allocates in new 842 // Use the fast case closure allocation code that allocates in new
842 // space for nested functions that don't need literals cloning. 843 // space for nested functions that don't need literals cloning.
843 if (scope()->is_function_scope() && info->num_literals() == 0) { 844 if (scope()->is_function_scope() &&
845 info->num_literals() == 0 &&
846 !pretenure) {
844 FastNewClosureStub stub; 847 FastNewClosureStub stub;
845 __ Push(info); 848 __ Push(info);
846 __ CallStub(&stub); 849 __ CallStub(&stub);
847 } else { 850 } else {
848 __ push(rsi); 851 __ push(rsi);
849 __ Push(info); 852 __ Push(info);
850 __ CallRuntime(Runtime::kNewClosure, 2); 853 __ Push(pretenure ? Factory::true_value() : Factory::false_value());
854 __ CallRuntime(Runtime::kNewClosure, 3);
851 } 855 }
852 context()->Plug(rax); 856 context()->Plug(rax);
853 } 857 }
854 858
855 859
856 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) { 860 void FullCodeGenerator::VisitVariableProxy(VariableProxy* expr) {
857 Comment cmnt(masm_, "[ VariableProxy"); 861 Comment cmnt(masm_, "[ VariableProxy");
858 EmitVariableLoad(expr->var()); 862 EmitVariableLoad(expr->var());
859 } 863 }
860 864
(...skipping 2604 matching lines...) Expand 10 before | Expand all | Expand 10 after
3465 __ ret(0); 3469 __ ret(0);
3466 } 3470 }
3467 3471
3468 3472
3469 #undef __ 3473 #undef __
3470 3474
3471 3475
3472 } } // namespace v8::internal 3476 } } // namespace v8::internal
3473 3477
3474 #endif // V8_TARGET_ARCH_X64 3478 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/arm/codegen-arm.cc ('K') | « src/x64/codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698