Skip to content

Commit 209b915

Browse files
dstolfasxa
authored andcommitted
deps: V8: cherry-pick 1441665e0d87
Original commit message: [riscv] Fix the RISC-V build. Due to recent changes, there were missing implementations of various methods needed in the simulator and Maglev. Additionally, a static_cast is needed in the assembler to silence a warning. Port commit dfc894cd22d86ce42830e3bfdf485d963f6396ad Port commit c33af9bd408eadd6b62571f862bcb5b763c98ad9 Change-Id: Ie37a1cfa8225fc12f367ff62139cc7cd8fa967d0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6396542 Reviewed-by: Victor Gomes <[email protected]> Commit-Queue: Yahan Lu (LuYahan) <[email protected]> Reviewed-by: Ji Qiu <[email protected]> Reviewed-by: Yahan Lu (LuYahan) <[email protected]> Cr-Commit-Position: refs/heads/main@{#99706} Refs: v8/v8@1441665
1 parent c361a62 commit 209b915

File tree

5 files changed

+40
-3
lines changed

5 files changed

+40
-3
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Reset this number to 0 on major V8 upgrades.
4040
# Increment by one for each non-official patch applied to deps/v8.
41-
'v8_embedder_string': '-node.37',
41+
'v8_embedder_string': '-node.38',
4242

4343
##### V8 defaults for Node.js #####
4444

deps/v8/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,4 @@ Kotaro Ohsugi <[email protected]>
334334
Jing Peiyang <[email protected]>
335335
magic-akari <[email protected]>
336336
Ryuhei Shima <[email protected]>
337+
Domagoj Stolfa <[email protected]>

deps/v8/src/codegen/riscv/assembler-riscv-inl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ void Assembler::set_target_compressed_address_at(
115115
Address pc, Address constant_pool, Tagged_t target,
116116
WritableJitAllocation* jit_allocation, ICacheFlushMode icache_flush_mode) {
117117
if (COMPRESS_POINTERS_BOOL) {
118-
Assembler::set_uint32_constant_at(pc, constant_pool, target, jit_allocation,
119-
icache_flush_mode);
118+
Assembler::set_uint32_constant_at(pc, constant_pool,
119+
static_cast<uint32_t>(target),
120+
jit_allocation, icache_flush_mode);
120121
} else {
121122
UNREACHABLE();
122123
}

deps/v8/src/execution/riscv/simulator-riscv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ class Simulator : public SimulatorBase {
538538
// Return central stack view, without additional safety margins.
539539
// Users, for example wasm::StackMemory, can add their own.
540540
base::Vector<uint8_t> GetCentralStackView() const;
541+
static constexpr int JSStackLimitMargin() { return kAdditionalStackMargin; }
541542

542543
void IterateRegistersAndStack(::heap::base::StackVisitor* visitor);
543544

deps/v8/src/maglev/riscv/maglev-ir-riscv.cc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,40 @@ void CheckedIntPtrToInt32::GenerateCode(MaglevAssembler* masm,
224224
Operand(std::numeric_limits<int32_t>::min()));
225225
}
226226

227+
void CheckFloat64SameValue::SetValueLocationConstraints() {
228+
UseRegister(target_input());
229+
// We need two because LoadFPRImmediate needs to acquire one as well in the
230+
// case where value() is not 0.0 or -0.0.
231+
set_temporaries_needed((value().get_scalar() == 0) ? 1 : 2);
232+
set_double_temporaries_needed(
233+
value().is_nan() || (value().get_scalar() == 0) ? 0 : 1);
234+
}
235+
236+
void CheckFloat64SameValue::GenerateCode(MaglevAssembler* masm,
237+
const ProcessingState& state) {
238+
Label* fail = __ GetDeoptLabel(this, deoptimize_reason());
239+
MaglevAssembler::TemporaryRegisterScope temps(masm);
240+
DoubleRegister target = ToDoubleRegister(target_input());
241+
if (value().is_nan()) {
242+
__ JumpIfNotNan(target, fail);
243+
} else {
244+
DoubleRegister double_scratch = temps.AcquireScratchDouble();
245+
Register scratch = temps.AcquireScratch();
246+
__ Move(double_scratch, value().get_scalar());
247+
__ CompareF64(scratch, EQ, double_scratch, target);
248+
__ BranchFalseF(scratch, fail);
249+
if (value().get_scalar() == 0) { // +0.0 or -0.0.
250+
__ MacroAssembler::Move(scratch, target);
251+
__ And(scratch, scratch, Operand(1ULL << 63));
252+
if (value().get_bits() == 0) {
253+
__ BranchTrueF(scratch, fail);
254+
} else {
255+
__ BranchFalseF(scratch, fail);
256+
}
257+
}
258+
}
259+
}
260+
227261
void Int32AddWithOverflow::SetValueLocationConstraints() {
228262
UseRegister(left_input());
229263
UseRegister(right_input());

0 commit comments

Comments
 (0)