OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 | 1130 |
1131 | 1131 |
1132 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | 1132 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
1133 bool pretenure) { | 1133 bool pretenure) { |
1134 // Use the fast case closure allocation code that allocates in new | 1134 // Use the fast case closure allocation code that allocates in new |
1135 // space for nested functions that don't need literals cloning. If | 1135 // space for nested functions that don't need literals cloning. If |
1136 // we're running with the --always-opt or the --prepare-always-opt | 1136 // we're running with the --always-opt or the --prepare-always-opt |
1137 // flag, we need to use the runtime function so that the new function | 1137 // flag, we need to use the runtime function so that the new function |
1138 // we are creating here gets a chance to have its code optimized and | 1138 // we are creating here gets a chance to have its code optimized and |
1139 // doesn't just get a copy of the existing unoptimized code. | 1139 // doesn't just get a copy of the existing unoptimized code. |
1140 if (!FLAG_always_opt && | 1140 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure && |
1141 !FLAG_prepare_always_opt && | 1141 scope()->is_function_scope()) { |
1142 !pretenure && | |
1143 scope()->is_function_scope() && | |
1144 info->num_literals() == 0) { | |
1145 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | 1142 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); |
1146 __ mov(ebx, Immediate(info)); | 1143 __ mov(ebx, Immediate(info)); |
1147 __ CallStub(&stub); | 1144 __ CallStub(&stub); |
1148 } else { | 1145 } else { |
1149 __ push(Immediate(info)); | 1146 __ push(Immediate(info)); |
1150 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | 1147 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured |
1151 : Runtime::kNewClosure); | 1148 : Runtime::kNewClosure); |
1152 } | 1149 } |
1153 context()->Plug(eax); | 1150 context()->Plug(eax); |
1154 } | 1151 } |
(...skipping 3592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 Assembler::target_address_at(call_target_address, | 4744 Assembler::target_address_at(call_target_address, |
4748 unoptimized_code)); | 4745 unoptimized_code)); |
4749 return OSR_AFTER_STACK_CHECK; | 4746 return OSR_AFTER_STACK_CHECK; |
4750 } | 4747 } |
4751 | 4748 |
4752 | 4749 |
4753 } // namespace internal | 4750 } // namespace internal |
4754 } // namespace v8 | 4751 } // namespace v8 |
4755 | 4752 |
4756 #endif // V8_TARGET_ARCH_IA32 | 4753 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |