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

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

Issue 13940014: Simplify some code related to x64 calling convention. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 1549
1550 1550
1551 LInstruction* LChunkBuilder::DoPower(HPower* instr) { 1551 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1552 ASSERT(instr->representation().IsDouble()); 1552 ASSERT(instr->representation().IsDouble());
1553 // We call a C function for double power. It can't trigger a GC. 1553 // We call a C function for double power. It can't trigger a GC.
1554 // We need to use fixed result register for the call. 1554 // We need to use fixed result register for the call.
1555 Representation exponent_type = instr->right()->representation(); 1555 Representation exponent_type = instr->right()->representation();
1556 ASSERT(instr->left()->representation().IsDouble()); 1556 ASSERT(instr->left()->representation().IsDouble());
1557 LOperand* left = UseFixedDouble(instr->left(), xmm2); 1557 LOperand* left = UseFixedDouble(instr->left(), xmm2);
1558 LOperand* right = exponent_type.IsDouble() ? 1558 LOperand* right = exponent_type.IsDouble() ?
1559 UseFixedDouble(instr->right(), xmm1) : 1559 UseFixedDouble(instr->right(), xmm1) : UseFixed(instr->right(), rdx);
1560 #ifdef _WIN64
1561 UseFixed(instr->right(), rdx);
1562 #else
1563 UseFixed(instr->right(), rdi);
1564 #endif
1565 LPower* result = new(zone()) LPower(left, right); 1560 LPower* result = new(zone()) LPower(left, right);
1566 return MarkAsCall(DefineFixedDouble(result, xmm3), instr, 1561 return MarkAsCall(DefineFixedDouble(result, xmm3), instr,
1567 CAN_DEOPTIMIZE_EAGERLY); 1562 CAN_DEOPTIMIZE_EAGERLY);
1568 } 1563 }
1569 1564
1570 1565
1571 LInstruction* LChunkBuilder::DoRandom(HRandom* instr) { 1566 LInstruction* LChunkBuilder::DoRandom(HRandom* instr) {
1572 ASSERT(instr->representation().IsDouble()); 1567 ASSERT(instr->representation().IsDouble());
1573 ASSERT(instr->global_object()->representation().IsTagged()); 1568 ASSERT(instr->global_object()->representation().IsTagged());
1574 #ifdef _WIN64 1569 LOperand* global_object = UseFixed(instr->global_object(), arg_reg_1);
1575 LOperand* global_object = UseFixed(instr->global_object(), rcx);
1576 #else
1577 LOperand* global_object = UseFixed(instr->global_object(), rdi);
1578 #endif
1579 LRandom* result = new(zone()) LRandom(global_object); 1570 LRandom* result = new(zone()) LRandom(global_object);
1580 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 1571 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1581 } 1572 }
1582 1573
1583 1574
1584 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { 1575 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1585 ASSERT(instr->left()->representation().IsTagged()); 1576 ASSERT(instr->left()->representation().IsTagged());
1586 ASSERT(instr->right()->representation().IsTagged()); 1577 ASSERT(instr->right()->representation().IsTagged());
1587 LOperand* left = UseFixed(instr->left(), rdx); 1578 LOperand* left = UseFixed(instr->left(), rdx);
1588 LOperand* right = UseFixed(instr->right(), rax); 1579 LOperand* right = UseFixed(instr->right(), rax);
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
2570 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2561 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2571 LOperand* object = UseRegister(instr->object()); 2562 LOperand* object = UseRegister(instr->object());
2572 LOperand* index = UseTempRegister(instr->index()); 2563 LOperand* index = UseTempRegister(instr->index());
2573 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2564 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2574 } 2565 }
2575 2566
2576 2567
2577 } } // namespace v8::internal 2568 } } // namespace v8::internal
2578 2569
2579 #endif // V8_TARGET_ARCH_X64 2570 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698