| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 struct Register { | 143 struct Register { |
| 144 enum Code { | 144 enum Code { |
| 145 #define REGISTER_CODE(R) kCode_##R, | 145 #define REGISTER_CODE(R) kCode_##R, |
| 146 GENERAL_REGISTERS(REGISTER_CODE) | 146 GENERAL_REGISTERS(REGISTER_CODE) |
| 147 #undef REGISTER_CODE | 147 #undef REGISTER_CODE |
| 148 kAfterLast, | 148 kAfterLast, |
| 149 kCode_no_reg = -1 | 149 kCode_no_reg = -1 |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 static const int kNumRegisters = Code::kAfterLast; | 152 static constexpr int kNumRegisters = Code::kAfterLast; |
| 153 | 153 |
| 154 #define REGISTER_COUNT(R) 1 + | 154 #define REGISTER_COUNT(R) 1 + |
| 155 static const int kNumAllocatable = | 155 static constexpr int kNumAllocatable = |
| 156 ALLOCATABLE_GENERAL_REGISTERS(REGISTER_COUNT)0; | 156 ALLOCATABLE_GENERAL_REGISTERS(REGISTER_COUNT) 0; |
| 157 #undef REGISTER_COUNT | 157 #undef REGISTER_COUNT |
| 158 | 158 |
| 159 #define REGISTER_BIT(R) 1 << kCode_##R | | 159 #define REGISTER_BIT(R) 1 << kCode_##R | |
| 160 static const RegList kAllocatable = | 160 static constexpr RegList kAllocatable = |
| 161 ALLOCATABLE_GENERAL_REGISTERS(REGISTER_BIT)0; | 161 ALLOCATABLE_GENERAL_REGISTERS(REGISTER_BIT) 0; |
| 162 #undef REGISTER_BIT | 162 #undef REGISTER_BIT |
| 163 | 163 |
| 164 static Register from_code(int code) { | 164 static Register from_code(int code) { |
| 165 DCHECK(code >= 0); | 165 DCHECK(code >= 0); |
| 166 DCHECK(code < kNumRegisters); | 166 DCHECK(code < kNumRegisters); |
| 167 Register r = {code}; | 167 Register r = {code}; |
| 168 return r; | 168 return r; |
| 169 } | 169 } |
| 170 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 170 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 171 bool is(Register reg) const { return reg_code == reg.reg_code; } | 171 bool is(Register reg) const { return reg_code == reg.reg_code; } |
| 172 int code() const { | 172 int code() const { |
| 173 DCHECK(is_valid()); | 173 DCHECK(is_valid()); |
| 174 return reg_code; | 174 return reg_code; |
| 175 } | 175 } |
| 176 int bit() const { | 176 int bit() const { |
| 177 DCHECK(is_valid()); | 177 DCHECK(is_valid()); |
| 178 return 1 << reg_code; | 178 return 1 << reg_code; |
| 179 } | 179 } |
| 180 void set_code(int code) { | 180 void set_code(int code) { |
| 181 reg_code = code; | 181 reg_code = code; |
| 182 DCHECK(is_valid()); | 182 DCHECK(is_valid()); |
| 183 } | 183 } |
| 184 | 184 |
| 185 #if V8_TARGET_LITTLE_ENDIAN | 185 #if V8_TARGET_LITTLE_ENDIAN |
| 186 static const int kMantissaOffset = 0; | 186 static constexpr int kMantissaOffset = 0; |
| 187 static const int kExponentOffset = 4; | 187 static constexpr int kExponentOffset = 4; |
| 188 #else | 188 #else |
| 189 static const int kMantissaOffset = 4; | 189 static constexpr int kMantissaOffset = 4; |
| 190 static const int kExponentOffset = 0; | 190 static constexpr int kExponentOffset = 0; |
| 191 #endif | 191 #endif |
| 192 | 192 |
| 193 // Unfortunately we can't make this private in a struct. | 193 // Unfortunately we can't make this private in a struct. |
| 194 int reg_code; | 194 int reg_code; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 #define DECLARE_REGISTER(R) const Register R = {Register::kCode_##R}; | 197 #define DEFINE_REGISTER(R) constexpr Register R = {Register::kCode_##R}; |
| 198 GENERAL_REGISTERS(DECLARE_REGISTER) | 198 GENERAL_REGISTERS(DEFINE_REGISTER) |
| 199 #undef DECLARE_REGISTER | 199 #undef DEFINE_REGISTER |
| 200 const Register no_reg = {Register::kCode_no_reg}; | 200 constexpr Register no_reg = {Register::kCode_no_reg}; |
| 201 | 201 |
| 202 // Aliases | 202 // Aliases |
| 203 const Register kLithiumScratch = r11; // lithium scratch. | 203 constexpr Register kLithiumScratch = r11; // lithium scratch. |
| 204 const Register kConstantPoolRegister = r28; // Constant pool. | 204 constexpr Register kConstantPoolRegister = r28; // Constant pool. |
| 205 const Register kRootRegister = r29; // Roots array pointer. | 205 constexpr Register kRootRegister = r29; // Roots array pointer. |
| 206 const Register cp = r30; // JavaScript context pointer. | 206 constexpr Register cp = r30; // JavaScript context pointer. |
| 207 | 207 |
| 208 static const bool kSimpleFPAliasing = true; | 208 constexpr bool kSimpleFPAliasing = true; |
| 209 static const bool kSimdMaskRegisters = false; | 209 constexpr bool kSimdMaskRegisters = false; |
| 210 | 210 |
| 211 // Double word FP register. | 211 // Double word FP register. |
| 212 struct DoubleRegister { | 212 struct DoubleRegister { |
| 213 enum Code { | 213 enum Code { |
| 214 #define REGISTER_CODE(R) kCode_##R, | 214 #define REGISTER_CODE(R) kCode_##R, |
| 215 DOUBLE_REGISTERS(REGISTER_CODE) | 215 DOUBLE_REGISTERS(REGISTER_CODE) |
| 216 #undef REGISTER_CODE | 216 #undef REGISTER_CODE |
| 217 kAfterLast, | 217 kAfterLast, |
| 218 kCode_no_reg = -1 | 218 kCode_no_reg = -1 |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 static const int kNumRegisters = Code::kAfterLast; | 221 static constexpr int kNumRegisters = Code::kAfterLast; |
| 222 static const int kMaxNumRegisters = kNumRegisters; | 222 static constexpr int kMaxNumRegisters = kNumRegisters; |
| 223 | 223 |
| 224 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } | 224 bool is_valid() const { return 0 <= reg_code && reg_code < kNumRegisters; } |
| 225 bool is(DoubleRegister reg) const { return reg_code == reg.reg_code; } | 225 bool is(DoubleRegister reg) const { return reg_code == reg.reg_code; } |
| 226 int code() const { | 226 int code() const { |
| 227 DCHECK(is_valid()); | 227 DCHECK(is_valid()); |
| 228 return reg_code; | 228 return reg_code; |
| 229 } | 229 } |
| 230 int bit() const { | 230 int bit() const { |
| 231 DCHECK(is_valid()); | 231 DCHECK(is_valid()); |
| 232 return 1 << reg_code; | 232 return 1 << reg_code; |
| 233 } | 233 } |
| 234 | 234 |
| 235 static DoubleRegister from_code(int code) { | 235 static DoubleRegister from_code(int code) { |
| 236 DoubleRegister r = {code}; | 236 DoubleRegister r = {code}; |
| 237 return r; | 237 return r; |
| 238 } | 238 } |
| 239 | 239 |
| 240 int reg_code; | 240 int reg_code; |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 typedef DoubleRegister FloatRegister; | 243 typedef DoubleRegister FloatRegister; |
| 244 | 244 |
| 245 // TODO(ppc) Define SIMD registers. | 245 // TODO(ppc) Define SIMD registers. |
| 246 typedef DoubleRegister Simd128Register; | 246 typedef DoubleRegister Simd128Register; |
| 247 | 247 |
| 248 #define DECLARE_REGISTER(R) \ | 248 #define DEFINE_REGISTER(R) \ |
| 249 const DoubleRegister R = {DoubleRegister::kCode_##R}; | 249 constexpr DoubleRegister R = {DoubleRegister::kCode_##R}; |
| 250 DOUBLE_REGISTERS(DECLARE_REGISTER) | 250 DOUBLE_REGISTERS(DEFINE_REGISTER) |
| 251 #undef DECLARE_REGISTER | 251 #undef DEFINE_REGISTER |
| 252 const Register no_dreg = {Register::kCode_no_reg}; | 252 constexpr Register no_dreg = {Register::kCode_no_reg}; |
| 253 | 253 |
| 254 // Aliases for double registers. Defined using #define instead of | 254 constexpr DoubleRegister kFirstCalleeSavedDoubleReg = d14; |
| 255 // "static const DoubleRegister&" because Clang complains otherwise when a | 255 constexpr DoubleRegister kLastCalleeSavedDoubleReg = d31; |
| 256 // compilation unit that includes this header doesn't use the variables. | 256 constexpr DoubleRegister kDoubleRegZero = d14; |
| 257 #define kFirstCalleeSavedDoubleReg d14 | 257 constexpr DoubleRegister kScratchDoubleReg = d13; |
| 258 #define kLastCalleeSavedDoubleReg d31 | |
| 259 #define kDoubleRegZero d14 | |
| 260 #define kScratchDoubleReg d13 | |
| 261 | 258 |
| 262 Register ToRegister(int num); | 259 Register ToRegister(int num); |
| 263 | 260 |
| 264 // Coprocessor register | 261 // Coprocessor register |
| 265 struct CRegister { | 262 struct CRegister { |
| 266 bool is_valid() const { return 0 <= reg_code && reg_code < 8; } | 263 bool is_valid() const { return 0 <= reg_code && reg_code < 8; } |
| 267 bool is(CRegister creg) const { return reg_code == creg.reg_code; } | 264 bool is(CRegister creg) const { return reg_code == creg.reg_code; } |
| 268 int code() const { | 265 int code() const { |
| 269 DCHECK(is_valid()); | 266 DCHECK(is_valid()); |
| 270 return reg_code; | 267 return reg_code; |
| 271 } | 268 } |
| 272 int bit() const { | 269 int bit() const { |
| 273 DCHECK(is_valid()); | 270 DCHECK(is_valid()); |
| 274 return 1 << reg_code; | 271 return 1 << reg_code; |
| 275 } | 272 } |
| 276 | 273 |
| 277 // Unfortunately we can't make this private in a struct. | 274 // Unfortunately we can't make this private in a struct. |
| 278 int reg_code; | 275 int reg_code; |
| 279 }; | 276 }; |
| 280 | 277 |
| 278 constexpr CRegister no_creg = {-1}; |
| 281 | 279 |
| 282 const CRegister no_creg = {-1}; | 280 constexpr CRegister cr0 = {0}; |
| 283 | 281 constexpr CRegister cr1 = {1}; |
| 284 const CRegister cr0 = {0}; | 282 constexpr CRegister cr2 = {2}; |
| 285 const CRegister cr1 = {1}; | 283 constexpr CRegister cr3 = {3}; |
| 286 const CRegister cr2 = {2}; | 284 constexpr CRegister cr4 = {4}; |
| 287 const CRegister cr3 = {3}; | 285 constexpr CRegister cr5 = {5}; |
| 288 const CRegister cr4 = {4}; | 286 constexpr CRegister cr6 = {6}; |
| 289 const CRegister cr5 = {5}; | 287 constexpr CRegister cr7 = {7}; |
| 290 const CRegister cr6 = {6}; | |
| 291 const CRegister cr7 = {7}; | |
| 292 | 288 |
| 293 // ----------------------------------------------------------------------------- | 289 // ----------------------------------------------------------------------------- |
| 294 // Machine instruction Operands | 290 // Machine instruction Operands |
| 295 | 291 |
| 296 #if V8_TARGET_ARCH_PPC64 | 292 #if V8_TARGET_ARCH_PPC64 |
| 297 const RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE64; | 293 constexpr RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE64; |
| 298 #else | 294 #else |
| 299 const RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE32; | 295 constexpr RelocInfo::Mode kRelocInfo_NONEPTR = RelocInfo::NONE32; |
| 300 #endif | 296 #endif |
| 301 | 297 |
| 302 // Class Operand represents a shifter operand in data processing instructions | 298 // Class Operand represents a shifter operand in data processing instructions |
| 303 class Operand BASE_EMBEDDED { | 299 class Operand BASE_EMBEDDED { |
| 304 public: | 300 public: |
| 305 // immediate | 301 // immediate |
| 306 INLINE(explicit Operand(intptr_t immediate, | 302 INLINE(explicit Operand(intptr_t immediate, |
| 307 RelocInfo::Mode rmode = kRelocInfo_NONEPTR)); | 303 RelocInfo::Mode rmode = kRelocInfo_NONEPTR)); |
| 308 INLINE(static Operand Zero()) { return Operand(static_cast<intptr_t>(0)); } | 304 INLINE(static Operand Zero()) { return Operand(static_cast<intptr_t>(0)); } |
| 309 INLINE(explicit Operand(const ExternalReference& f)); | 305 INLINE(explicit Operand(const ExternalReference& f)); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 inline static void deserialization_set_special_target_at( | 484 inline static void deserialization_set_special_target_at( |
| 489 Isolate* isolate, Address instruction_payload, Code* code, | 485 Isolate* isolate, Address instruction_payload, Code* code, |
| 490 Address target); | 486 Address target); |
| 491 | 487 |
| 492 // This sets the internal reference at the pc. | 488 // This sets the internal reference at the pc. |
| 493 inline static void deserialization_set_target_internal_reference_at( | 489 inline static void deserialization_set_target_internal_reference_at( |
| 494 Isolate* isolate, Address pc, Address target, | 490 Isolate* isolate, Address pc, Address target, |
| 495 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); | 491 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); |
| 496 | 492 |
| 497 // Size of an instruction. | 493 // Size of an instruction. |
| 498 static const int kInstrSize = sizeof(Instr); | 494 static constexpr int kInstrSize = sizeof(Instr); |
| 499 | 495 |
| 500 // Here we are patching the address in the LUI/ORI instruction pair. | 496 // Here we are patching the address in the LUI/ORI instruction pair. |
| 501 // These values are used in the serialization process and must be zero for | 497 // These values are used in the serialization process and must be zero for |
| 502 // PPC platform, as Code, Embedded Object or External-reference pointers | 498 // PPC platform, as Code, Embedded Object or External-reference pointers |
| 503 // are split across two consecutive instructions and don't exist separately | 499 // are split across two consecutive instructions and don't exist separately |
| 504 // in the code, so the serializer should not step forwards in memory after | 500 // in the code, so the serializer should not step forwards in memory after |
| 505 // a target is resolved and written. | 501 // a target is resolved and written. |
| 506 static const int kSpecialTargetSize = 0; | 502 static constexpr int kSpecialTargetSize = 0; |
| 507 | 503 |
| 508 // Number of instructions to load an address via a mov sequence. | 504 // Number of instructions to load an address via a mov sequence. |
| 509 #if V8_TARGET_ARCH_PPC64 | 505 #if V8_TARGET_ARCH_PPC64 |
| 510 static const int kMovInstructionsConstantPool = 1; | 506 static constexpr int kMovInstructionsConstantPool = 1; |
| 511 static const int kMovInstructionsNoConstantPool = 5; | 507 static constexpr int kMovInstructionsNoConstantPool = 5; |
| 512 #if defined(V8_PPC_TAGGING_OPT) | 508 #if defined(V8_PPC_TAGGING_OPT) |
| 513 static const int kTaggedLoadInstructions = 1; | 509 static constexpr int kTaggedLoadInstructions = 1; |
| 514 #else | 510 #else |
| 515 static const int kTaggedLoadInstructions = 2; | 511 static constexpr int kTaggedLoadInstructions = 2; |
| 516 #endif | 512 #endif |
| 517 #else | 513 #else |
| 518 static const int kMovInstructionsConstantPool = 1; | 514 static constexpr int kMovInstructionsConstantPool = 1; |
| 519 static const int kMovInstructionsNoConstantPool = 2; | 515 static constexpr int kMovInstructionsNoConstantPool = 2; |
| 520 static const int kTaggedLoadInstructions = 1; | 516 static constexpr int kTaggedLoadInstructions = 1; |
| 521 #endif | 517 #endif |
| 522 static const int kMovInstructions = FLAG_enable_embedded_constant_pool | 518 static constexpr int kMovInstructions = FLAG_enable_embedded_constant_pool |
| 523 ? kMovInstructionsConstantPool | 519 ? kMovInstructionsConstantPool |
| 524 : kMovInstructionsNoConstantPool; | 520 : kMovInstructionsNoConstantPool; |
| 525 | 521 |
| 526 // Distance between the instruction referring to the address of the call | 522 // Distance between the instruction referring to the address of the call |
| 527 // target and the return address. | 523 // target and the return address. |
| 528 | 524 |
| 529 // Call sequence is a FIXED_SEQUENCE: | 525 // Call sequence is a FIXED_SEQUENCE: |
| 530 // mov r8, @ call address | 526 // mov r8, @ call address |
| 531 // mtlr r8 | 527 // mtlr r8 |
| 532 // blrl | 528 // blrl |
| 533 // @ return address | 529 // @ return address |
| 534 static const int kCallTargetAddressOffset = | 530 static constexpr int kCallTargetAddressOffset = |
| 535 (kMovInstructions + 2) * kInstrSize; | 531 (kMovInstructions + 2) * kInstrSize; |
| 536 | 532 |
| 537 // Distance between start of patched debug break slot and the emitted address | 533 // Distance between start of patched debug break slot and the emitted address |
| 538 // to jump to. | 534 // to jump to. |
| 539 // Patched debug break slot code is a FIXED_SEQUENCE: | 535 // Patched debug break slot code is a FIXED_SEQUENCE: |
| 540 // mov r0, <address> | 536 // mov r0, <address> |
| 541 // mtlr r0 | 537 // mtlr r0 |
| 542 // blrl | 538 // blrl |
| 543 static const int kPatchDebugBreakSlotAddressOffset = 0 * kInstrSize; | 539 static constexpr int kPatchDebugBreakSlotAddressOffset = 0 * kInstrSize; |
| 544 | 540 |
| 545 // This is the length of the code sequence from SetDebugBreakAtSlot() | 541 // This is the length of the code sequence from SetDebugBreakAtSlot() |
| 546 // FIXED_SEQUENCE | 542 // FIXED_SEQUENCE |
| 547 static const int kDebugBreakSlotInstructions = | 543 static constexpr int kDebugBreakSlotInstructions = |
| 548 kMovInstructionsNoConstantPool + 2; | 544 kMovInstructionsNoConstantPool + 2; |
| 549 static const int kDebugBreakSlotLength = | 545 static constexpr int kDebugBreakSlotLength = |
| 550 kDebugBreakSlotInstructions * kInstrSize; | 546 kDebugBreakSlotInstructions * kInstrSize; |
| 551 | 547 |
| 552 static inline int encode_crbit(const CRegister& cr, enum CRBit crbit) { | 548 static inline int encode_crbit(const CRegister& cr, enum CRBit crbit) { |
| 553 return ((cr.code() * CRWIDTH) + crbit); | 549 return ((cr.code() * CRWIDTH) + crbit); |
| 554 } | 550 } |
| 555 | 551 |
| 556 #define DECLARE_PPC_XX3_INSTRUCTIONS(name, instr_name, instr_value) \ | 552 #define DECLARE_PPC_XX3_INSTRUCTIONS(name, instr_name, instr_value) \ |
| 557 inline void name(const DoubleRegister rt, const DoubleRegister ra, \ | 553 inline void name(const DoubleRegister rt, const DoubleRegister ra, \ |
| 558 const DoubleRegister rb) { \ | 554 const DoubleRegister rb) { \ |
| 559 xx3_form(instr_name, rt, ra, rb); \ | 555 xx3_form(instr_name, rt, ra, rb); \ |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 bool has_exception() const { return internal_trampoline_exception_; } | 1368 bool has_exception() const { return internal_trampoline_exception_; } |
| 1373 | 1369 |
| 1374 bool is_trampoline_emitted() const { return trampoline_emitted_; } | 1370 bool is_trampoline_emitted() const { return trampoline_emitted_; } |
| 1375 | 1371 |
| 1376 private: | 1372 private: |
| 1377 // Code generation | 1373 // Code generation |
| 1378 // The relocation writer's position is at least kGap bytes below the end of | 1374 // The relocation writer's position is at least kGap bytes below the end of |
| 1379 // the generated instructions. This is so that multi-instruction sequences do | 1375 // the generated instructions. This is so that multi-instruction sequences do |
| 1380 // not have to check for overflow. The same is true for writes of large | 1376 // not have to check for overflow. The same is true for writes of large |
| 1381 // relocation info entries. | 1377 // relocation info entries. |
| 1382 static const int kGap = 32; | 1378 static constexpr int kGap = 32; |
| 1383 | 1379 |
| 1384 // Repeated checking whether the trampoline pool should be emitted is rather | 1380 // Repeated checking whether the trampoline pool should be emitted is rather |
| 1385 // expensive. By default we only check again once a number of instructions | 1381 // expensive. By default we only check again once a number of instructions |
| 1386 // has been generated. | 1382 // has been generated. |
| 1387 int next_trampoline_check_; // pc offset of next buffer check. | 1383 int next_trampoline_check_; // pc offset of next buffer check. |
| 1388 | 1384 |
| 1389 // Emission of the trampoline pool may be blocked in some code sequences. | 1385 // Emission of the trampoline pool may be blocked in some code sequences. |
| 1390 int trampoline_pool_blocked_nesting_; // Block emission if this is not zero. | 1386 int trampoline_pool_blocked_nesting_; // Block emission if this is not zero. |
| 1391 int no_trampoline_pool_before_; // Block emission before this pc offset. | 1387 int no_trampoline_pool_before_; // Block emission before this pc offset. |
| 1392 | 1388 |
| 1393 // Do not share constant pool entries. | 1389 // Do not share constant pool entries. |
| 1394 int constant_pool_entry_sharing_blocked_nesting_; | 1390 int constant_pool_entry_sharing_blocked_nesting_; |
| 1395 | 1391 |
| 1396 // Relocation info generation | 1392 // Relocation info generation |
| 1397 // Each relocation is encoded as a variable size value | 1393 // Each relocation is encoded as a variable size value |
| 1398 static const int kMaxRelocSize = RelocInfoWriter::kMaxSize; | 1394 static constexpr int kMaxRelocSize = RelocInfoWriter::kMaxSize; |
| 1399 RelocInfoWriter reloc_info_writer; | 1395 RelocInfoWriter reloc_info_writer; |
| 1400 std::vector<DeferredRelocInfo> relocations_; | 1396 std::vector<DeferredRelocInfo> relocations_; |
| 1401 | 1397 |
| 1402 // The bound position, before this we cannot do instruction elimination. | 1398 // The bound position, before this we cannot do instruction elimination. |
| 1403 int last_bound_pos_; | 1399 int last_bound_pos_; |
| 1404 // Optimizable cmpi information. | 1400 // Optimizable cmpi information. |
| 1405 int optimizable_cmpi_pos_; | 1401 int optimizable_cmpi_pos_; |
| 1406 CRegister cmpi_cr_; | 1402 CRegister cmpi_cr_; |
| 1407 | 1403 |
| 1408 ConstantPoolBuilder constant_pool_builder_; | 1404 ConstantPoolBuilder constant_pool_builder_; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 }; | 1462 }; |
| 1467 | 1463 |
| 1468 int32_t get_trampoline_entry(); | 1464 int32_t get_trampoline_entry(); |
| 1469 int tracked_branch_count_; | 1465 int tracked_branch_count_; |
| 1470 // If trampoline is emitted, generated code is becoming large. As | 1466 // If trampoline is emitted, generated code is becoming large. As |
| 1471 // this is already a slow case which can possibly break our code | 1467 // this is already a slow case which can possibly break our code |
| 1472 // generation for the extreme case, we use this information to | 1468 // generation for the extreme case, we use this information to |
| 1473 // trigger different mode of branch instruction generation, where we | 1469 // trigger different mode of branch instruction generation, where we |
| 1474 // no longer use a single branch instruction. | 1470 // no longer use a single branch instruction. |
| 1475 bool trampoline_emitted_; | 1471 bool trampoline_emitted_; |
| 1476 static const int kTrampolineSlotsSize = kInstrSize; | 1472 static constexpr int kTrampolineSlotsSize = kInstrSize; |
| 1477 static const int kMaxCondBranchReach = (1 << (16 - 1)) - 1; | 1473 static constexpr int kMaxCondBranchReach = (1 << (16 - 1)) - 1; |
| 1478 static const int kMaxBlockTrampolineSectionSize = 64 * kInstrSize; | 1474 static constexpr int kMaxBlockTrampolineSectionSize = 64 * kInstrSize; |
| 1479 static const int kInvalidSlotPos = -1; | 1475 static constexpr int kInvalidSlotPos = -1; |
| 1480 | 1476 |
| 1481 Trampoline trampoline_; | 1477 Trampoline trampoline_; |
| 1482 bool internal_trampoline_exception_; | 1478 bool internal_trampoline_exception_; |
| 1483 | 1479 |
| 1484 friend class RegExpMacroAssemblerPPC; | 1480 friend class RegExpMacroAssemblerPPC; |
| 1485 friend class RelocInfo; | 1481 friend class RelocInfo; |
| 1486 friend class CodePatcher; | 1482 friend class CodePatcher; |
| 1487 friend class BlockTrampolinePoolScope; | 1483 friend class BlockTrampolinePoolScope; |
| 1488 friend class EnsureSpace; | 1484 friend class EnsureSpace; |
| 1489 }; | 1485 }; |
| 1490 | 1486 |
| 1491 | 1487 |
| 1492 class EnsureSpace BASE_EMBEDDED { | 1488 class EnsureSpace BASE_EMBEDDED { |
| 1493 public: | 1489 public: |
| 1494 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } | 1490 explicit EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); } |
| 1495 }; | 1491 }; |
| 1496 } // namespace internal | 1492 } // namespace internal |
| 1497 } // namespace v8 | 1493 } // namespace v8 |
| 1498 | 1494 |
| 1499 #endif // V8_PPC_ASSEMBLER_PPC_H_ | 1495 #endif // V8_PPC_ASSEMBLER_PPC_H_ |
| OLD | NEW |