commit 7a6dcba50e3fbbe42cd56cc36b60cc9d9672a4dd
parent 028dec669c7ee39eb14a28ad909b84c9b016f01e
Author: André Bargull <andre.bargull@gmail.com>
Date: Tue, 21 Oct 2025 07:05:43 +0000
Bug 1991402 - Part 14: Implement LoadFixedSlotTypedResult for IonCacheIRCompiler. r=jandem
`LoadFixedSlotTypedResult` is needed for inlined `Date.prototype.getTime`.
Differential Revision: https://phabricator.services.mozilla.com/D266770
Diffstat:
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/js/src/jit-test/tests/cacheir/inlinable-native-accessor-6.js b/js/src/jit-test/tests/cacheir/inlinable-native-accessor-6.js
@@ -9,3 +9,13 @@ function testMathRandom() {
}
}
testMathRandom();
+
+function testDateGetTime() {
+ Object.defineProperty(Date.prototype, "time", {get: Date.prototype.getTime});
+
+ var d = new Date(0);
+ for (var i = 0; i < 100; ++i) {
+ assertEq(d.time, 0);
+ }
+}
+testDateGetTime();
diff --git a/js/src/jit/IonCacheIRCompiler.cpp b/js/src/jit/IonCacheIRCompiler.cpp
@@ -940,7 +940,8 @@ bool IonCacheIRCompiler::emitLoadFixedSlotResult(ObjOperandId objId,
bool IonCacheIRCompiler::emitLoadFixedSlotTypedResult(ObjOperandId objId,
uint32_t offsetOffset,
ValueType) {
- MOZ_CRASH("Call ICs not used in ion");
+ // The type is only used by Warp.
+ return emitLoadFixedSlotResult(objId, offsetOffset);
}
bool IonCacheIRCompiler::emitLoadDynamicSlotResult(ObjOperandId objId,