| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 ArgumentsAllocationMode mode = ArgumentsMode(); | 631 ArgumentsAllocationMode mode = ArgumentsMode(); |
| 632 ASSERT(mode != NO_ARGUMENTS_ALLOCATION); | 632 ASSERT(mode != NO_ARGUMENTS_ALLOCATION); |
| 633 | 633 |
| 634 Comment cmnt(masm_, "[ store arguments object"); | 634 Comment cmnt(masm_, "[ store arguments object"); |
| 635 if (mode == LAZY_ARGUMENTS_ALLOCATION && initial) { | 635 if (mode == LAZY_ARGUMENTS_ALLOCATION && initial) { |
| 636 // When using lazy arguments allocation, we store the arguments marker value | 636 // When using lazy arguments allocation, we store the arguments marker value |
| 637 // as a sentinel indicating that the arguments object hasn't been | 637 // as a sentinel indicating that the arguments object hasn't been |
| 638 // allocated yet. | 638 // allocated yet. |
| 639 frame_->Push(Factory::arguments_marker()); | 639 frame_->Push(Factory::arguments_marker()); |
| 640 } else { | 640 } else { |
| 641 ArgumentsAccessStub stub(ArgumentsAccessStub::NEW_OBJECT); | 641 ArgumentsAccessStub stub(is_strict_mode() |
| 642 ? ArgumentsAccessStub::NEW_STRICT |
| 643 : ArgumentsAccessStub::NEW_NON_STRICT); |
| 642 frame_->PushFunction(); | 644 frame_->PushFunction(); |
| 643 frame_->PushReceiverSlotAddress(); | 645 frame_->PushReceiverSlotAddress(); |
| 644 frame_->Push(Smi::FromInt(scope()->num_parameters())); | 646 frame_->Push(Smi::FromInt(scope()->num_parameters())); |
| 645 Result result = frame_->CallStub(&stub, 3); | 647 Result result = frame_->CallStub(&stub, 3); |
| 646 frame_->Push(&result); | 648 frame_->Push(&result); |
| 647 } | 649 } |
| 648 | 650 |
| 649 Variable* arguments = scope()->arguments(); | 651 Variable* arguments = scope()->arguments(); |
| 650 Variable* shadow = scope()->arguments_shadow(); | 652 Variable* shadow = scope()->arguments_shadow(); |
| 651 ASSERT(arguments != NULL && arguments->AsSlot() != NULL); | 653 ASSERT(arguments != NULL && arguments->AsSlot() != NULL); |
| (...skipping 3605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4257 void CodeGenerator::InstantiateFunction( | 4259 void CodeGenerator::InstantiateFunction( |
| 4258 Handle<SharedFunctionInfo> function_info, | 4260 Handle<SharedFunctionInfo> function_info, |
| 4259 bool pretenure) { | 4261 bool pretenure) { |
| 4260 // The inevitable call will sync frame elements to memory anyway, so | 4262 // The inevitable call will sync frame elements to memory anyway, so |
| 4261 // we do it eagerly to allow us to push the arguments directly into | 4263 // we do it eagerly to allow us to push the arguments directly into |
| 4262 // place. | 4264 // place. |
| 4263 frame_->SyncRange(0, frame_->element_count() - 1); | 4265 frame_->SyncRange(0, frame_->element_count() - 1); |
| 4264 | 4266 |
| 4265 // Use the fast case closure allocation code that allocates in new | 4267 // Use the fast case closure allocation code that allocates in new |
| 4266 // space for nested functions that don't need literals cloning. | 4268 // space for nested functions that don't need literals cloning. |
| 4267 if (scope()->is_function_scope() && | 4269 if (!pretenure && |
| 4268 function_info->num_literals() == 0 && | 4270 scope()->is_function_scope() && |
| 4269 !pretenure) { | 4271 function_info->num_literals() == 0) { |
| 4270 FastNewClosureStub stub; | 4272 FastNewClosureStub stub( |
| 4273 function_info->strict_mode() ? kStrictMode : kNonStrictMode); |
| 4271 frame_->Push(function_info); | 4274 frame_->Push(function_info); |
| 4272 Result answer = frame_->CallStub(&stub, 1); | 4275 Result answer = frame_->CallStub(&stub, 1); |
| 4273 frame_->Push(&answer); | 4276 frame_->Push(&answer); |
| 4274 } else { | 4277 } else { |
| 4275 // Call the runtime to instantiate the function based on the | 4278 // Call the runtime to instantiate the function based on the |
| 4276 // shared function info. | 4279 // shared function info. |
| 4277 frame_->EmitPush(rsi); | 4280 frame_->EmitPush(rsi); |
| 4278 frame_->EmitPush(function_info); | 4281 frame_->EmitPush(function_info); |
| 4279 frame_->EmitPush(pretenure | 4282 frame_->EmitPush(pretenure |
| 4280 ? Factory::true_value() | 4283 ? Factory::true_value() |
| (...skipping 4573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8854 } | 8857 } |
| 8855 | 8858 |
| 8856 #endif | 8859 #endif |
| 8857 | 8860 |
| 8858 | 8861 |
| 8859 #undef __ | 8862 #undef __ |
| 8860 | 8863 |
| 8861 } } // namespace v8::internal | 8864 } } // namespace v8::internal |
| 8862 | 8865 |
| 8863 #endif // V8_TARGET_ARCH_X64 | 8866 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |