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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 // Record a comment relocation entry that can be used by a disassembler. | 1116 // Record a comment relocation entry that can be used by a disassembler. |
1117 // Use --code-comments to enable. | 1117 // Use --code-comments to enable. |
1118 void RecordComment(const char* msg, bool force = false); | 1118 void RecordComment(const char* msg, bool force = false); |
1119 | 1119 |
1120 // Allocate a constant pool of the correct size for the generated code. | 1120 // Allocate a constant pool of the correct size for the generated code. |
1121 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); | 1121 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); |
1122 | 1122 |
1123 // Generate the constant pool for the generated code. | 1123 // Generate the constant pool for the generated code. |
1124 void PopulateConstantPool(ConstantPoolArray* constant_pool); | 1124 void PopulateConstantPool(ConstantPoolArray* constant_pool); |
1125 | 1125 |
| 1126 bool is_constant_pool_available() const { return false; } |
| 1127 |
1126 // Writes a single word of data in the code stream. | 1128 // Writes a single word of data in the code stream. |
1127 // Used for inline tables, e.g., jump-tables. | 1129 // Used for inline tables, e.g., jump-tables. |
1128 void db(uint8_t data); | 1130 void db(uint8_t data); |
1129 void dd(uint32_t data); | 1131 void dd(uint32_t data); |
1130 | 1132 |
1131 PositionsRecorder* positions_recorder() { return &positions_recorder_; } | 1133 PositionsRecorder* positions_recorder() { return &positions_recorder_; } |
1132 | 1134 |
1133 // Check if there is less than kGap bytes available in the buffer. | 1135 // Check if there is less than kGap bytes available in the buffer. |
1134 // If this is the case, we need to grow the buffer before emitting | 1136 // If this is the case, we need to grow the buffer before emitting |
1135 // an instruction or relocation information. | 1137 // an instruction or relocation information. |
(...skipping 14 matching lines...) Expand all Loading... |
1150 byte byte_at(int pos) { return buffer_[pos]; } | 1152 byte byte_at(int pos) { return buffer_[pos]; } |
1151 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } | 1153 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } |
1152 | 1154 |
1153 protected: | 1155 protected: |
1154 // Call near indirect | 1156 // Call near indirect |
1155 void call(const Operand& operand); | 1157 void call(const Operand& operand); |
1156 | 1158 |
1157 // Jump near absolute indirect (m64) | 1159 // Jump near absolute indirect (m64) |
1158 void jmp(const Operand& src); | 1160 void jmp(const Operand& src); |
1159 | 1161 |
| 1162 void set_constant_pool_available(bool available) { |
| 1163 // Constant pool is not supported on x64. |
| 1164 UNREACHABLE(); |
| 1165 } |
| 1166 |
1160 private: | 1167 private: |
1161 byte* addr_at(int pos) { return buffer_ + pos; } | 1168 byte* addr_at(int pos) { return buffer_ + pos; } |
1162 uint32_t long_at(int pos) { | 1169 uint32_t long_at(int pos) { |
1163 return *reinterpret_cast<uint32_t*>(addr_at(pos)); | 1170 return *reinterpret_cast<uint32_t*>(addr_at(pos)); |
1164 } | 1171 } |
1165 void long_at_put(int pos, uint32_t x) { | 1172 void long_at_put(int pos, uint32_t x) { |
1166 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 1173 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
1167 } | 1174 } |
1168 | 1175 |
1169 // code emission | 1176 // code emission |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 friend class EnsureSpace; | 1571 friend class EnsureSpace; |
1565 friend class RegExpMacroAssemblerX64; | 1572 friend class RegExpMacroAssemblerX64; |
1566 | 1573 |
1567 // code generation | 1574 // code generation |
1568 RelocInfoWriter reloc_info_writer; | 1575 RelocInfoWriter reloc_info_writer; |
1569 | 1576 |
1570 List< Handle<Code> > code_targets_; | 1577 List< Handle<Code> > code_targets_; |
1571 | 1578 |
1572 PositionsRecorder positions_recorder_; | 1579 PositionsRecorder positions_recorder_; |
1573 friend class PositionsRecorder; | 1580 friend class PositionsRecorder; |
| 1581 |
| 1582 // constant pool |
| 1583 friend class FrameAndConstantPoolScope; |
| 1584 friend class ConstantPoolUnavailableScope; |
1574 }; | 1585 }; |
1575 | 1586 |
1576 | 1587 |
1577 // Helper class that ensures that there is enough space for generating | 1588 // Helper class that ensures that there is enough space for generating |
1578 // instructions and relocation information. The constructor makes | 1589 // instructions and relocation information. The constructor makes |
1579 // sure that there is enough space and (in debug mode) the destructor | 1590 // sure that there is enough space and (in debug mode) the destructor |
1580 // checks that we did not generate too much. | 1591 // checks that we did not generate too much. |
1581 class EnsureSpace BASE_EMBEDDED { | 1592 class EnsureSpace BASE_EMBEDDED { |
1582 public: | 1593 public: |
1583 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { | 1594 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { |
(...skipping 13 matching lines...) Expand all Loading... |
1597 private: | 1608 private: |
1598 Assembler* assembler_; | 1609 Assembler* assembler_; |
1599 #ifdef DEBUG | 1610 #ifdef DEBUG |
1600 int space_before_; | 1611 int space_before_; |
1601 #endif | 1612 #endif |
1602 }; | 1613 }; |
1603 | 1614 |
1604 } } // namespace v8::internal | 1615 } } // namespace v8::internal |
1605 | 1616 |
1606 #endif // V8_X64_ASSEMBLER_X64_H_ | 1617 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |