| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 DCHECK(IsWasmMemorySizeReference(rmode_)); | 115 DCHECK(IsWasmMemorySizeReference(rmode_)); |
| 116 return Memory::uint32_at(pc_); | 116 return Memory::uint32_at(pc_); |
| 117 } | 117 } |
| 118 | 118 |
| 119 uint32_t RelocInfo::wasm_function_table_size_reference() { | 119 uint32_t RelocInfo::wasm_function_table_size_reference() { |
| 120 DCHECK(IsWasmFunctionTableSizeReference(rmode_)); | 120 DCHECK(IsWasmFunctionTableSizeReference(rmode_)); |
| 121 return Memory::uint32_at(pc_); | 121 return Memory::uint32_at(pc_); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void RelocInfo::unchecked_update_wasm_memory_reference( | 124 void RelocInfo::unchecked_update_wasm_memory_reference( |
| 125 Address address, ICacheFlushMode icache_flush_mode) { | 125 Isolate* isolate, Address address, ICacheFlushMode icache_flush_mode) { |
| 126 Memory::Address_at(pc_) = address; | 126 Memory::Address_at(pc_) = address; |
| 127 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 127 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 128 Assembler::FlushICache(isolate_, pc_, sizeof(Address)); | 128 Assembler::FlushICache(isolate, pc_, sizeof(Address)); |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 void RelocInfo::unchecked_update_wasm_size(uint32_t size, | 132 void RelocInfo::unchecked_update_wasm_size(Isolate* isolate, uint32_t size, |
| 133 ICacheFlushMode icache_flush_mode) { | 133 ICacheFlushMode icache_flush_mode) { |
| 134 Memory::uint32_at(pc_) = size; | 134 Memory::uint32_at(pc_) = size; |
| 135 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 135 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
| 136 Assembler::FlushICache(isolate_, pc_, sizeof(uint32_t)); | 136 Assembler::FlushICache(isolate, pc_, sizeof(uint32_t)); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 // ----------------------------------------------------------------------------- | 140 // ----------------------------------------------------------------------------- |
| 141 // Implementation of Operand | 141 // Implementation of Operand |
| 142 | 142 |
| 143 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { | 143 Operand::Operand(Register base, int32_t disp, RelocInfo::Mode rmode) { |
| 144 // [base + disp/r] | 144 // [base + disp/r] |
| 145 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { | 145 if (disp == 0 && RelocInfo::IsNone(rmode) && !base.is(ebp)) { |
| 146 // [base] | 146 // [base] |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 | 216 |
| 217 // ----------------------------------------------------------------------------- | 217 // ----------------------------------------------------------------------------- |
| 218 // Implementation of Assembler. | 218 // Implementation of Assembler. |
| 219 | 219 |
| 220 // Emit a single byte. Must always be inlined. | 220 // Emit a single byte. Must always be inlined. |
| 221 #define EMIT(x) \ | 221 #define EMIT(x) \ |
| 222 *pc_++ = (x) | 222 *pc_++ = (x) |
| 223 | 223 |
| 224 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) | 224 Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size) |
| 225 : AssemblerBase(isolate, buffer, buffer_size) { | 225 : AssemblerBase(isolate_data, buffer, buffer_size) { |
| 226 // Clear the buffer in debug mode unless it was provided by the | 226 // Clear the buffer in debug mode unless it was provided by the |
| 227 // caller in which case we can't be sure it's okay to overwrite | 227 // caller in which case we can't be sure it's okay to overwrite |
| 228 // existing code in it; see CodePatcher::CodePatcher(...). | 228 // existing code in it; see CodePatcher::CodePatcher(...). |
| 229 #ifdef DEBUG | 229 #ifdef DEBUG |
| 230 if (own_buffer_) { | 230 if (own_buffer_) { |
| 231 memset(buffer_, 0xCC, buffer_size_); // int3 | 231 memset(buffer_, 0xCC, buffer_size_); // int3 |
| 232 } | 232 } |
| 233 #endif | 233 #endif |
| 234 | 234 |
| 235 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); | 235 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); |
| (...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2208 return; | 2208 return; |
| 2209 } | 2209 } |
| 2210 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); | 2210 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); |
| 2211 reloc_info_writer.Write(&rinfo); | 2211 reloc_info_writer.Write(&rinfo); |
| 2212 } | 2212 } |
| 2213 | 2213 |
| 2214 } // namespace internal | 2214 } // namespace internal |
| 2215 } // namespace v8 | 2215 } // namespace v8 |
| 2216 | 2216 |
| 2217 #endif // V8_TARGET_ARCH_X87 | 2217 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |