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

Unified Diff: src/x64/virtual-frame-x64.cc

Issue 146082: X64 implementation: comparison operations. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/virtual-frame-x64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/virtual-frame-x64.cc
===================================================================
--- src/x64/virtual-frame-x64.cc (revision 2261)
+++ src/x64/virtual-frame-x64.cc (working copy)
@@ -705,6 +705,39 @@
}
+Result VirtualFrame::CallStub(CodeStub* stub, Result* arg) {
+ PrepareForCall(0, 0);
+ arg->ToRegister(rax);
+ arg->Unuse();
+ return RawCallStub(stub);
+}
+
+
+Result VirtualFrame::CallStub(CodeStub* stub, Result* arg0, Result* arg1) {
+ PrepareForCall(0, 0);
+
+ if (arg0->is_register() && arg0->reg().is(rax)) {
+ if (arg1->is_register() && arg1->reg().is(rdx)) {
+ // Wrong registers.
+ __ xchg(rax, rdx);
+ } else {
+ // Register rdx is free for arg0, which frees rax for arg1.
+ arg0->ToRegister(rdx);
+ arg1->ToRegister(rax);
+ }
+ } else {
+ // Register rax is free for arg1, which guarantees rdx is free for
+ // arg0.
+ arg1->ToRegister(rax);
+ arg0->ToRegister(rdx);
+ }
+
+ arg0->Unuse();
+ arg1->Unuse();
+ return RawCallStub(stub);
+}
+
+
void VirtualFrame::SyncElementBelowStackPointer(int index) {
// Emit code to write elements below the stack pointer to their
// (already allocated) stack address.
« no previous file with comments | « src/x64/virtual-frame-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698