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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 6015011: Use the macro assembler Set instead of explicit xor for clearing registers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/regexp-macro-assembler-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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 ASSERT(!dst.is(src2)); 1103 ASSERT(!dst.is(src2));
1104 if (!dst.is(src1)) { 1104 if (!dst.is(src1)) {
1105 movq(dst, src1); 1105 movq(dst, src1);
1106 } 1106 }
1107 and_(dst, src2); 1107 and_(dst, src2);
1108 } 1108 }
1109 1109
1110 1110
1111 void MacroAssembler::SmiAndConstant(Register dst, Register src, Smi* constant) { 1111 void MacroAssembler::SmiAndConstant(Register dst, Register src, Smi* constant) {
1112 if (constant->value() == 0) { 1112 if (constant->value() == 0) {
1113 xor_(dst, dst); 1113 Set(dst, 0);
1114 } else if (dst.is(src)) { 1114 } else if (dst.is(src)) {
1115 ASSERT(!dst.is(kScratchRegister)); 1115 ASSERT(!dst.is(kScratchRegister));
1116 Register constant_reg = GetSmiConstant(constant); 1116 Register constant_reg = GetSmiConstant(constant);
1117 and_(dst, constant_reg); 1117 and_(dst, constant_reg);
1118 } else { 1118 } else {
1119 LoadSmiConstant(dst, constant); 1119 LoadSmiConstant(dst, constant);
1120 and_(dst, src); 1120 and_(dst, src);
1121 } 1121 }
1122 } 1122 }
1123 1123
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 } else { 1598 } else {
1599 subl(operand, Immediate(value)); 1599 subl(operand, Immediate(value));
1600 } 1600 }
1601 } 1601 }
1602 } 1602 }
1603 1603
1604 1604
1605 #ifdef ENABLE_DEBUGGER_SUPPORT 1605 #ifdef ENABLE_DEBUGGER_SUPPORT
1606 void MacroAssembler::DebugBreak() { 1606 void MacroAssembler::DebugBreak() {
1607 ASSERT(allow_stub_calls()); 1607 ASSERT(allow_stub_calls());
1608 xor_(rax, rax); // no arguments 1608 Set(rax, 0); // No arguments.
1609 movq(rbx, ExternalReference(Runtime::kDebugBreak)); 1609 movq(rbx, ExternalReference(Runtime::kDebugBreak));
1610 CEntryStub ces(1); 1610 CEntryStub ces(1);
1611 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); 1611 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
1612 } 1612 }
1613 #endif // ENABLE_DEBUGGER_SUPPORT 1613 #endif // ENABLE_DEBUGGER_SUPPORT
1614 1614
1615 1615
1616 void MacroAssembler::InvokeCode(Register code, 1616 void MacroAssembler::InvokeCode(Register code,
1617 const ParameterCount& expected, 1617 const ParameterCount& expected,
1618 const ParameterCount& actual, 1618 const ParameterCount& actual,
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
2346 CPU::FlushICache(address_, size_); 2346 CPU::FlushICache(address_, size_);
2347 2347
2348 // Check that the code was patched as expected. 2348 // Check that the code was patched as expected.
2349 ASSERT(masm_.pc_ == address_ + size_); 2349 ASSERT(masm_.pc_ == address_ + size_);
2350 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2350 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2351 } 2351 }
2352 2352
2353 } } // namespace v8::internal 2353 } } // namespace v8::internal
2354 2354
2355 #endif // V8_TARGET_ARCH_X64 2355 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/regexp-macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698