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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 | 1210 |
1211 | 1211 |
1212 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | 1212 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
1213 bool pretenure) { | 1213 bool pretenure) { |
1214 // Use the fast case closure allocation code that allocates in new | 1214 // Use the fast case closure allocation code that allocates in new |
1215 // space for nested functions that don't need literals cloning. If | 1215 // space for nested functions that don't need literals cloning. If |
1216 // we're running with the --always-opt or the --prepare-always-opt | 1216 // we're running with the --always-opt or the --prepare-always-opt |
1217 // flag, we need to use the runtime function so that the new function | 1217 // flag, we need to use the runtime function so that the new function |
1218 // we are creating here gets a chance to have its code optimized and | 1218 // we are creating here gets a chance to have its code optimized and |
1219 // doesn't just get a copy of the existing unoptimized code. | 1219 // doesn't just get a copy of the existing unoptimized code. |
1220 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure && | 1220 if (!FLAG_always_opt && |
1221 scope()->is_function_scope()) { | 1221 !FLAG_prepare_always_opt && |
| 1222 !pretenure && |
| 1223 scope()->is_function_scope() && |
| 1224 info->num_literals() == 0) { |
1222 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | 1225 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); |
1223 __ li(a2, Operand(info)); | 1226 __ li(a2, Operand(info)); |
1224 __ CallStub(&stub); | 1227 __ CallStub(&stub); |
1225 } else { | 1228 } else { |
1226 __ Push(info); | 1229 __ Push(info); |
1227 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | 1230 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured |
1228 : Runtime::kNewClosure); | 1231 : Runtime::kNewClosure); |
1229 } | 1232 } |
1230 context()->Plug(v0); | 1233 context()->Plug(v0); |
1231 } | 1234 } |
(...skipping 3560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4792 reinterpret_cast<uint32_t>( | 4795 reinterpret_cast<uint32_t>( |
4793 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4796 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4794 return OSR_AFTER_STACK_CHECK; | 4797 return OSR_AFTER_STACK_CHECK; |
4795 } | 4798 } |
4796 | 4799 |
4797 | 4800 |
4798 } // namespace internal | 4801 } // namespace internal |
4799 } // namespace v8 | 4802 } // namespace v8 |
4800 | 4803 |
4801 #endif // V8_TARGET_ARCH_MIPS | 4804 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |