| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 } | 184 } |
| 185 | 185 |
| 186 // Indicate that code has changed. | 186 // Indicate that code has changed. |
| 187 CPU::FlushICache(pc_, instruction_count); | 187 CPU::FlushICache(pc_, instruction_count); |
| 188 } | 188 } |
| 189 | 189 |
| 190 | 190 |
| 191 // ----------------------------------------------------------------------------- | 191 // ----------------------------------------------------------------------------- |
| 192 // Register constants. | 192 // Register constants. |
| 193 | 193 |
| 194 const int Register::registerCodeByAllocationIndex[kNumAllocatableRegisters] = { | 194 const int Register::kRegisterCodeByAllocationIndex[kNumAllocatableRegisters] = { |
| 195 // rax, rbx, rdx, rcx, rdi, r8, r9, r11, r14, r12 | 195 // rax, rbx, rdx, rcx, rdi, r8, r9, r11, r14, r12 |
| 196 0, 3, 2, 1, 7, 8, 9, 11, 14, 12 | 196 0, 3, 2, 1, 7, 8, 9, 11, 14, 12 |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 const int Register::allocationIndexByRegisterCode[kNumRegisters] = { | 199 const int Register::kAllocationIndexByRegisterCode[kNumRegisters] = { |
| 200 0, 3, 2, 1, -1, -1, -1, 4, 5, 6, -1, 7, 9, -1, 8, -1 | 200 0, 3, 2, 1, -1, -1, -1, 4, 5, 6, -1, 7, 9, -1, 8, -1 |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 | 203 |
| 204 // ----------------------------------------------------------------------------- | 204 // ----------------------------------------------------------------------------- |
| 205 // Implementation of Operand | 205 // Implementation of Operand |
| 206 | 206 |
| 207 Operand::Operand(Register base, int32_t disp) : rex_(0) { | 207 Operand::Operand(Register base, int32_t disp) : rex_(0) { |
| 208 len_ = 1; | 208 len_ = 1; |
| 209 if (base.is(rsp) || base.is(r12)) { | 209 if (base.is(rsp) || base.is(r12)) { |
| 210 // SIB byte is needed to encode (rsp + offset) or (r12 + offset). | 210 // SIB byte is needed to encode (rsp + offset) or (r12 + offset). |
| (...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2992 EnsureSpace ensure_space(this); | 2992 EnsureSpace ensure_space(this); |
| 2993 last_pc_ = pc_; | 2993 last_pc_ = pc_; |
| 2994 emit(0xF2); | 2994 emit(0xF2); |
| 2995 emit_optional_rex_32(dst, src); | 2995 emit_optional_rex_32(dst, src); |
| 2996 emit(0x0F); | 2996 emit(0x0F); |
| 2997 emit(0x5E); | 2997 emit(0x5E); |
| 2998 emit_sse_operand(dst, src); | 2998 emit_sse_operand(dst, src); |
| 2999 } | 2999 } |
| 3000 | 3000 |
| 3001 | 3001 |
| 3002 void Assembler::andpd(XMMRegister dst, XMMRegister src) { |
| 3003 EnsureSpace ensure_space(this); |
| 3004 last_pc_ = pc_; |
| 3005 emit(0x66); |
| 3006 emit_optional_rex_32(dst, src); |
| 3007 emit(0x0F); |
| 3008 emit(0x54); |
| 3009 emit_sse_operand(dst, src); |
| 3010 } |
| 3011 |
| 3012 |
| 3013 void Assembler::orpd(XMMRegister dst, XMMRegister src) { |
| 3014 EnsureSpace ensure_space(this); |
| 3015 last_pc_ = pc_; |
| 3016 emit(0x66); |
| 3017 emit_optional_rex_32(dst, src); |
| 3018 emit(0x0F); |
| 3019 emit(0x56); |
| 3020 emit_sse_operand(dst, src); |
| 3021 } |
| 3022 |
| 3023 |
| 3002 void Assembler::xorpd(XMMRegister dst, XMMRegister src) { | 3024 void Assembler::xorpd(XMMRegister dst, XMMRegister src) { |
| 3003 EnsureSpace ensure_space(this); | 3025 EnsureSpace ensure_space(this); |
| 3004 last_pc_ = pc_; | 3026 last_pc_ = pc_; |
| 3005 emit(0x66); | 3027 emit(0x66); |
| 3006 emit_optional_rex_32(dst, src); | 3028 emit_optional_rex_32(dst, src); |
| 3007 emit(0x0F); | 3029 emit(0x0F); |
| 3008 emit(0x57); | 3030 emit(0x57); |
| 3009 emit_sse_operand(dst, src); | 3031 emit_sse_operand(dst, src); |
| 3010 } | 3032 } |
| 3011 | 3033 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3111 } | 3133 } |
| 3112 | 3134 |
| 3113 | 3135 |
| 3114 void Assembler::RecordDebugBreakSlot() { | 3136 void Assembler::RecordDebugBreakSlot() { |
| 3115 positions_recorder()->WriteRecordedPositions(); | 3137 positions_recorder()->WriteRecordedPositions(); |
| 3116 EnsureSpace ensure_space(this); | 3138 EnsureSpace ensure_space(this); |
| 3117 RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT); | 3139 RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT); |
| 3118 } | 3140 } |
| 3119 | 3141 |
| 3120 | 3142 |
| 3121 void Assembler::RecordComment(const char* msg) { | 3143 void Assembler::RecordComment(const char* msg, bool force) { |
| 3122 if (FLAG_code_comments) { | 3144 if (FLAG_code_comments || force) { |
| 3123 EnsureSpace ensure_space(this); | 3145 EnsureSpace ensure_space(this); |
| 3124 RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg)); | 3146 RecordRelocInfo(RelocInfo::COMMENT, reinterpret_cast<intptr_t>(msg)); |
| 3125 } | 3147 } |
| 3126 } | 3148 } |
| 3127 | 3149 |
| 3128 | 3150 |
| 3129 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | | 3151 const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask | |
| 3130 1 << RelocInfo::INTERNAL_REFERENCE; | 3152 1 << RelocInfo::INTERNAL_REFERENCE; |
| 3131 | 3153 |
| 3132 | 3154 |
| 3133 bool RelocInfo::IsCodedSpecially() { | 3155 bool RelocInfo::IsCodedSpecially() { |
| 3134 // The deserializer needs to know whether a pointer is specially coded. Being | 3156 // The deserializer needs to know whether a pointer is specially coded. Being |
| 3135 // specially coded on x64 means that it is a relative 32 bit address, as used | 3157 // specially coded on x64 means that it is a relative 32 bit address, as used |
| 3136 // by branch instructions. | 3158 // by branch instructions. |
| 3137 return (1 << rmode_) & kApplyMask; | 3159 return (1 << rmode_) & kApplyMask; |
| 3138 } | 3160 } |
| 3139 | 3161 |
| 3140 | 3162 |
| 3141 | 3163 |
| 3142 } } // namespace v8::internal | 3164 } } // namespace v8::internal |
| 3143 | 3165 |
| 3144 #endif // V8_TARGET_ARCH_X64 | 3166 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |