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

Side by Side Diff: src/x64/lithium-codegen-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 __ movq(kScratchRegister, stamp_operand); 1637 __ movq(kScratchRegister, stamp_operand);
1638 __ cmpq(kScratchRegister, FieldOperand(object, 1638 __ cmpq(kScratchRegister, FieldOperand(object,
1639 JSDate::kCacheStampOffset)); 1639 JSDate::kCacheStampOffset));
1640 __ j(not_equal, &runtime, Label::kNear); 1640 __ j(not_equal, &runtime, Label::kNear);
1641 __ movq(result, FieldOperand(object, JSDate::kValueOffset + 1641 __ movq(result, FieldOperand(object, JSDate::kValueOffset +
1642 kPointerSize * index->value())); 1642 kPointerSize * index->value()));
1643 __ jmp(&done); 1643 __ jmp(&done);
1644 } 1644 }
1645 __ bind(&runtime); 1645 __ bind(&runtime);
1646 __ PrepareCallCFunction(2); 1646 __ PrepareCallCFunction(2);
1647 #ifdef _WIN64 1647 __ movq(arg_reg_1, object);
1648 __ movq(rcx, object); 1648 __ movq(arg_reg_2, index, RelocInfo::NONE64);
1649 __ movq(rdx, index, RelocInfo::NONE64);
1650 #else
1651 __ movq(rdi, object);
1652 __ movq(rsi, index, RelocInfo::NONE64);
1653 #endif
1654 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); 1649 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
1655 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 1650 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
1656 __ bind(&done); 1651 __ bind(&done);
1657 } 1652 }
1658 } 1653 }
1659 1654
1660 1655
1661 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { 1656 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
1662 SeqStringSetCharGenerator::Generate(masm(), 1657 SeqStringSetCharGenerator::Generate(masm(),
1663 instr->encoding(), 1658 instr->encoding(),
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after
3639 __ sqrtsd(input_reg, input_reg); 3634 __ sqrtsd(input_reg, input_reg);
3640 __ bind(&done); 3635 __ bind(&done);
3641 } 3636 }
3642 3637
3643 3638
3644 void LCodeGen::DoPower(LPower* instr) { 3639 void LCodeGen::DoPower(LPower* instr) {
3645 Representation exponent_type = instr->hydrogen()->right()->representation(); 3640 Representation exponent_type = instr->hydrogen()->right()->representation();
3646 // Having marked this as a call, we can use any registers. 3641 // Having marked this as a call, we can use any registers.
3647 // Just make sure that the input/output registers are the expected ones. 3642 // Just make sure that the input/output registers are the expected ones.
3648 3643
3649 // Choose register conforming to calling convention (when bailing out).
3650 #ifdef _WIN64
3651 Register exponent = rdx; 3644 Register exponent = rdx;
3652 #else
3653 Register exponent = rdi;
3654 #endif
3655 ASSERT(!instr->right()->IsRegister() || 3645 ASSERT(!instr->right()->IsRegister() ||
3656 ToRegister(instr->right()).is(exponent)); 3646 ToRegister(instr->right()).is(exponent));
3657 ASSERT(!instr->right()->IsDoubleRegister() || 3647 ASSERT(!instr->right()->IsDoubleRegister() ||
3658 ToDoubleRegister(instr->right()).is(xmm1)); 3648 ToDoubleRegister(instr->right()).is(xmm1));
3659 ASSERT(ToDoubleRegister(instr->left()).is(xmm2)); 3649 ASSERT(ToDoubleRegister(instr->left()).is(xmm2));
3660 ASSERT(ToDoubleRegister(instr->result()).is(xmm3)); 3650 ASSERT(ToDoubleRegister(instr->result()).is(xmm3));
3661 3651
3662 if (exponent_type.IsTagged()) { 3652 if (exponent_type.IsTagged()) {
3663 Label no_deopt; 3653 Label no_deopt;
3664 __ JumpIfSmi(exponent, &no_deopt); 3654 __ JumpIfSmi(exponent, &no_deopt);
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
5687 FixedArray::kHeaderSize - kPointerSize)); 5677 FixedArray::kHeaderSize - kPointerSize));
5688 __ bind(&done); 5678 __ bind(&done);
5689 } 5679 }
5690 5680
5691 5681
5692 #undef __ 5682 #undef __
5693 5683
5694 } } // namespace v8::internal 5684 } } // namespace v8::internal
5695 5685
5696 #endif // V8_TARGET_ARCH_X64 5686 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698