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

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

Issue 5161002: Change the order of evaluation of sub-expressions for keyed call... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month 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
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 follow
5599 // the calling convention for call ICs.
5600 Result key = frame_->Pop();
5601 Result receiver = frame_->Pop();
5602 frame_->Push(&key);
5603 frame_->Push(&receiver);
5604 key.Unuse();
5605 receiver.Unuse();
5606
5595 // Load the arguments. 5607 // Load the arguments.
5596 int arg_count = args->length(); 5608 int arg_count = args->length();
5597 for (int i = 0; i < arg_count; i++) { 5609 for (int i = 0; i < arg_count; i++) {
5598 Load(args->at(i)); 5610 Load(args->at(i));
5599 frame_->SpillTop(); 5611 frame_->SpillTop();
5600 } 5612 }
5601 5613
5602 // Load the name of the function. 5614 // Place the key on top of stack and call the IC initialization code.
5603 Load(property->key()); 5615 frame_->PushElementAt(arg_count + 1);
5604
5605 // Call the IC initialization code.
5606 CodeForSourcePosition(node->position()); 5616 CodeForSourcePosition(node->position());
5607 Result result = frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, 5617 Result result = frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET,
5608 arg_count, 5618 arg_count,
5609 loop_nesting()); 5619 loop_nesting());
5620 frame_->Drop(); // Drop the key still on the stack.
5610 frame_->RestoreContextRegister(); 5621 frame_->RestoreContextRegister();
5611 frame_->Push(&result); 5622 frame_->Push(&result);
5612 } 5623 }
5613 } 5624 }
5614 } else { 5625 } else {
5615 // ---------------------------------- 5626 // ----------------------------------
5616 // JavaScript example: 'foo(1, 2, 3)' // foo is not global 5627 // JavaScript example: 'foo(1, 2, 3)' // foo is not global
5617 // ---------------------------------- 5628 // ----------------------------------
5618 5629
5619 // Load the function. 5630 // Load the function.
(...skipping 3236 matching lines...) Expand 10 before | Expand all | Expand 10 after
8856 #undef __ 8867 #undef __
8857 8868
8858 void RecordWriteStub::Generate(MacroAssembler* masm) { 8869 void RecordWriteStub::Generate(MacroAssembler* masm) {
8859 masm->RecordWriteHelper(object_, addr_, scratch_); 8870 masm->RecordWriteHelper(object_, addr_, scratch_);
8860 masm->ret(0); 8871 masm->ret(0);
8861 } 8872 }
8862 8873
8863 } } // namespace v8::internal 8874 } } // namespace v8::internal
8864 8875
8865 #endif // V8_TARGET_ARCH_X64 8876 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698