Lines Matching defs:pos
256 DCHECK(pc_ <= reloc_info_writer.pos()); // No overlap.
276 static_cast<int>(reloc_info_writer.pos() - buffer_->start());
299 // generated code. pos() is the position the label refers to.
302 // to be generated; pos() is the position of the last
357 int Assembler::target_at(int pos, bool is_internal) {
359 int64_t* p = reinterpret_cast<int64_t*>(buffer_start_ + pos);
367 DCHECK(pos > delta);
368 return pos - delta;
371 Instruction* instruction = Instruction::At(buffer_start_ + pos);
373 reinterpret_cast<Instr*>(buffer_start_ + pos), pos);
381 // EndOfChain sentinel is returned directly, not relative to pc or pos.
384 return pos + imm13;
390 // EndOfChain sentinel is returned directly, not relative to pc or pos.
393 return pos + imm21;
399 // EndOfChain sentinel is returned directly, not relative to pc or pos.
402 return pos + imm12;
406 Address pc = reinterpret_cast<Address>(buffer_start_ + pos);
408 uint64_t instr_address = reinterpret_cast<uint64_t>(buffer_start_ + pos);
415 DCHECK(pos > delta);
416 return pos - delta;
421 Instr instr_I = instr_at(pos + 4);
425 return offset + pos;
430 return offset + pos;
436 return pos + offset;
444 return (imm18 + pos);
450 static inline Instr SetBranchOffset(int32_t pos, int32_t target_pos,
452 int32_t imm = target_pos - pos;
490 static inline Instr SetJalOffset(int32_t pos, int32_t target_pos, Instr instr) {
492 int32_t imm = target_pos - pos;
505 static inline ShortInstr SetCJalOffset(int32_t pos, int32_t target_pos,
508 int32_t imm = target_pos - pos;
520 static inline Instr SetCBranchOffset(int32_t pos, int32_t target_pos,
523 int32_t imm = target_pos - pos;
536 void Assembler::target_at_put(int pos, int target_pos, bool is_internal,
540 *reinterpret_cast<uint64_t*>(buffer_start_ + pos) = imm;
544 reinterpret_cast<Instr*>(buffer_start_ + pos), pos,
547 Instruction* instruction = Instruction::At(buffer_start_ + pos);
552 instr = SetBranchOffset(pos, target_pos, instr);
553 instr_at_put(pos, instr);
557 instr = SetJalOffset(pos, target_pos, instr);
558 instr_at_put(pos, instr);
561 Address pc = reinterpret_cast<Address>(buffer_start_ + pos);
567 Instr instr_I = instr_at(pos + 4);
570 int64_t offset = target_pos - pos;
574 instr = SetJalOffset(pos, target_pos, instr);
577 instr_at_put(pos, instr);
578 instr_at_put(pos + 4, kNopByte);
587 instr_at_put(pos, instr_auipc);
592 instr_at_put(pos + 4, instr_I);
596 ShortInstr short_instr = SetCJalOffset(pos, target_pos, instr);
597 instr_at_put(pos, short_instr);
601 instr = SetCBranchOffset(pos, target_pos, instr);
602 instr_at_put(pos, instr);
607 instr_at_put(pos, target_pos + (Code::kHeaderSize - kHeapObjectTag));
617 PrintF("bound label to %d\n", L->pos());
620 l.link_to(L->pos());
623 PrintF("@ %d ", l.pos());
624 Instr instr = instr_at(l.pos());
633 PrintF("label in inconsistent state (pos = %d)\n", L->pos_);
637 void Assembler::bind_to(Label* L, int pos) {
638 DCHECK(0 <= pos && pos <= pc_offset()); // Must have valid binding position.
639 DEBUG_PRINTF("binding %d to label %p\n", pos, L);
650 int fixup_pos = L->pos();
651 int dist = pos - fixup_pos;
658 target_at_put(fixup_pos, pos, is_internal);
671 target_at_put(fixup_pos, pos, false);
683 target_at_put(fixup_pos, pos, false);
685 target_at_put(fixup_pos, pos, false);
689 L->bind_to(pos);
693 if (pos > last_bound_pos_) last_bound_pos_ = pos;
703 int link = target_at(L->pos(), is_internal);
716 return is_intn((pc_offset() - L->pos()), kJumpOffsetBits);
721 return is_intn((pc_offset() - L->pos()), bits);
726 return is_intn((pc_offset() - L->pos()), kBranchOffsetBits);
1376 int32_t Assembler::get_trampoline_entry(int32_t pos) {
1379 DEBUG_PRINTF("\tstart: %d,pos: %d\n", trampoline_.start(), pos);
1380 if (trampoline_.start() > pos) {
1397 target_pos = L->pos();
1400 target_pos = L->pos(); // L's link.
1428 target_pos = L->pos();
1431 target_pos = L->pos(); // L's link.
1459 target_pos = L->pos();
1463 target_pos = L->pos();
1489 target_pos = L->pos();
1493 target_pos = L->pos(); // L's link.
3647 size_t reloc_size = (buffer_start_ + old_size) - reloc_info_writer.pos();
3649 MemMove(reloc_info_writer.pos() + rc_delta, reloc_info_writer.pos(),
3657 reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
3663 base::Vector<const byte> reloc_info{reloc_info_writer.pos(), reloc_size};
3706 data = reinterpret_cast<uint64_t>(buffer_start_ + label->pos());
3709 internal_reference_positions_.insert(label->pos());