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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 // space for nested functions that don't need literals cloning. If | 1233 // space for nested functions that don't need literals cloning. If |
1234 // we're running with the --always-opt or the --prepare-always-opt | 1234 // we're running with the --always-opt or the --prepare-always-opt |
1235 // flag, we need to use the runtime function so that the new function | 1235 // flag, we need to use the runtime function so that the new function |
1236 // we are creating here gets a chance to have its code optimized and | 1236 // we are creating here gets a chance to have its code optimized and |
1237 // doesn't just get a copy of the existing unoptimized code. | 1237 // doesn't just get a copy of the existing unoptimized code. |
1238 if (!FLAG_always_opt && | 1238 if (!FLAG_always_opt && |
1239 !FLAG_prepare_always_opt && | 1239 !FLAG_prepare_always_opt && |
1240 !pretenure && | 1240 !pretenure && |
1241 scope()->is_function_scope() && | 1241 scope()->is_function_scope() && |
1242 info->num_literals() == 0) { | 1242 info->num_literals() == 0) { |
1243 FastNewClosureStub stub(info->language_mode()); | 1243 FastNewClosureStub stub(info->language_mode(), info->is_generator()); |
1244 __ Push(info); | 1244 __ Push(info); |
1245 __ CallStub(&stub); | 1245 __ CallStub(&stub); |
1246 } else { | 1246 } else { |
1247 __ push(rsi); | 1247 __ push(rsi); |
1248 __ Push(info); | 1248 __ Push(info); |
1249 __ Push(pretenure | 1249 __ Push(pretenure |
1250 ? isolate()->factory()->true_value() | 1250 ? isolate()->factory()->true_value() |
1251 : isolate()->factory()->false_value()); | 1251 : isolate()->factory()->false_value()); |
1252 __ CallRuntime(Runtime::kNewClosure, 3); | 1252 __ CallRuntime(Runtime::kNewClosure, 3); |
1253 } | 1253 } |
(...skipping 3297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4551 *context_length = 0; | 4551 *context_length = 0; |
4552 return previous_; | 4552 return previous_; |
4553 } | 4553 } |
4554 | 4554 |
4555 | 4555 |
4556 #undef __ | 4556 #undef __ |
4557 | 4557 |
4558 } } // namespace v8::internal | 4558 } } // namespace v8::internal |
4559 | 4559 |
4560 #endif // V8_TARGET_ARCH_X64 | 4560 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |