OLD | NEW |
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 4245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4256 bool pretenure) { | 4256 bool pretenure) { |
4257 // The inevitable call will sync frame elements to memory anyway, so | 4257 // The inevitable call will sync frame elements to memory anyway, so |
4258 // we do it eagerly to allow us to push the arguments directly into | 4258 // we do it eagerly to allow us to push the arguments directly into |
4259 // place. | 4259 // place. |
4260 frame_->SyncRange(0, frame_->element_count() - 1); | 4260 frame_->SyncRange(0, frame_->element_count() - 1); |
4261 | 4261 |
4262 // Use the fast case closure allocation code that allocates in new | 4262 // Use the fast case closure allocation code that allocates in new |
4263 // space for nested functions that don't need literals cloning. | 4263 // space for nested functions that don't need literals cloning. |
4264 if (!pretenure && | 4264 if (!pretenure && |
4265 scope()->is_function_scope() && | 4265 scope()->is_function_scope() && |
4266 function_info->num_literals() == 0 && | 4266 function_info->num_literals() == 0) { |
4267 !function_info->strict_mode()) { // Strict mode functions use slow path. | 4267 FastNewClosureStub stub( |
4268 FastNewClosureStub stub; | 4268 function_info->strict_mode() ? kStrictMode : kNonStrictMode); |
4269 frame_->Push(function_info); | 4269 frame_->Push(function_info); |
4270 Result answer = frame_->CallStub(&stub, 1); | 4270 Result answer = frame_->CallStub(&stub, 1); |
4271 frame_->Push(&answer); | 4271 frame_->Push(&answer); |
4272 } else { | 4272 } else { |
4273 // Call the runtime to instantiate the function based on the | 4273 // Call the runtime to instantiate the function based on the |
4274 // shared function info. | 4274 // shared function info. |
4275 frame_->EmitPush(rsi); | 4275 frame_->EmitPush(rsi); |
4276 frame_->EmitPush(function_info); | 4276 frame_->EmitPush(function_info); |
4277 frame_->EmitPush(pretenure | 4277 frame_->EmitPush(pretenure |
4278 ? Factory::true_value() | 4278 ? Factory::true_value() |
(...skipping 4556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8835 } | 8835 } |
8836 | 8836 |
8837 #endif | 8837 #endif |
8838 | 8838 |
8839 | 8839 |
8840 #undef __ | 8840 #undef __ |
8841 | 8841 |
8842 } } // namespace v8::internal | 8842 } } // namespace v8::internal |
8843 | 8843 |
8844 #endif // V8_TARGET_ARCH_X64 | 8844 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |