mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1296015 - Don't allocate typed arrays with the wrong AllocKind when tenuring. r=terrence,smvv
This commit is contained in:
parent
44923722a8
commit
b1a515910e
9
js/src/jit-test/tests/basic/bug1296015.js
Normal file
9
js/src/jit-test/tests/basic/bug1296015.js
Normal file
@ -0,0 +1,9 @@
|
||||
function f() {
|
||||
for (var i=0; i<30000; i++) {
|
||||
var a = inIon() ? 0 : 300;
|
||||
var buf = new Uint8ClampedArray(a);
|
||||
(function() {}) * this;
|
||||
}
|
||||
try {} catch(e) {}
|
||||
}
|
||||
f();
|
@ -120,8 +120,7 @@ class TypedArrayObject : public NativeObject
|
||||
AllocKindForLazyBuffer(size_t nbytes)
|
||||
{
|
||||
MOZ_ASSERT(nbytes <= INLINE_BUFFER_LIMIT);
|
||||
/* For GGC we need at least one slot in which to store a forwarding pointer. */
|
||||
size_t dataSlots = Max(size_t(1), AlignBytes(nbytes, sizeof(Value)) / sizeof(Value));
|
||||
size_t dataSlots = AlignBytes(nbytes, sizeof(Value)) / sizeof(Value);
|
||||
MOZ_ASSERT(nbytes <= dataSlots * sizeof(Value));
|
||||
return gc::GetGCObjectKind(FIXED_DATA_START + dataSlots);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user