Index: webkitgtk-2.46.6/Source/JavaScriptCore/runtime/MathCommon.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/JavaScriptCore/runtime/MathCommon.cpp
+++ webkitgtk-2.46.6/Source/JavaScriptCore/runtime/MathCommon.cpp
@@ -657,11 +657,6 @@ static inline double roundeven(double op
 }
 #endif
 
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f32_roundeven, float, (float operand)) { return roundevenf(operand); }
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f64_roundeven, double, (double operand)) { return roundeven(operand); }
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f32_trunc, float, (float operand)) { return std::trunc(operand); }
-JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f64_trunc, double, (double operand)) { return std::trunc(operand); }
-
 JSC_DEFINE_NOEXCEPT_JIT_OPERATION(i32_div_s, int32_t, (int32_t a, int32_t b)) { return a / b; }
 JSC_DEFINE_NOEXCEPT_JIT_OPERATION(i32_div_u, uint32_t, (uint32_t a, uint32_t b)) { return a / b; }
 JSC_DEFINE_NOEXCEPT_JIT_OPERATION(i32_rem_s, int32_t, (int32_t a, int32_t b)) { return a % b; }
Index: webkitgtk-2.46.6/Source/JavaScriptCore/runtime/MathCommon.h
===================================================================
--- webkitgtk-2.46.6.orig/Source/JavaScriptCore/runtime/MathCommon.h
+++ webkitgtk-2.46.6/Source/JavaScriptCore/runtime/MathCommon.h
@@ -378,10 +378,6 @@ JSC_DECLARE_NOEXCEPT_JIT_OPERATION(round
 
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f32_nearest, float, (float));
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f64_nearest, double, (double));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f32_roundeven, float, (float));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f64_roundeven, double, (double));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f32_trunc, float, (float));
-JSC_DECLARE_NOEXCEPT_JIT_OPERATION(f64_trunc, double, (double));
 
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(i32_div_s, int32_t, (int32_t, int32_t));
 JSC_DECLARE_NOEXCEPT_JIT_OPERATION(i32_div_u, uint32_t, (uint32_t, uint32_t));
Index: webkitgtk-2.46.6/Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp
===================================================================
--- webkitgtk-2.46.6.orig/Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp
+++ webkitgtk-2.46.6/Source/JavaScriptCore/wasm/WasmOMGIRGenerator32_64.cpp
@@ -5582,36 +5582,52 @@ auto OMGIRGenerator::addF32ConvertUI64(E
 auto OMGIRGenerator::addF64Nearest(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f64_roundeven));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Double, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Double, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardNearestIntDouble(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
 auto OMGIRGenerator::addF32Nearest(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f32_roundeven));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Float, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Float, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardNearestIntFloat(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
 auto OMGIRGenerator::addF64Trunc(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f64_trunc));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Double, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Double, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardZeroDouble(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
 auto OMGIRGenerator::addF32Trunc(ExpressionType argVar, ExpressionType& result) -> PartialResult
 {
     Value* arg = get(argVar);
-    Value* callee = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<OperationPtrTag>(Math::f32_trunc));
-    Value* call = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Float, origin(), callee, arg);
-    result = push(call);
+    PatchpointValue* patchpoint = m_currentBlock->appendNew<PatchpointValue>(m_proc, Float, origin());
+    patchpoint->append(arg, ValueRep::SomeRegister);
+    patchpoint->setGenerator([=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
+        jit.roundTowardZeroFloat(params[1].fpr(), params[0].fpr());
+    });
+    patchpoint->effects = Effects::none();
+    result = push(patchpoint);
     return { };
 }
 
