OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5585 Reference ref(this, property, false); | 5585 Reference ref(this, property, false); |
5586 ref.GetValue(); | 5586 ref.GetValue(); |
5587 // Use global object as receiver. | 5587 // Use global object as receiver. |
5588 LoadGlobalReceiver(); | 5588 LoadGlobalReceiver(); |
5589 // Call the function. | 5589 // Call the function. |
5590 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position()); | 5590 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position()); |
5591 } else { | 5591 } else { |
5592 // Push the receiver onto the frame. | 5592 // Push the receiver onto the frame. |
5593 Load(property->obj()); | 5593 Load(property->obj()); |
5594 | 5594 |
5595 // Load the name of the function. | |
5596 Load(property->key()); | |
5597 | |
5598 // Swap the name of the function and the receiver on the stack to have | |
5599 // a stack image common for calls using an IC (receiver followed by | |
5600 // arguments). | |
5601 Result tmp1 = frame_->Pop(); | |
Mads Ager (chromium)
2010/11/17 13:11:37
names?
Søren Thygesen Gjesse
2010/11/18 08:48:57
Done.
| |
5602 Result tmp2 = frame_->Pop(); | |
5603 frame_->Push(&tmp1); | |
5604 frame_->Push(&tmp2); | |
5605 tmp1.Unuse(); | |
5606 tmp2.Unuse(); | |
5607 | |
5595 // Load the arguments. | 5608 // Load the arguments. |
5596 int arg_count = args->length(); | 5609 int arg_count = args->length(); |
5597 for (int i = 0; i < arg_count; i++) { | 5610 for (int i = 0; i < arg_count; i++) { |
5598 Load(args->at(i)); | 5611 Load(args->at(i)); |
5599 frame_->SpillTop(); | 5612 frame_->SpillTop(); |
5600 } | 5613 } |
5601 | 5614 |
5602 // Load the name of the function. | 5615 // Place the key on top of stack and call the IC initialization code. |
5603 Load(property->key()); | 5616 frame_->PushElementAt(arg_count + 1); |
5604 | |
5605 // Call the IC initialization code. | |
5606 CodeForSourcePosition(node->position()); | 5617 CodeForSourcePosition(node->position()); |
5607 Result result = frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, | 5618 Result result = frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, |
5608 arg_count, | 5619 arg_count, |
5609 loop_nesting()); | 5620 loop_nesting()); |
5621 frame_->Drop(); // Drop the key still on the stack. | |
5610 frame_->RestoreContextRegister(); | 5622 frame_->RestoreContextRegister(); |
5611 frame_->Push(&result); | 5623 frame_->Push(&result); |
5612 } | 5624 } |
5613 } | 5625 } |
5614 } else { | 5626 } else { |
5615 // ---------------------------------- | 5627 // ---------------------------------- |
5616 // JavaScript example: 'foo(1, 2, 3)' // foo is not global | 5628 // JavaScript example: 'foo(1, 2, 3)' // foo is not global |
5617 // ---------------------------------- | 5629 // ---------------------------------- |
5618 | 5630 |
5619 // Load the function. | 5631 // Load the function. |
(...skipping 3236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8856 #undef __ | 8868 #undef __ |
8857 | 8869 |
8858 void RecordWriteStub::Generate(MacroAssembler* masm) { | 8870 void RecordWriteStub::Generate(MacroAssembler* masm) { |
8859 masm->RecordWriteHelper(object_, addr_, scratch_); | 8871 masm->RecordWriteHelper(object_, addr_, scratch_); |
8860 masm->ret(0); | 8872 masm->ret(0); |
8861 } | 8873 } |
8862 | 8874 |
8863 } } // namespace v8::internal | 8875 } } // namespace v8::internal |
8864 | 8876 |
8865 #endif // V8_TARGET_ARCH_X64 | 8877 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |