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