| 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 // buffer, and buffer_size determines the initial buffer size. The buffer is | 531 // buffer, and buffer_size determines the initial buffer size. The buffer is |
| 532 // owned by the assembler and deallocated upon destruction of the assembler. | 532 // owned by the assembler and deallocated upon destruction of the assembler. |
| 533 // | 533 // |
| 534 // If the provided buffer is not NULL, the assembler uses the provided buffer | 534 // If the provided buffer is not NULL, the assembler uses the provided buffer |
| 535 // for code generation and assumes its size to be buffer_size. If the buffer | 535 // for code generation and assumes its size to be buffer_size. If the buffer |
| 536 // is too small, a fatal error occurs. No deallocation of the buffer is done | 536 // is too small, a fatal error occurs. No deallocation of the buffer is done |
| 537 // upon destruction of the assembler. | 537 // upon destruction of the assembler. |
| 538 Assembler(void* buffer, int buffer_size); | 538 Assembler(void* buffer, int buffer_size); |
| 539 ~Assembler(); | 539 ~Assembler(); |
| 540 | 540 |
| 541 // Access the isolate with which the assembler is associated. |
| 542 Isolate* isolate() { return isolate_; } |
| 543 |
| 541 // Overrides the default provided by FLAG_debug_code. | 544 // Overrides the default provided by FLAG_debug_code. |
| 542 void set_emit_debug_code(bool value) { emit_debug_code_ = value; } | 545 void set_emit_debug_code(bool value) { emit_debug_code_ = value; } |
| 543 | 546 |
| 544 // GetCode emits any pending (non-emitted) code and fills the descriptor | 547 // GetCode emits any pending (non-emitted) code and fills the descriptor |
| 545 // desc. GetCode() is idempotent; it returns the same result if no other | 548 // desc. GetCode() is idempotent; it returns the same result if no other |
| 546 // Assembler functions are invoked in between GetCode() calls. | 549 // Assembler functions are invoked in between GetCode() calls. |
| 547 void GetCode(CodeDesc* desc); | 550 void GetCode(CodeDesc* desc); |
| 548 | 551 |
| 549 // Read/Modify the code target in the branch/call instruction at pc. | 552 // Read/Modify the code target in the branch/call instruction at pc. |
| 550 inline static Address target_address_at(Address pc); | 553 inline static Address target_address_at(Address pc); |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 protected: | 1006 protected: |
| 1004 bool emit_debug_code() const { return emit_debug_code_; } | 1007 bool emit_debug_code() const { return emit_debug_code_; } |
| 1005 | 1008 |
| 1006 void movsd(XMMRegister dst, const Operand& src); | 1009 void movsd(XMMRegister dst, const Operand& src); |
| 1007 void movsd(const Operand& dst, XMMRegister src); | 1010 void movsd(const Operand& dst, XMMRegister src); |
| 1008 | 1011 |
| 1009 void emit_sse_operand(XMMRegister reg, const Operand& adr); | 1012 void emit_sse_operand(XMMRegister reg, const Operand& adr); |
| 1010 void emit_sse_operand(XMMRegister dst, XMMRegister src); | 1013 void emit_sse_operand(XMMRegister dst, XMMRegister src); |
| 1011 void emit_sse_operand(Register dst, XMMRegister src); | 1014 void emit_sse_operand(Register dst, XMMRegister src); |
| 1012 | 1015 |
| 1013 byte* addr_at(int pos) { return buffer_ + pos; } | 1016 byte* addr_at(int pos) { return buffer_ + pos; } |
| 1017 |
| 1014 private: | 1018 private: |
| 1015 byte byte_at(int pos) { return buffer_[pos]; } | 1019 byte byte_at(int pos) { return buffer_[pos]; } |
| 1016 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } | 1020 void set_byte_at(int pos, byte value) { buffer_[pos] = value; } |
| 1017 uint32_t long_at(int pos) { | 1021 uint32_t long_at(int pos) { |
| 1018 return *reinterpret_cast<uint32_t*>(addr_at(pos)); | 1022 return *reinterpret_cast<uint32_t*>(addr_at(pos)); |
| 1019 } | 1023 } |
| 1020 void long_at_put(int pos, uint32_t x) { | 1024 void long_at_put(int pos, uint32_t x) { |
| 1021 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 1025 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
| 1022 } | 1026 } |
| 1023 | 1027 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1053 inline Displacement disp_at(Label* L); | 1057 inline Displacement disp_at(Label* L); |
| 1054 inline void disp_at_put(Label* L, Displacement disp); | 1058 inline void disp_at_put(Label* L, Displacement disp); |
| 1055 inline void emit_disp(Label* L, Displacement::Type type); | 1059 inline void emit_disp(Label* L, Displacement::Type type); |
| 1056 | 1060 |
| 1057 // record reloc info for current pc_ | 1061 // record reloc info for current pc_ |
| 1058 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); | 1062 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); |
| 1059 | 1063 |
| 1060 friend class CodePatcher; | 1064 friend class CodePatcher; |
| 1061 friend class EnsureSpace; | 1065 friend class EnsureSpace; |
| 1062 | 1066 |
| 1067 Isolate* isolate_; |
| 1068 |
| 1063 // Code buffer: | 1069 // Code buffer: |
| 1064 // The buffer into which code and relocation info are generated. | 1070 // The buffer into which code and relocation info are generated. |
| 1065 byte* buffer_; | 1071 byte* buffer_; |
| 1066 int buffer_size_; | 1072 int buffer_size_; |
| 1067 // True if the assembler owns the buffer, false if buffer is external. | 1073 // True if the assembler owns the buffer, false if buffer is external. |
| 1068 bool own_buffer_; | 1074 bool own_buffer_; |
| 1069 | 1075 |
| 1070 // code generation | 1076 // code generation |
| 1071 byte* pc_; // the program counter; moves forward | 1077 byte* pc_; // the program counter; moves forward |
| 1072 RelocInfoWriter reloc_info_writer; | 1078 RelocInfoWriter reloc_info_writer; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 private: | 1111 private: |
| 1106 Assembler* assembler_; | 1112 Assembler* assembler_; |
| 1107 #ifdef DEBUG | 1113 #ifdef DEBUG |
| 1108 int space_before_; | 1114 int space_before_; |
| 1109 #endif | 1115 #endif |
| 1110 }; | 1116 }; |
| 1111 | 1117 |
| 1112 } } // namespace v8::internal | 1118 } } // namespace v8::internal |
| 1113 | 1119 |
| 1114 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1120 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
| OLD | NEW |