Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: arguments/src/x64/codegen-x64.cc

Issue 6665067: [Arguments] Remove synthetic properties and all code dealing with them. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5577 matching lines...) Expand 10 before | Expand all | Expand 10 after
5588 frame_->RestoreContextRegister(); 5588 frame_->RestoreContextRegister();
5589 frame_->Push(&result); 5589 frame_->Push(&result);
5590 } 5590 }
5591 5591
5592 } else { 5592 } else {
5593 // ------------------------------------------- 5593 // -------------------------------------------
5594 // JavaScript example: 'array[index](1, 2, 3)' 5594 // JavaScript example: 'array[index](1, 2, 3)'
5595 // ------------------------------------------- 5595 // -------------------------------------------
5596 5596
5597 // Load the function to call from the property through a reference. 5597 // Load the function to call from the property through a reference.
5598 if (property->is_synthetic()) { 5598 Load(property->obj());
5599 Reference ref(this, property, false);
5600 ref.GetValue();
5601 // Use global object as receiver.
5602 LoadGlobalReceiver();
5603 // Call the function.
5604 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position());
5605 } else {
5606 // Push the receiver onto the frame.
5607 Load(property->obj());
5608 5599
5609 // Load the name of the function. 5600 // Load the name of the function.
5610 Load(property->key()); 5601 Load(property->key());
5611 5602
5612 // Swap the name of the function and the receiver on the stack to follow 5603 // Swap the name of the function and the receiver on the stack to follow
5613 // the calling convention for call ICs. 5604 // the calling convention for call ICs.
5614 Result key = frame_->Pop(); 5605 Result key = frame_->Pop();
5615 Result receiver = frame_->Pop(); 5606 Result receiver = frame_->Pop();
5616 frame_->Push(&key); 5607 frame_->Push(&key);
5617 frame_->Push(&receiver); 5608 frame_->Push(&receiver);
5618 key.Unuse(); 5609 key.Unuse();
5619 receiver.Unuse(); 5610 receiver.Unuse();
5620 5611
5621 // Load the arguments. 5612 // Load the arguments.
5622 int arg_count = args->length(); 5613 int arg_count = args->length();
5623 for (int i = 0; i < arg_count; i++) { 5614 for (int i = 0; i < arg_count; i++) {
5624 Load(args->at(i)); 5615 Load(args->at(i));
5625 frame_->SpillTop(); 5616 frame_->SpillTop();
5626 } 5617 }
5627 5618
5628 // Place the key on top of stack and call the IC initialization code. 5619 // Place the key on top of stack and call the IC initialization code.
5629 frame_->PushElementAt(arg_count + 1); 5620 frame_->PushElementAt(arg_count + 1);
5630 CodeForSourcePosition(node->position()); 5621 CodeForSourcePosition(node->position());
5631 Result result = frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, 5622 Result result = frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET,
5632 arg_count, 5623 arg_count,
5633 loop_nesting()); 5624 loop_nesting());
5634 frame_->Drop(); // Drop the key still on the stack. 5625 frame_->Drop(); // Drop the key still on the stack.
5635 frame_->RestoreContextRegister(); 5626 frame_->RestoreContextRegister();
5636 frame_->Push(&result); 5627 frame_->Push(&result);
5637 }
5638 } 5628 }
5639 } else { 5629 } else {
5640 // ---------------------------------- 5630 // ----------------------------------
5641 // JavaScript example: 'foo(1, 2, 3)' // foo is not global 5631 // JavaScript example: 'foo(1, 2, 3)' // foo is not global
5642 // ---------------------------------- 5632 // ----------------------------------
5643 5633
5644 // Load the function. 5634 // Load the function.
5645 Load(function); 5635 Load(function);
5646 5636
5647 // Pass the global proxy as the receiver. 5637 // Pass the global proxy as the receiver.
(...skipping 3179 matching lines...) Expand 10 before | Expand all | Expand 10 after
8827 } 8817 }
8828 8818
8829 #endif 8819 #endif
8830 8820
8831 8821
8832 #undef __ 8822 #undef __
8833 8823
8834 } } // namespace v8::internal 8824 } } // namespace v8::internal
8835 8825
8836 #endif // V8_TARGET_ARCH_X64 8826 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698