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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 baseRegister = rb; | 332 baseRegister = rb; |
333 indexRegister = rx; | 333 indexRegister = rx; |
334 offset_ = offset; | 334 offset_ = offset; |
335 } | 335 } |
336 | 336 |
337 // ----------------------------------------------------------------------------- | 337 // ----------------------------------------------------------------------------- |
338 // Specific instructions, constants, and masks. | 338 // Specific instructions, constants, and masks. |
339 | 339 |
340 Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size) | 340 Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size) |
341 : AssemblerBase(isolate_data, buffer, buffer_size), | 341 : AssemblerBase(isolate_data, buffer, buffer_size), |
342 recorded_ast_id_(TypeFeedbackId::None()), | |
343 code_targets_(100) { | 342 code_targets_(100) { |
344 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); | 343 reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_); |
345 | 344 |
346 last_bound_pos_ = 0; | 345 last_bound_pos_ = 0; |
347 ClearRecordedAstId(); | |
348 relocations_.reserve(128); | 346 relocations_.reserve(128); |
349 } | 347 } |
350 | 348 |
351 void Assembler::GetCode(Isolate* isloate, CodeDesc* desc) { | 349 void Assembler::GetCode(Isolate* isloate, CodeDesc* desc) { |
352 EmitRelocations(); | 350 EmitRelocations(); |
353 | 351 |
354 // Set up code descriptor. | 352 // Set up code descriptor. |
355 desc->buffer = buffer_; | 353 desc->buffer = buffer_; |
356 desc->buffer_size = buffer_size_; | 354 desc->buffer_size = buffer_size_; |
357 desc->instr_size = pc_offset(); | 355 desc->instr_size = pc_offset(); |
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1808 DCHECK(r1.code() % 2 == 0); | 1806 DCHECK(r1.code() % 2 == 0); |
1809 rs_form(SRDA, r1, r0, r0, opnd.immediate()); | 1807 rs_form(SRDA, r1, r0, r0, opnd.immediate()); |
1810 } | 1808 } |
1811 | 1809 |
1812 // Shift Right Double Logical | 1810 // Shift Right Double Logical |
1813 void Assembler::srdl(Register r1, const Operand& opnd) { | 1811 void Assembler::srdl(Register r1, const Operand& opnd) { |
1814 DCHECK(r1.code() % 2 == 0); | 1812 DCHECK(r1.code() % 2 == 0); |
1815 rs_form(SRDL, r1, r0, r0, opnd.immediate()); | 1813 rs_form(SRDL, r1, r0, r0, opnd.immediate()); |
1816 } | 1814 } |
1817 | 1815 |
1818 void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode, | 1816 void Assembler::call(Handle<Code> target, RelocInfo::Mode rmode) { |
1819 TypeFeedbackId ast_id) { | |
1820 EnsureSpace ensure_space(this); | 1817 EnsureSpace ensure_space(this); |
1821 | 1818 |
1822 int32_t target_index = emit_code_target(target, rmode, ast_id); | 1819 int32_t target_index = emit_code_target(target, rmode); |
1823 brasl(r14, Operand(target_index)); | 1820 brasl(r14, Operand(target_index)); |
1824 } | 1821 } |
1825 | 1822 |
1826 void Assembler::jump(Handle<Code> target, RelocInfo::Mode rmode, | 1823 void Assembler::jump(Handle<Code> target, RelocInfo::Mode rmode, |
1827 Condition cond) { | 1824 Condition cond) { |
1828 EnsureSpace ensure_space(this); | 1825 EnsureSpace ensure_space(this); |
1829 | 1826 |
1830 int32_t target_index = emit_code_target(target, rmode); | 1827 int32_t target_index = emit_code_target(target, rmode); |
1831 brcl(cond, Operand(target_index)); | 1828 brcl(cond, Operand(target_index)); |
1832 } | 1829 } |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 pc_ += sizeof(uintptr_t); | 2159 pc_ += sizeof(uintptr_t); |
2163 } | 2160 } |
2164 | 2161 |
2165 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { | 2162 void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) { |
2166 if (RelocInfo::IsNone(rmode) || | 2163 if (RelocInfo::IsNone(rmode) || |
2167 // Don't record external references unless the heap will be serialized. | 2164 // Don't record external references unless the heap will be serialized. |
2168 (rmode == RelocInfo::EXTERNAL_REFERENCE && !serializer_enabled() && | 2165 (rmode == RelocInfo::EXTERNAL_REFERENCE && !serializer_enabled() && |
2169 !emit_debug_code())) { | 2166 !emit_debug_code())) { |
2170 return; | 2167 return; |
2171 } | 2168 } |
2172 if (rmode == RelocInfo::CODE_TARGET_WITH_ID) { | |
2173 data = RecordedAstId().ToInt(); | |
2174 ClearRecordedAstId(); | |
2175 } | |
2176 DeferredRelocInfo rinfo(pc_offset(), rmode, data); | 2169 DeferredRelocInfo rinfo(pc_offset(), rmode, data); |
2177 relocations_.push_back(rinfo); | 2170 relocations_.push_back(rinfo); |
2178 } | 2171 } |
2179 | 2172 |
2180 void Assembler::emit_label_addr(Label* label) { | 2173 void Assembler::emit_label_addr(Label* label) { |
2181 CheckBuffer(); | 2174 CheckBuffer(); |
2182 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); | 2175 RecordRelocInfo(RelocInfo::INTERNAL_REFERENCE); |
2183 int position = link(label); | 2176 int position = link(label); |
2184 DCHECK(label->is_bound()); | 2177 DCHECK(label->is_bound()); |
2185 // Keep internal references relative until EmitRelocations. | 2178 // Keep internal references relative until EmitRelocations. |
(...skipping 22 matching lines...) Expand all Loading... |
2208 SKIP_ICACHE_FLUSH); | 2201 SKIP_ICACHE_FLUSH); |
2209 } | 2202 } |
2210 | 2203 |
2211 reloc_info_writer.Write(&rinfo); | 2204 reloc_info_writer.Write(&rinfo); |
2212 } | 2205 } |
2213 } | 2206 } |
2214 | 2207 |
2215 } // namespace internal | 2208 } // namespace internal |
2216 } // namespace v8 | 2209 } // namespace v8 |
2217 #endif // V8_TARGET_ARCH_S390 | 2210 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |