Fix build x86_64 and i586 76/307376/4
authorDaniil Ruban <intx82@gmail.com>
Thu, 7 Mar 2024 12:06:05 +0000 (13:06 +0100)
committerDae-Hyun Ko <dhyuna.ko@samsung.com>
Mon, 11 Mar 2024 04:37:56 +0000 (04:37 +0000)
* Removes constexpr in `v8/src/codegen/x64/assembler-x64.h` and `v8/src/wasm/baseline/x64/liftoff-assembler-x64-inl.h`

Change-Id: I5d50bdf03f544d25d111df83a99dfb10fb362d8d

v8/src/codegen/x64/assembler-x64.h
v8/src/wasm/baseline/x64/liftoff-assembler-x64-inl.h

index e4ba454..f7f1596 100644 (file)
@@ -219,7 +219,11 @@ class V8_EXPORT_PRIVATE Operand {
                 "Length must be aligned for fast access.");
 
   // [base + disp/r]
-  V8_INLINE constexpr Operand(Register base, int32_t disp) {
+  V8_INLINE
+#if !defined(__GNUC__) || defined(__clang__)
+  constexpr
+#endif
+  Operand(Register base, int32_t disp) {
     if (base == rsp || base == r12) {
       // SIB byte is needed to encode (rsp + offset) or (r12 + offset).
       set_sib(times_1, rsp, base);
@@ -328,7 +332,11 @@ class V8_EXPORT_PRIVATE Operand {
     memory_.len = 2;
   }
 
-  V8_INLINE constexpr void set_disp8(int disp) {
+  V8_INLINE
+#if !defined(__GNUC__) || defined(__clang__)
+  constexpr
+#endif
+  void set_disp8(int disp) {
     V8_ASSUME(memory_.len == 1 || memory_.len == 2);
     DCHECK(is_int8(disp));
     memory_.buf[memory_.len] = disp;
index 74b6da2..fbbc754 100644 (file)
@@ -48,13 +48,19 @@ constexpr int kInstanceOffset = 16;
 // rbp-24 is the feedback vector.
 constexpr int kFeedbackVectorOffset = 24;
 
-inline constexpr Operand GetStackSlot(int offset) {
+inline
+#if  !defined(__GNUC__) || defined(__clang__)
+  constexpr
+#endif
+Operand GetStackSlot(int offset) {
   return Operand(rbp, -offset);
 }
 
+#if !defined(__GNUC__) || defined(__clang__)
 constexpr Operand kInstanceOperand = GetStackSlot(kInstanceOffset);
 
 constexpr Operand kOSRTargetSlot = GetStackSlot(kOSRTargetOffset);
+#endif
 
 inline Operand GetMemOp(LiftoffAssembler* assm, Register addr,
                         Register offset_reg, uintptr_t offset_imm,
@@ -287,7 +293,7 @@ void LiftoffAssembler::AbortCompilation() {}
 
 // static
 constexpr int LiftoffAssembler::StaticStackFrameSize() {
-  return kOSRTargetOffset;
+  return v8::internal::wasm::kOSRTargetOffset;
 }
 
 int LiftoffAssembler::SlotSizeForType(ValueKind kind) {
@@ -341,7 +347,11 @@ void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value) {
 }
 
 void LiftoffAssembler::LoadInstanceFromFrame(Register dst) {
+#if !defined(__GNUC__) || defined(__clang__)
   movq(dst, liftoff::kInstanceOperand);
+#else
+  movq(dst, liftoff::GetStackSlot(liftoff::kInstanceOffset));
+#endif
 }
 
 void LiftoffAssembler::LoadFromInstance(Register dst, Register instance,
@@ -388,11 +398,19 @@ void LiftoffAssembler::LoadExternalPointer(Register dst, Register src_addr,
 }
 
 void LiftoffAssembler::SpillInstance(Register instance) {
+#if !defined(__GNUC__) || defined(__clang__)
   movq(liftoff::kInstanceOperand, instance);
+#else
+  movq(liftoff::GetStackSlot(liftoff::kInstanceOffset), instance);
+#endif
 }
 
 void LiftoffAssembler::ResetOSRTarget() {
+#if !defined(__GNUC__) || defined(__clang__)
   movq(liftoff::kOSRTargetSlot, Immediate(0));
+#else
+  movq(liftoff::GetStackSlot(v8::internal::wasm::kOSRTargetOffset), Immediate(0));
+#endif
 }
 
 void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
@@ -4360,7 +4378,11 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
 }
 
 void LiftoffAssembler::MaybeOSR() {
+#if !defined(__GNUC__) || defined(__clang__)
   cmpq(liftoff::kOSRTargetSlot, Immediate(0));
+#else
+  cmpq(liftoff::GetStackSlot(v8::internal::wasm::kOSRTargetOffset), Immediate(0));
+#endif
   j(not_equal, static_cast<Address>(Builtin::kWasmOnStackReplace),
     RelocInfo::WASM_STUB_CALL);
 }