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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ASSERT(index < length_); | 62 ASSERT(index < length_); |
63 unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index)); | 63 unsigned value = Memory::uint32_at(GetDeoptimizationLocation(index)); |
64 return GapCodeSizeField::decode(value); | 64 return GapCodeSizeField::decode(value); |
65 } | 65 } |
66 | 66 |
67 uint8_t* GetEntry(unsigned index) const { | 67 uint8_t* GetEntry(unsigned index) const { |
68 ASSERT(index < length_); | 68 ASSERT(index < length_); |
69 return &Memory::uint8_at(entries_ + (index * entry_size_)); | 69 return &Memory::uint8_at(entries_ + (index * entry_size_)); |
70 } | 70 } |
71 | 71 |
72 class GapCodeSizeField: public BitField<unsigned, 0, 8> {}; | 72 // Reserve 13 bits for the gap code size. On ARM a constant pool can be |
73 class DeoptimizationIndexField: public BitField<int, 8, 24> {}; | 73 // emitted when generating the gap code. The size of the const pool is less |
| 74 // than what can be represented in 12 bits, so 13 bits gives room for having |
| 75 // instructions before potentially emitting a constant pool. |
| 76 static const int kGapCodeSizeBits = 13; |
| 77 static const int kDeoptIndexBits = 32 - kGapCodeSizeBits; |
| 78 class GapCodeSizeField: public BitField<unsigned, 0, kGapCodeSizeBits> {}; |
| 79 class DeoptimizationIndexField: |
| 80 public BitField<int, kGapCodeSizeBits, kDeoptIndexBits> {}; |
74 | 81 |
75 static bool HasRegisters(uint8_t* entry); | 82 static bool HasRegisters(uint8_t* entry); |
76 static bool HasRegisterAt(uint8_t* entry, int reg_index); | 83 static bool HasRegisterAt(uint8_t* entry, int reg_index); |
77 | 84 |
78 void PrintEntry(unsigned index) const; | 85 void PrintEntry(unsigned index) const; |
79 | 86 |
80 private: | 87 private: |
81 static const uint8_t kNoRegisters = 0xFF; | 88 static const uint8_t kNoRegisters = 0xFF; |
82 | 89 |
83 static const int kLengthOffset = 0; | 90 static const int kLengthOffset = 0; |
(...skipping 23 matching lines...) Expand all Loading... |
107 | 114 |
108 Address pc_and_deoptimization_indexes_; | 115 Address pc_and_deoptimization_indexes_; |
109 Address entries_; | 116 Address entries_; |
110 | 117 |
111 friend class SafepointTableBuilder; | 118 friend class SafepointTableBuilder; |
112 }; | 119 }; |
113 | 120 |
114 | 121 |
115 class Safepoint BASE_EMBEDDED { | 122 class Safepoint BASE_EMBEDDED { |
116 public: | 123 public: |
117 static const int kNoDeoptimizationIndex = 0x00ffffff; | 124 static const int kNoDeoptimizationIndex = |
| 125 (1 << (SafepointTable::kDeoptIndexBits)) - 1; |
118 | 126 |
119 void DefinePointerSlot(int index) { indexes_->Add(index); } | 127 void DefinePointerSlot(int index) { indexes_->Add(index); } |
120 void DefinePointerRegister(Register reg) { registers_->Add(reg.code()); } | 128 void DefinePointerRegister(Register reg) { registers_->Add(reg.code()); } |
121 | 129 |
122 private: | 130 private: |
123 Safepoint(ZoneList<int>* indexes, ZoneList<int>* registers) : | 131 Safepoint(ZoneList<int>* indexes, ZoneList<int>* registers) : |
124 indexes_(indexes), registers_(registers) { } | 132 indexes_(indexes), registers_(registers) { } |
125 ZoneList<int>* indexes_; | 133 ZoneList<int>* indexes_; |
126 ZoneList<int>* registers_; | 134 ZoneList<int>* registers_; |
127 | 135 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 188 |
181 bool emitted_; | 189 bool emitted_; |
182 unsigned offset_; | 190 unsigned offset_; |
183 | 191 |
184 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); | 192 DISALLOW_COPY_AND_ASSIGN(SafepointTableBuilder); |
185 }; | 193 }; |
186 | 194 |
187 } } // namespace v8::internal | 195 } } // namespace v8::internal |
188 | 196 |
189 #endif // V8_SAFEPOINT_TABLE_H_ | 197 #endif // V8_SAFEPOINT_TABLE_H_ |
OLD | NEW |