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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 Address RelocInfo::wasm_memory_reference() { | 189 Address RelocInfo::wasm_memory_reference() { |
190 DCHECK(IsWasmMemoryReference(rmode_)); | 190 DCHECK(IsWasmMemoryReference(rmode_)); |
191 return Memory::Address_at(pc_); | 191 return Memory::Address_at(pc_); |
192 } | 192 } |
193 | 193 |
194 uint32_t RelocInfo::wasm_memory_size_reference() { | 194 uint32_t RelocInfo::wasm_memory_size_reference() { |
195 DCHECK(IsWasmMemorySizeReference(rmode_)); | 195 DCHECK(IsWasmMemorySizeReference(rmode_)); |
196 return Memory::uint32_at(pc_); | 196 return Memory::uint32_at(pc_); |
197 } | 197 } |
198 | 198 |
| 199 uint32_t RelocInfo::wasm_function_index() { |
| 200 DCHECK(IsWasmCall(rmode_)); |
| 201 return Memory::uint32_at(pc_); |
| 202 } |
| 203 |
199 void RelocInfo::update_wasm_memory_reference( | 204 void RelocInfo::update_wasm_memory_reference( |
200 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 205 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
201 ICacheFlushMode icache_flush_mode) { | 206 ICacheFlushMode icache_flush_mode) { |
202 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | 207 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
203 if (IsWasmMemoryReference(rmode_)) { | 208 if (IsWasmMemoryReference(rmode_)) { |
204 Address updated_reference; | 209 Address updated_reference; |
205 DCHECK(old_base <= wasm_memory_reference() && | 210 DCHECK(old_base <= wasm_memory_reference() && |
206 wasm_memory_reference() < old_base + old_size); | 211 wasm_memory_reference() < old_base + old_size); |
207 updated_reference = new_base + (wasm_memory_reference() - old_base); | 212 updated_reference = new_base + (wasm_memory_reference() - old_base); |
208 DCHECK(new_base <= updated_reference && | 213 DCHECK(new_base <= updated_reference && |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 RelocInfo::Mode rmode, | 1601 RelocInfo::Mode rmode, |
1597 TypeFeedbackId ast_id) { | 1602 TypeFeedbackId ast_id) { |
1598 positions_recorder()->WriteRecordedPositions(); | 1603 positions_recorder()->WriteRecordedPositions(); |
1599 EnsureSpace ensure_space(this); | 1604 EnsureSpace ensure_space(this); |
1600 DCHECK(RelocInfo::IsCodeTarget(rmode) | 1605 DCHECK(RelocInfo::IsCodeTarget(rmode) |
1601 || rmode == RelocInfo::CODE_AGE_SEQUENCE); | 1606 || rmode == RelocInfo::CODE_AGE_SEQUENCE); |
1602 EMIT(0xE8); | 1607 EMIT(0xE8); |
1603 emit(code, rmode, ast_id); | 1608 emit(code, rmode, ast_id); |
1604 } | 1609 } |
1605 | 1610 |
| 1611 void Assembler::wasm_call(uint32_t index, RelocInfo::Mode rmode) { |
| 1612 DCHECK(RelocInfo::IsWasmCall(rmode)); |
| 1613 positions_recorder()->WriteRecordedPositions(); |
| 1614 EnsureSpace ensure_space(this); |
| 1615 EMIT(0xE8); |
| 1616 RecordRelocInfo(rmode); |
| 1617 |
| 1618 emit(index); |
| 1619 } |
1606 | 1620 |
1607 void Assembler::jmp(Label* L, Label::Distance distance) { | 1621 void Assembler::jmp(Label* L, Label::Distance distance) { |
1608 EnsureSpace ensure_space(this); | 1622 EnsureSpace ensure_space(this); |
1609 if (L->is_bound()) { | 1623 if (L->is_bound()) { |
1610 const int short_size = 2; | 1624 const int short_size = 2; |
1611 const int long_size = 5; | 1625 const int long_size = 5; |
1612 int offs = L->pos() - pc_offset(); | 1626 int offs = L->pos() - pc_offset(); |
1613 DCHECK(offs <= 0); | 1627 DCHECK(offs <= 0); |
1614 if (is_int8(offs - short_size)) { | 1628 if (is_int8(offs - short_size)) { |
1615 // 1110 1011 #8-bit disp. | 1629 // 1110 1011 #8-bit disp. |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3088 fflush(coverage_log); | 3102 fflush(coverage_log); |
3089 } | 3103 } |
3090 } | 3104 } |
3091 | 3105 |
3092 #endif | 3106 #endif |
3093 | 3107 |
3094 } // namespace internal | 3108 } // namespace internal |
3095 } // namespace v8 | 3109 } // namespace v8 |
3096 | 3110 |
3097 #endif // V8_TARGET_ARCH_IA32 | 3111 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |