| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0f19304 commit c95a4a0
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | 39 | # Reset this number to 0 on major V8 upgrades. | |
| 40 | 40 | # Increment by one for each non-official patch applied to deps/v8. | |
| 41 | - 'v8_embedder_string': '-node.37', | ||
| 41 | + 'v8_embedder_string': '-node.38', | ||
| 42 | 42 | ||
| 43 | 43 | ##### V8 defaults for Node.js ##### | |
| 44 | 44 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -720,8 +720,8 @@ void Assembler::bind_to(Label* L, int pos) { | |||
| 720 | 720 | trampoline_pos = get_trampoline_entry(fixup_pos); | |
| 721 | 721 | CHECK_NE(trampoline_pos, kInvalidSlotPos); | |
| 722 | 722 | } | |
| 723 | - CHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset); | ||
| 724 | 723 | DEBUG_PRINTF("\t\ttrampolining: %d\n", trampoline_pos); | |
| 724 | + CHECK((trampoline_pos - fixup_pos) <= kMaxBranchOffset); | ||
| 725 | 725 | target_at_put(fixup_pos, trampoline_pos, false); | |
| 726 | 726 | fixup_pos = trampoline_pos; | |
| 727 | 727 | } | |
@@ -1486,6 +1486,7 @@ void Assembler::BlockTrampolinePoolFor(int instructions) { | |||
| 1486 | 1486 | } | |
| 1487 | 1487 | ||
| 1488 | 1488 | void Assembler::CheckTrampolinePool() { | |
| 1489 | + if (trampoline_emitted_) return; | ||
| 1489 | 1490 | // Some small sequences of instructions must not be broken up by the | |
| 1490 | 1491 | // insertion of a trampoline pool; such sequences are protected by setting | |
| 1491 | 1492 | // either trampoline_pool_blocked_nesting_ or no_trampoline_pool_before_, | |
@@ -1507,7 +1508,6 @@ void Assembler::CheckTrampolinePool() { | |||
| 1507 | 1508 | return; | |
| 1508 | 1509 | } | |
| 1509 | 1510 | ||
| 1510 | - DCHECK(!trampoline_emitted_); | ||
| 1511 | 1511 | DCHECK_GE(unbound_labels_count_, 0); | |
| 1512 | 1512 | if (unbound_labels_count_ > 0) { | |
| 1513 | 1513 | // First we emit jump, then we emit trampoline pool. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -303,6 +303,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase, | |||
| 303 | 303 | // See Assembler::CheckConstPool for more info. | |
| 304 | 304 | void EmitPoolGuard(); | |
| 305 | 305 | ||
| 306 | + void FinishCode() { ForceConstantPoolEmissionWithoutJump(); } | ||
| 307 | + | ||
| 306 | 308 | #if defined(V8_TARGET_ARCH_RISCV64) | |
| 307 | 309 | static void set_target_value_at( | |
| 308 | 310 | Address pc, uint64_t target, | |
@@ -617,6 +619,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase, | |||
| 617 | 619 | } | |
| 618 | 620 | } | |
| 619 | 621 | ||
| 622 | + inline int next_buffer_check() { return next_buffer_check_; } | ||
| 623 | + | ||
| 620 | 624 | friend class VectorUnit; | |
| 621 | 625 | class VectorUnit { | |
| 622 | 626 | public: | |
@@ -728,16 +732,19 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase, | |||
| 728 | 732 | ||
| 729 | 733 | // Block the emission of the trampoline pool before pc_offset. | |
| 730 | 734 | void BlockTrampolinePoolBefore(int pc_offset) { | |
| 731 | - if (no_trampoline_pool_before_ < pc_offset) | ||
| 735 | + if (no_trampoline_pool_before_ < pc_offset) { | ||
| 736 | + DEBUG_PRINTF("\tBlockTrampolinePoolBefore %d\n", pc_offset); | ||
| 732 | 737 | no_trampoline_pool_before_ = pc_offset; | |
| 738 | + } | ||
| 733 | 739 | } | |
| 734 | 740 | ||
| 735 | 741 | void StartBlockTrampolinePool() { | |
| 736 | - DEBUG_PRINTF("\tStartBlockTrampolinePool\n"); | ||
| 742 | + DEBUG_PRINTF("\tStartBlockTrampolinePool %d\n", pc_offset()); | ||
| 737 | 743 | trampoline_pool_blocked_nesting_++; | |
| 738 | 744 | } | |
| 739 | 745 | ||
| 740 | 746 | void EndBlockTrampolinePool() { | |
| 747 | + DEBUG_PRINTF("\tEndBlockTrampolinePool\n"); | ||
| 741 | 748 | trampoline_pool_blocked_nesting_--; | |
| 742 | 749 | DEBUG_PRINTF("\ttrampoline_pool_blocked_nesting:%d\n", | |
| 743 | 750 | trampoline_pool_blocked_nesting_); | |
@@ -767,6 +774,10 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase, | |||
| 767 | 774 | ||
| 768 | 775 | bool is_buffer_growth_blocked() const { return block_buffer_growth_; } | |
| 769 | 776 | ||
| 777 | + inline int ConstpoolComputesize() { | ||
| 778 | + return constpool_.ComputeSize(Jump::kOmitted, Alignment::kOmitted); | ||
| 779 | + } | ||
| 780 | + | ||
| 770 | 781 | private: | |
| 771 | 782 | // Avoid overflows for displacements etc. | |
| 772 | 783 | static const int kMaximalBufferSize = 512 * MB; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4926,11 +4926,22 @@ void MacroAssembler::LoadRootRegisterOffset(Register destination, | |||
| 4926 | 4926 | ||
| 4927 | 4927 | void MacroAssembler::Jump(Register target, Condition cond, Register rs, | |
| 4928 | 4928 | const Operand& rt) { | |
| 4929 | - BlockTrampolinePoolScope block_trampoline_pool(this); | ||
| 4930 | 4929 | if (cond == cc_always) { | |
| 4931 | 4930 | jr(target); | |
| 4931 | + DEBUG_PRINTF("\tCheckTrampolinePool pc_offset:%d %d\n", pc_offset(), | ||
| 4932 | + next_buffer_check() - ConstpoolComputesize()); | ||
| 4933 | + if (!is_trampoline_emitted() && v8_flags.debug_code && | ||
| 4934 | + pc_offset() >= (next_buffer_check() - ConstpoolComputesize())) { | ||
| 4935 | + // Debug mode will emit more instrs than Release mode. | ||
| 4936 | + // so we need to check trampoline pool before Constant pool. | ||
| 4937 | + // Here need to emit trampoline first. | ||
| 4938 | + // Jump(ra, al) will block trampoline pool for 1 instr. | ||
| 4939 | + nop(); | ||
| 4940 | + CheckTrampolinePool(); | ||
| 4941 | + } | ||
| 4932 | 4942 | ForceConstantPoolEmissionWithoutJump(); | |
| 4933 | 4943 | } else { | |
| 4944 | + BlockTrampolinePoolScope block_trampoline_pool(this); | ||
| 4934 | 4945 | BRANCH_ARGS_CHECK(cond, rs, rt); | |
| 4935 | 4946 | Branch(kInstrSize * 2, NegateCondition(cond), rs, rt); | |
| 4936 | 4947 | jr(target); | |
@@ -5342,9 +5353,6 @@ void MacroAssembler::StoreReturnAddressAndCall(Register target) { | |||
| 5342 | 5353 | ||
| 5343 | 5354 | void MacroAssembler::Ret(Condition cond, Register rs, const Operand& rt) { | |
| 5344 | 5355 | Jump(ra, cond, rs, rt); | |
| 5345 | - if (cond == al) { | ||
| 5346 | - ForceConstantPoolEmissionWithoutJump(); | ||
| 5347 | - } | ||
| 5348 | 5356 | } | |
| 5349 | 5357 | ||
| 5350 | 5358 | void MacroAssembler::BranchLong(Label* L) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments