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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 } | 878 } |
879 | 879 |
880 | 880 |
881 Condition MacroAssembler::CheckSmi(Register src) { | 881 Condition MacroAssembler::CheckSmi(Register src) { |
882 ASSERT_EQ(0, kSmiTag); | 882 ASSERT_EQ(0, kSmiTag); |
883 testb(src, Immediate(kSmiTagMask)); | 883 testb(src, Immediate(kSmiTagMask)); |
884 return zero; | 884 return zero; |
885 } | 885 } |
886 | 886 |
887 | 887 |
| 888 Condition MacroAssembler::CheckSmi(const Operand& src) { |
| 889 ASSERT_EQ(0, kSmiTag); |
| 890 testb(src, Immediate(kSmiTagMask)); |
| 891 return zero; |
| 892 } |
| 893 |
| 894 |
888 Condition MacroAssembler::CheckNonNegativeSmi(Register src) { | 895 Condition MacroAssembler::CheckNonNegativeSmi(Register src) { |
889 ASSERT_EQ(0, kSmiTag); | 896 ASSERT_EQ(0, kSmiTag); |
890 // Make mask 0x8000000000000001 and test that both bits are zero. | 897 // Make mask 0x8000000000000001 and test that both bits are zero. |
891 movq(kScratchRegister, src); | 898 movq(kScratchRegister, src); |
892 rol(kScratchRegister, Immediate(1)); | 899 rol(kScratchRegister, Immediate(1)); |
893 testb(kScratchRegister, Immediate(3)); | 900 testb(kScratchRegister, Immediate(3)); |
894 return zero; | 901 return zero; |
895 } | 902 } |
896 | 903 |
897 | 904 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 call(kScratchRegister); | 1386 call(kScratchRegister); |
1380 } | 1387 } |
1381 | 1388 |
1382 | 1389 |
1383 void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { | 1390 void MacroAssembler::Call(Handle<Code> code_object, RelocInfo::Mode rmode) { |
1384 ASSERT(RelocInfo::IsCodeTarget(rmode)); | 1391 ASSERT(RelocInfo::IsCodeTarget(rmode)); |
1385 call(code_object, rmode); | 1392 call(code_object, rmode); |
1386 } | 1393 } |
1387 | 1394 |
1388 | 1395 |
| 1396 void MacroAssembler::Pushad() { |
| 1397 push(rax); |
| 1398 push(rcx); |
| 1399 push(rdx); |
| 1400 push(rbx); |
| 1401 // Not pushing rsp or rbp. |
| 1402 push(rsi); |
| 1403 push(rdi); |
| 1404 push(r8); |
| 1405 push(r9); |
| 1406 // r10 is kScratchRegister. |
| 1407 push(r11); |
| 1408 push(r12); |
| 1409 // r13 is kRootRegister. |
| 1410 push(r14); |
| 1411 // r15 is kSmiConstantRegister |
| 1412 } |
| 1413 |
| 1414 |
| 1415 void MacroAssembler::Popad() { |
| 1416 pop(r14); |
| 1417 pop(r12); |
| 1418 pop(r11); |
| 1419 pop(r9); |
| 1420 pop(r8); |
| 1421 pop(rdi); |
| 1422 pop(rsi); |
| 1423 pop(rbx); |
| 1424 pop(rdx); |
| 1425 pop(rcx); |
| 1426 pop(rax); |
| 1427 } |
| 1428 |
| 1429 |
1389 void MacroAssembler::PushTryHandler(CodeLocation try_location, | 1430 void MacroAssembler::PushTryHandler(CodeLocation try_location, |
1390 HandlerType type) { | 1431 HandlerType type) { |
1391 // Adjust this code if not the case. | 1432 // Adjust this code if not the case. |
1392 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); | 1433 ASSERT(StackHandlerConstants::kSize == 4 * kPointerSize); |
1393 | 1434 |
1394 // The pc (return address) is already on TOS. This code pushes state, | 1435 // The pc (return address) is already on TOS. This code pushes state, |
1395 // frame pointer and current handler. Check that they are expected | 1436 // frame pointer and current handler. Check that they are expected |
1396 // next on the stack, in that order. | 1437 // next on the stack, in that order. |
1397 ASSERT_EQ(StackHandlerConstants::kStateOffset, | 1438 ASSERT_EQ(StackHandlerConstants::kStateOffset, |
1398 StackHandlerConstants::kPCOffset - kPointerSize); | 1439 StackHandlerConstants::kPCOffset - kPointerSize); |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2344 CPU::FlushICache(address_, size_); | 2385 CPU::FlushICache(address_, size_); |
2345 | 2386 |
2346 // Check that the code was patched as expected. | 2387 // Check that the code was patched as expected. |
2347 ASSERT(masm_.pc_ == address_ + size_); | 2388 ASSERT(masm_.pc_ == address_ + size_); |
2348 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2389 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2349 } | 2390 } |
2350 | 2391 |
2351 } } // namespace v8::internal | 2392 } } // namespace v8::internal |
2352 | 2393 |
2353 #endif // V8_TARGET_ARCH_X64 | 2394 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |