| OLD | NEW |
| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag; | 281 intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag; |
| 282 // Note: p0 might not be a valid Smi *value*, but it has a valid Smi tag. | 282 // Note: p0 might not be a valid Smi *value*, but it has a valid Smi tag. |
| 283 ASSERT(reinterpret_cast<Object*>(p0)->IsSmi()); | 283 ASSERT(reinterpret_cast<Object*>(p0)->IsSmi()); |
| 284 #ifdef DEBUG | 284 #ifdef DEBUG |
| 285 if (msg != NULL) { | 285 if (msg != NULL) { |
| 286 RecordComment("Abort message: "); | 286 RecordComment("Abort message: "); |
| 287 RecordComment(msg); | 287 RecordComment(msg); |
| 288 } | 288 } |
| 289 #endif | 289 #endif |
| 290 // Disable stub call restrictions to always allow calls to abort. | 290 // Disable stub call restrictions to always allow calls to abort. |
| 291 set_allow_stub_calls(true); | 291 AllowStubCallsScope allow_scope(this, true); |
| 292 | 292 |
| 293 push(rax); | 293 push(rax); |
| 294 movq(kScratchRegister, p0, RelocInfo::NONE); | 294 movq(kScratchRegister, p0, RelocInfo::NONE); |
| 295 push(kScratchRegister); | 295 push(kScratchRegister); |
| 296 movq(kScratchRegister, | 296 movq(kScratchRegister, |
| 297 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(p1 - p0))), | 297 reinterpret_cast<intptr_t>(Smi::FromInt(static_cast<int>(p1 - p0))), |
| 298 RelocInfo::NONE); | 298 RelocInfo::NONE); |
| 299 push(kScratchRegister); | 299 push(kScratchRegister); |
| 300 CallRuntime(Runtime::kAbort, 2); | 300 CallRuntime(Runtime::kAbort, 2); |
| 301 // will not return here | 301 // will not return here |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 ASSERT(!dst.is(src2)); | 1109 ASSERT(!dst.is(src2)); |
| 1110 if (!dst.is(src1)) { | 1110 if (!dst.is(src1)) { |
| 1111 movq(dst, src1); | 1111 movq(dst, src1); |
| 1112 } | 1112 } |
| 1113 and_(dst, src2); | 1113 and_(dst, src2); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 | 1116 |
| 1117 void MacroAssembler::SmiAndConstant(Register dst, Register src, Smi* constant) { | 1117 void MacroAssembler::SmiAndConstant(Register dst, Register src, Smi* constant) { |
| 1118 if (constant->value() == 0) { | 1118 if (constant->value() == 0) { |
| 1119 xor_(dst, dst); | 1119 Set(dst, 0); |
| 1120 } else if (dst.is(src)) { | 1120 } else if (dst.is(src)) { |
| 1121 ASSERT(!dst.is(kScratchRegister)); | 1121 ASSERT(!dst.is(kScratchRegister)); |
| 1122 Register constant_reg = GetSmiConstant(constant); | 1122 Register constant_reg = GetSmiConstant(constant); |
| 1123 and_(dst, constant_reg); | 1123 and_(dst, constant_reg); |
| 1124 } else { | 1124 } else { |
| 1125 LoadSmiConstant(dst, constant); | 1125 LoadSmiConstant(dst, constant); |
| 1126 and_(dst, src); | 1126 and_(dst, src); |
| 1127 } | 1127 } |
| 1128 } | 1128 } |
| 1129 | 1129 |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 } else { | 1604 } else { |
| 1605 subl(operand, Immediate(value)); | 1605 subl(operand, Immediate(value)); |
| 1606 } | 1606 } |
| 1607 } | 1607 } |
| 1608 } | 1608 } |
| 1609 | 1609 |
| 1610 | 1610 |
| 1611 #ifdef ENABLE_DEBUGGER_SUPPORT | 1611 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 1612 void MacroAssembler::DebugBreak() { | 1612 void MacroAssembler::DebugBreak() { |
| 1613 ASSERT(allow_stub_calls()); | 1613 ASSERT(allow_stub_calls()); |
| 1614 xor_(rax, rax); // no arguments | 1614 Set(rax, 0); // No arguments. |
| 1615 movq(rbx, ExternalReference(Runtime::kDebugBreak)); | 1615 movq(rbx, ExternalReference(Runtime::kDebugBreak)); |
| 1616 CEntryStub ces(1); | 1616 CEntryStub ces(1); |
| 1617 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); | 1617 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); |
| 1618 } | 1618 } |
| 1619 #endif // ENABLE_DEBUGGER_SUPPORT | 1619 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1620 | 1620 |
| 1621 | 1621 |
| 1622 void MacroAssembler::InvokeCode(Register code, | 1622 void MacroAssembler::InvokeCode(Register code, |
| 1623 const ParameterCount& expected, | 1623 const ParameterCount& expected, |
| 1624 const ParameterCount& actual, | 1624 const ParameterCount& actual, |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2381 CPU::FlushICache(address_, size_); | 2381 CPU::FlushICache(address_, size_); |
| 2382 | 2382 |
| 2383 // Check that the code was patched as expected. | 2383 // Check that the code was patched as expected. |
| 2384 ASSERT(masm_.pc_ == address_ + size_); | 2384 ASSERT(masm_.pc_ == address_ + size_); |
| 2385 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2385 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2386 } | 2386 } |
| 2387 | 2387 |
| 2388 } } // namespace v8::internal | 2388 } } // namespace v8::internal |
| 2389 | 2389 |
| 2390 #endif // V8_TARGET_ARCH_X64 | 2390 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |