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

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

Issue 6677036: Fast path for strict closure creation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 // Use the fast case closure allocation code that allocates in new 1034 // Use the fast case closure allocation code that allocates in new
1035 // space for nested functions that don't need literals cloning. If 1035 // space for nested functions that don't need literals cloning. If
1036 // we're running with the --always-opt or the --prepare-always-opt 1036 // we're running with the --always-opt or the --prepare-always-opt
1037 // flag, we need to use the runtime function so that the new function 1037 // flag, we need to use the runtime function so that the new function
1038 // we are creating here gets a chance to have its code optimized and 1038 // we are creating here gets a chance to have its code optimized and
1039 // doesn't just get a copy of the existing unoptimized code. 1039 // doesn't just get a copy of the existing unoptimized code.
1040 if (!FLAG_always_opt && 1040 if (!FLAG_always_opt &&
1041 !FLAG_prepare_always_opt && 1041 !FLAG_prepare_always_opt &&
1042 !pretenure && 1042 !pretenure &&
1043 scope()->is_function_scope() && 1043 scope()->is_function_scope() &&
1044 info->num_literals() == 0 && 1044 info->num_literals() == 0) {
1045 !info->strict_mode()) { // Strict mode functions use slow path. 1045 FastNewClosureStub stub(info->strict_mode() ? kStrictMode : kNonStrictMode);
1046 FastNewClosureStub stub;
1047 __ Push(info); 1046 __ Push(info);
1048 __ CallStub(&stub); 1047 __ CallStub(&stub);
1049 } else { 1048 } else {
1050 __ push(rsi); 1049 __ push(rsi);
1051 __ Push(info); 1050 __ Push(info);
1052 __ Push(pretenure ? Factory::true_value() : Factory::false_value()); 1051 __ Push(pretenure ? Factory::true_value() : Factory::false_value());
1053 __ CallRuntime(Runtime::kNewClosure, 3); 1052 __ CallRuntime(Runtime::kNewClosure, 3);
1054 } 1053 }
1055 context()->Plug(rax); 1054 context()->Plug(rax);
1056 } 1055 }
(...skipping 2910 matching lines...) Expand 10 before | Expand all | Expand 10 after
3967 __ ret(0); 3966 __ ret(0);
3968 } 3967 }
3969 3968
3970 3969
3971 #undef __ 3970 #undef __
3972 3971
3973 3972
3974 } } // namespace v8::internal 3973 } } // namespace v8::internal
3975 3974
3976 #endif // V8_TARGET_ARCH_X64 3975 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698