OLD | NEW |
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // Operand is lea(scratch, Operand(kRootRegister, delta)); | 148 // Operand is lea(scratch, Operand(kRootRegister, delta)); |
149 // Opcodes : REX.W 8D ModRM Disp8/Disp32 - 4 or 7. | 149 // Opcodes : REX.W 8D ModRM Disp8/Disp32 - 4 or 7. |
150 int size = 4; | 150 int size = 4; |
151 if (!is_int8(static_cast<int32_t>(delta))) { | 151 if (!is_int8(static_cast<int32_t>(delta))) { |
152 size += 3; // Need full four-byte displacement in lea. | 152 size += 3; // Need full four-byte displacement in lea. |
153 } | 153 } |
154 return size; | 154 return size; |
155 } | 155 } |
156 } | 156 } |
157 // Size of movq(destination, src); | 157 // Size of movq(destination, src); |
158 return 10; | 158 return Assembler::kMoveAddressIntoScratchRegisterInstructionLength; |
159 } | 159 } |
160 | 160 |
161 | 161 |
162 void MacroAssembler::PushAddress(ExternalReference source) { | 162 void MacroAssembler::PushAddress(ExternalReference source) { |
163 int64_t address = reinterpret_cast<int64_t>(source.address()); | 163 int64_t address = reinterpret_cast<int64_t>(source.address()); |
164 if (is_int32(address) && !Serializer::enabled()) { | 164 if (is_int32(address) && !Serializer::enabled()) { |
165 if (emit_debug_code()) { | 165 if (emit_debug_code()) { |
166 movq(kScratchRegister, BitCast<int64_t>(kZapValue), RelocInfo::NONE64); | 166 movq(kScratchRegister, BitCast<int64_t>(kZapValue), RelocInfo::NONE64); |
167 } | 167 } |
168 push(Immediate(static_cast<int32_t>(address))); | 168 push(Immediate(static_cast<int32_t>(address))); |
(...skipping 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 | 2503 |
2504 | 2504 |
2505 void MacroAssembler::Jump(Handle<Code> code_object, RelocInfo::Mode rmode) { | 2505 void MacroAssembler::Jump(Handle<Code> code_object, RelocInfo::Mode rmode) { |
2506 // TODO(X64): Inline this | 2506 // TODO(X64): Inline this |
2507 jmp(code_object, rmode); | 2507 jmp(code_object, rmode); |
2508 } | 2508 } |
2509 | 2509 |
2510 | 2510 |
2511 int MacroAssembler::CallSize(ExternalReference ext) { | 2511 int MacroAssembler::CallSize(ExternalReference ext) { |
2512 // Opcode for call kScratchRegister is: Rex.B FF D4 (three bytes). | 2512 // Opcode for call kScratchRegister is: Rex.B FF D4 (three bytes). |
2513 const int kCallInstructionSize = 3; | 2513 return LoadAddressSize(ext) + |
2514 return LoadAddressSize(ext) + kCallInstructionSize; | 2514 Assembler::kCallScratchRegisterInstructionLength; |
2515 } | 2515 } |
2516 | 2516 |
2517 | 2517 |
2518 void MacroAssembler::Call(ExternalReference ext) { | 2518 void MacroAssembler::Call(ExternalReference ext) { |
2519 #ifdef DEBUG | 2519 #ifdef DEBUG |
2520 int end_position = pc_offset() + CallSize(ext); | 2520 int end_position = pc_offset() + CallSize(ext); |
2521 #endif | 2521 #endif |
2522 LoadAddress(kScratchRegister, ext); | 2522 LoadAddress(kScratchRegister, ext); |
2523 call(kScratchRegister); | 2523 call(kScratchRegister); |
2524 #ifdef DEBUG | 2524 #ifdef DEBUG |
(...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4694 j(greater, &no_memento_available); | 4694 j(greater, &no_memento_available); |
4695 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), | 4695 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), |
4696 Heap::kAllocationMementoMapRootIndex); | 4696 Heap::kAllocationMementoMapRootIndex); |
4697 bind(&no_memento_available); | 4697 bind(&no_memento_available); |
4698 } | 4698 } |
4699 | 4699 |
4700 | 4700 |
4701 } } // namespace v8::internal | 4701 } } // namespace v8::internal |
4702 | 4702 |
4703 #endif // V8_TARGET_ARCH_X64 | 4703 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |