OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 // space for nested functions that don't need literals cloning. If | 1207 // space for nested functions that don't need literals cloning. If |
1208 // we're running with the --always-opt or the --prepare-always-opt | 1208 // we're running with the --always-opt or the --prepare-always-opt |
1209 // flag, we need to use the runtime function so that the new function | 1209 // flag, we need to use the runtime function so that the new function |
1210 // we are creating here gets a chance to have its code optimized and | 1210 // we are creating here gets a chance to have its code optimized and |
1211 // doesn't just get a copy of the existing unoptimized code. | 1211 // doesn't just get a copy of the existing unoptimized code. |
1212 if (!FLAG_always_opt && | 1212 if (!FLAG_always_opt && |
1213 !FLAG_prepare_always_opt && | 1213 !FLAG_prepare_always_opt && |
1214 !pretenure && | 1214 !pretenure && |
1215 scope()->is_function_scope() && | 1215 scope()->is_function_scope() && |
1216 info->num_literals() == 0) { | 1216 info->num_literals() == 0) { |
1217 FastNewClosureStub stub(info->language_mode()); | 1217 FastNewClosureStub stub(info->language_mode(), info->is_generator()); |
1218 __ push(Immediate(info)); | 1218 __ push(Immediate(info)); |
1219 __ CallStub(&stub); | 1219 __ CallStub(&stub); |
1220 } else { | 1220 } else { |
1221 __ push(esi); | 1221 __ push(esi); |
1222 __ push(Immediate(info)); | 1222 __ push(Immediate(info)); |
1223 __ push(Immediate(pretenure | 1223 __ push(Immediate(pretenure |
1224 ? isolate()->factory()->true_value() | 1224 ? isolate()->factory()->true_value() |
1225 : isolate()->factory()->false_value())); | 1225 : isolate()->factory()->false_value())); |
1226 __ CallRuntime(Runtime::kNewClosure, 3); | 1226 __ CallRuntime(Runtime::kNewClosure, 3); |
1227 } | 1227 } |
(...skipping 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4550 *stack_depth = 0; | 4550 *stack_depth = 0; |
4551 *context_length = 0; | 4551 *context_length = 0; |
4552 return previous_; | 4552 return previous_; |
4553 } | 4553 } |
4554 | 4554 |
4555 #undef __ | 4555 #undef __ |
4556 | 4556 |
4557 } } // namespace v8::internal | 4557 } } // namespace v8::internal |
4558 | 4558 |
4559 #endif // V8_TARGET_ARCH_IA32 | 4559 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |